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