RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607

From: Shawn Steele <Shawn(dot)Steele(at)microsoft(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, "Haifang Wang (Centific Technologies Inc)" <v-haiwang(at)microsoft(dot)com>
Cc: Sandeep Thakkar <sandeep(dot)thakkar(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Rahul Pandey <pandeyrah(at)microsoft(dot)com>, Vishwa Deepak <Vishwa(dot)Deepak(at)microsoft(dot)com>, Amy Wishnousky <amyw(at)microsoft(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Shweta Gulati <gulatishweta(at)microsoft(dot)com>, Ashish Nawal <nawalashish(at)microsoft(dot)com>, Peter Constable <pconstable(at)microsoft(dot)com>
Subject: RE: [EXTERNAL] Re: Windows Application Issues | PostgreSQL | REF # 48475607
Date: 2024-08-28 19:34:22
Message-ID: SJ0PR00MB131822273FA789E742832C3A82952@SJ0PR00MB1318.namprd00.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

+Peter Constable, FYI

-----Original Message-----
From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Sent: Wednesday, August 28, 2024 3:16 AM
To: Haifang Wang (Centific Technologies Inc) <v-haiwang(at)microsoft(dot)com>
Cc: Sandeep Thakkar <sandeep(dot)thakkar(at)enterprisedb(dot)com>; Andrew Dunstan <andrew(at)dunslane(dot)net>; Rahul Pandey <pandeyrah(at)microsoft(dot)com>; Vishwa Deepak <Vishwa(dot)Deepak(at)microsoft(dot)com>; Shawn Steele <Shawn(dot)Steele(at)microsoft(dot)com>; Amy Wishnousky <amyw(at)microsoft(dot)com>; Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>; pgsql-bugs(at)lists(dot)postgresql(dot)org; Shweta Gulati <gulatishweta(at)microsoft(dot)com>; Ashish Nawal <nawalashish(at)microsoft(dot)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(at)microsoft(dot)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 by the setlocale function is such that a subsequent call with that string value and its associated category will restore that part 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-patch to 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've finally understood that these crashes in the Windows runtime library might be generating a stream of crash reports to Microsoft, 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Francisco J. Ossandón 2024-08-29 00:02:50 Re: BUG #18594: CASE WHEN ELSE failing to return the expected output when the same colum is used in WHEN and ELSE
Previous Message Tom Lane 2024-08-28 19:03:28 Re: BUG #18589: pg_get_viewdef returns wrong query