Обсуждение: BUG #6304: initdb fails with loale ko_KR.eucKR

Поиск
Список
Период
Сортировка

BUG #6304: initdb fails with loale ko_KR.eucKR

От
"Robert Balser"
Дата:
The following bug has been logged online:

Bug reference:      6304
Logged by:          Robert Balser
Email address:      robert.balser@hp.com
PostgreSQL version: 9.0.5
Operating system:   HPUX 11.31 ia64
Description:        initdb fails with loale ko_KR.eucKR
Details:

If you set your LANG=ko_KR.eucKR to set your locale to Korean, the initdb
command fails.  It works with other locales, e.g. various Japanese, Chinese,
and even other Korean locales (e.g. ko_KR.utf8).  But ko_KR.eucKR always
fails.  The command being invoked is:

initdb -E UTF8 --no-locale -D <DB_DIR> -U <USER> --pwfile=<PASSWORDFILE>

The output of initdb is an "sh:" error (in Korean), followed by a "fgets
failure:" (also Korean), and then the following in English:

The program "postgres" is needed by initdb but was not found in the same
directory as "<PGDIR>/bin/initdb".  Check your installation.

The postgres binary is of course in that folder, hence working with other
locales.

Re: BUG #6304: initdb fails with loale ko_KR.eucKR

От
Heikki Linnakangas
Дата:
On 22.11.2011 23:18, Robert Balser wrote:
>
> The following bug has been logged online:
>
> Bug reference:      6304
> Logged by:          Robert Balser
> Email address:      robert.balser@hp.com
> PostgreSQL version: 9.0.5
> Operating system:   HPUX 11.31 ia64
> Description:        initdb fails with loale ko_KR.eucKR
> Details:
>
> If you set your LANG=ko_KR.eucKR to set your locale to Korean, the initdb
> command fails.  It works with other locales, e.g. various Japanese, Chinese,
> and even other Korean locales (e.g. ko_KR.utf8).  But ko_KR.eucKR always
> fails.  The command being invoked is:
>
> initdb -E UTF8 --no-locale -D<DB_DIR>  -U<USER>  --pwfile=<PASSWORDFILE>
>
> The output of initdb is an "sh:" error (in Korean), followed by a "fgets
> failure:" (also Korean), and then the following in English:
>
> The program "postgres" is needed by initdb but was not found in the same
> directory as "<PGDIR>/bin/initdb".  Check your installation.
>
> The postgres binary is of course in that folder, hence working with other
> locales.

I got a coredump with this:

bin/initdb --locale=ko_KR.eucKR -D foodata

gdb gives me this stacktrace:

#0  0xc00000000cbdcfa0:0 in __mblen_hp15+0xc0 ()
    from /usr/lib/nls/loc/hpux32/../hpux64/methods.1/libHP15.so
(gdb) bt
#0  0xc00000000cbdcfa0:0 in __mblen_hp15+0xc0 ()
    from /usr/lib/nls/loc/hpux32/../hpux64/methods.1/libHP15.so
#1  0xc00000000033c310:0 in mblen+0xd0 () from /usr/lib/hpux64/libc.so.1
#2  0xc0000000002ea580:0 in __mbstomb+0x80 () from /usr/lib/hpux64/libc.so.1
#3  0xc00000000041b390:0 in __doprnt_main+0x1090 ()
    from /usr/lib/hpux64/libc.so.1
#4  0xc00000000041a2d0:0 in _doprnt+0x30 () from /usr/lib/hpux64/libc.so.1
#5  0xc000000000434c30:0 in snprintf+0x150 () from /usr/lib/hpux64/libc.so.1
#6  0x400000000141d250:0 in pg_perm_setlocale (category=0, locale=0x0)
     at pg_locale.c:188
#7  0x4000000000be7600:0 in main (argc=0, argv=0x0) at main.c:114

Looks like all the variables are zeros, argc=0 and argv=0x0 in the
above, and also

#6  0x400000000141d250:0 in pg_perm_setlocale (category=0, locale=0x0)
     at pg_locale.c:188
188             snprintf(envbuf, LC_ENV_BUFSIZE - 1, "%s=%s", envvar,
result);
(gdb) print envbuf
$1 = 0x0
(gdb) print envvar
$2 = 0x0
(gdb) print result
$3 = 0x0
(gdb)

Very bizarre..

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Re: BUG #6304: initdb fails with loale ko_KR.eucKR

От
Heikki Linnakangas
Дата:
On 24.11.2011 12:23, Heikki Linnakangas wrote:
> On 22.11.2011 23:18, Robert Balser wrote:
>>
>> The following bug has been logged online:
>>
>> Bug reference: 6304
>> Logged by: Robert Balser
>> Email address: robert.balser@hp.com
>> PostgreSQL version: 9.0.5
>> Operating system: HPUX 11.31 ia64
>> Description: initdb fails with loale ko_KR.eucKR
>> Details:
>>
>> If you set your LANG=ko_KR.eucKR to set your locale to Korean, the initdb
>> command fails. It works with other locales, e.g. various Japanese,
>> Chinese,
>> and even other Korean locales (e.g. ko_KR.utf8). But ko_KR.eucKR always
>> fails. The command being invoked is:
>>
>> initdb -E UTF8 --no-locale -D<DB_DIR> -U<USER> --pwfile=<PASSWORDFILE>
>>
>> The output of initdb is an "sh:" error (in Korean), followed by a "fgets
>> failure:" (also Korean), and then the following in English:
>>
>> The program "postgres" is needed by initdb but was not found in the same
>> directory as "<PGDIR>/bin/initdb". Check your installation.
>>
>> The postgres binary is of course in that folder, hence working with other
>> locales.

This doesn't look like a Postgres bug, I was able to reproduce this with
the attached test program. It seems to depend heavily on the linker
options used, this is the minimum set I was able to reduce it to. I
think you'll have to pick it up from here with the HP compiler/
operating system guys..

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Вложения

Re: BUG #6304: initdb fails with loale ko_KR.eucKR

От
"Balser, Robert W"
Дата:
SGVpa2tpLA0KDQpUaGFuayB5b3UgZm9yIHlvdXIgZGV0YWlsZWQgYW5hbHlz
aXMgYW5kIHJlc3BvbnNlLiAgSSBtaWdodCBwbGF5IHdpdGggdGhlIGxpbmtl
ciBvcHRpb25zIC0gcmlnaHQgbm93IEkgYW0gdXNpbmcgdGhlIGRlZmF1bHQg
Ii4vY29uZmlndXJlIDsgbWFrZSBpbnN0YWxsIiBwcm9jZWR1cmUgYW5kIGxl
dHRpbmcgZXZlcnl0aGluZyBoYXBwZW4gYXV0b21hdGljYWxseS4NCg0KQW5v
dGhlciB0aG91Z2h0IHRoYXQgSSBoYWQgd2FzIHRvIHdyYXAgb3VyIHVzZSBv
ZiAiaW5pdGRiIiB3aXRoIGEgc2NyaXB0IHRoYXQgc2V0cyB0aGUgTEFORz1D
IGJlZm9yZWhhbmQgLi4uIHNpbmNlIHdlIGFyZSB1c2luZyAiLS1uby1sb2Nh
bGUiIG9wdGlvbiBhbnl3YXkgaXQgc2VlbXMgbWF5YmUgdW5uZWNlc3Nhcnkg
dG8gaG9ub3IgdGhlIHVzZXIncyBsb2NhbGUuDQoNClRoYW5rc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