From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christian Maurer <c.maurer@gmx.at>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Aw: BUG #18312: libpq: PQsetdbLogin() not thread-safe
Date: Fri, 02 Feb 2024 10:48:56 -0500
Message-ID: <3154181.1706888936@sss.pgh.pa.us> (raw)
In-Reply-To: <trinity-bf4e8296-ed0b-48cd-8a8c-86135d8dd5d9-1706869306101@3c-app-gmx-bap04>
References: <18312-bbbabc8113592b78@postgresql.org>
<trinity-bf4e8296-ed0b-48cd-8a8c-86135d8dd5d9-1706869306101@3c-app-gmx-bap04>
Christian Maurer <c.maurer@gmx.at> writes:
> I managed to capture a stack trace for the crash via WinDbg:
>
> Frame Index Call Site Child-SP Return Address
> [0x0] ntdll!NtTerminateProcess+0x14 0x18aa9fdf88 0x7fffce3cda98
> [0x1] ntdll!RtlExitUserProcess+0xb8 0x18aa9fdf90 0x7fffcd99e82b
> [0x2] KERNEL32!ExitProcessImplementation+0xb 0x18aa9fdfc0 0x7fffcd42a155
> [0x3] msvcrt!_crtExitProcess+0x15 0x18aa9fdff0 0x7fffcd42a7c5
> [0x4] msvcrt!doexit+0x171 0x18aa9fe020 0x7fffcd41f26d
> [0x5] msvcrt!abort+0x8d 0x18aa9fe090 0x68281886
> [0x6] libintl_9!libintl_bindtextdomain+0x56 0x18aa9fe640 0x7fff7dcd2e93
> [0x7] LIBPQ!PQenv2encoding+0x1193 0x18aa9fe670 0x7fff7dcd2c9e
Hm, so it's bindtextdomain() that is aborting. Back at [1]
I wondered whether we needed to introduce a critical section
to prevent multiple threads from calling that concurrently,
even though its docs allege you shouldn't have to. Perhaps
it's thread-safe except on Windows?
regards, tom lane
[1] https://www.postgresql.org/message-id/flat/CAE7q7Eit4Eq2%3Dbxce%3DFm8HAStECjaXUE%3DWBQc-sDDcgJQ7s7eg...
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, c.maurer@gmx.at, pgsql-bugs@lists.postgresql.org
Subject: Re: Aw: BUG #18312: libpq: PQsetdbLogin() not thread-safe
In-Reply-To: <3154181.1706888936@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox