Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id C54F62EBA79 for ; Thu, 24 Nov 2011 08:08:10 -0400 (AST) Received: from exprod7og126.obsmtp.com ([64.18.2.206]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RTY65-0007cX-OJ for pgsql-bugs@postgresql.org; Thu, 24 Nov 2011 12:08:10 +0000 Received: from mail-bw0-f52.google.com ([209.85.214.52]) (using TLSv1) by exprod7ob126.postini.com ([64.18.6.12]) with SMTP ID DSNKTs4znC3epB3pbGlFbWehQ6SFxS+TLHr4@postini.com; Thu, 24 Nov 2011 04:08:09 PST Received: by mail-bw0-f52.google.com with SMTP id zv3so2822794bkb.25 for ; Thu, 24 Nov 2011 04:07:56 -0800 (PST) Received: by 10.204.156.82 with SMTP id v18mr5811893bkw.126.1322136475778; Thu, 24 Nov 2011 04:07:55 -0800 (PST) Received: from [192.168.1.100] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id z3sm1221740fan.8.2011.11.24.04.07.54 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Nov 2011 04:07:54 -0800 (PST) Message-ID: <4ECE3399.1070202@enterprisedb.com> Date: Thu, 24 Nov 2011 14:07:53 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.23) Gecko/20111010 Icedove/3.1.15 MIME-Version: 1.0 To: Robert Balser CC: pgsql-bugs@postgresql.org Subject: Re: BUG #6304: initdb fails with loale ko_KR.eucKR References: <201111222118.pAMLICJR064379@wwwmaster.postgresql.org> <4ECE1B0D.6000103@enterprisedb.com> In-Reply-To: <4ECE1B0D.6000103@enterprisedb.com> Content-Type: multipart/mixed; boundary="------------020504050104050602060607" X-Archive-Number: 201111/166 X-Sequence-Number: 31761 This is a multi-part message in MIME format. --------------020504050104050602060607 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 -U --pwfile= >> >> 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 "/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 --------------020504050104050602060607 Content-Type: application/x-sh; name="snprintfcrash.sh" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="snprintfcrash.sh" #!/bin/sh cat > snprintftest.c < #include int main () { char buf[83] = {1}; char *result; char *category="LC_COLLATE"; char *locale="ko_KR.eucKR"; result = setlocale(LC_COLLATE, ""); snprintf(buf, sizeof(buf), "%s=%s", category, result); printf("%s\n", buf); printf("%s\n", setlocale(LC_CTYPE, NULL)); return 0; } EOF cc -Ae -O0 +DD64 -c -o snprintftest.o snprintftest.c cc -Ae -O0 +DD64 -Wl,+b -Wl,'whatever' -Wl,-z snprintftest.o -o snprintftest LC_ALL= LC_CTYPE=ko_KR.eucKR LC_COLLATE=ko_KR.eucKR ./snprintftest --------------020504050104050602060607--