+Peter Constable, FYI
-----Original Message-----
From: Thomas Munro <thomas.munro@gmail.com>
Sent: Wednesday, August 28, 2024 3:16 AM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang@microsoft.com>
Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; Andrew Dunstan <andrew@dunslane.net>; Rahul Pandey
<pandeyrah@microsoft.com>;Vishwa Deepak <Vishwa.Deepak@microsoft.com>; Shawn Steele <Shawn.Steele@microsoft.com>; Amy
Wishnousky<amyw@microsoft.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org; Shweta Gulati
<gulatishweta@microsoft.com>;Ashish Nawal <nawalashish@microsoft.com>
Subject: Re: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
On Tue, Aug 27, 2024 at 9:29 AM Haifang Wang (Centific Technologies
Inc) <v-haiwang@microsoft.com> wrote:
> Just would like to follow up with you about this bug. How is it going with the investigation?
Well, we figured out that Windows is aborting inside setlocale(). The C standard says "The pointer to string returned
bythe setlocale function is such that a subsequent call with that string value and its associated category will restore
thatpart of the program’s locale."
Window does not conform, and crashes itself.
One practical change we could make would be to reject non-ASCII locale names in initdb, as in the attached, and
back-patchto 16. Then the EDB installer (a separate project that is calling initdb and providing the non-ASCII string
containing"ü") would at least get a graceful failure instead of a crash. It hardly makes a difference to the user, but
I'vefinally understood that these crashes in the Windows runtime library might be generating a stream of crash reports
toMicrosoft, which might be bringing you here?
For example:
$ initdb -D asdf --locale="liberté"
The files belonging to this database system will be owned by user "tmunro".
This user must also own the server process.
initdb: error: locale name "liberté" contains non-ASCII characters