Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqLoM-0001b2-E9 for pgsql-bugs@arkaria.postgresql.org; Thu, 25 Nov 2021 20:57:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mqLoK-00013W-0F for pgsql-bugs@arkaria.postgresql.org; Thu, 25 Nov 2021 20:57:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqLoJ-00013H-OD for pgsql-bugs@lists.postgresql.org; Thu, 25 Nov 2021 20:57:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqLoD-0004lz-AP for pgsql-bugs@lists.postgresql.org; Thu, 25 Nov 2021 20:57:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1APKvWKm321838; Thu, 25 Nov 2021 15:57:32 -0500 From: Tom Lane To: clemens@sussol.net cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17299: Exit code 3 when open connections concurrently (PQisthreadsafe() == 1) In-reply-to: <17299-7270741958c0b1ab@postgresql.org> References: <17299-7270741958c0b1ab@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 25 Nov 2021 19:43:59 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <321836.1637873852.1@sss.pgh.pa.us> Date: Thu, 25 Nov 2021 15:57:32 -0500 Message-ID: <321837.1637873852@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > We ran into a problem that came up when using diesel-rs to connect to > postgres. The used connection manager spins up connections concurrently on > startup. On Windows 10, the app startup of the client fails occasionally > (thread problem?). The issue can be reproduced in a minimal bin which just > tries to open 10 connections concurrently (see link *). I don't know why there'd be such a limit - some weird Windows limitation, perhaps? Anyway, the immediate failure seems to be in libintl's gettext support: > 04 00007ffa`4f98f2fd : 00000281`eeb36fe0 00000281`eeb36be0 > 00000281`00000000 00000281`eeb21170 : msvcrt!doexit+0x171 > 05 00000000`68284fe3 : 00000000`00000000 00000000`00000000 > 00000000`00000000 00000000`00000000 : msvcrt!abort+0x8d > 06 00000000`6828190c : 00000001`80029288 00000001`80027680 > 00000000`00000000 000000ec`00000000 : libintl_9!libintl_dcigettext+0x643 > 07 00000001`80008313 : 0000212a`1a4222ff 000000ec`7c7fe988 > 00000281`eeb53be0 00007ffa`51e1b9c2 : libintl_9!libintl_dcgettext+0x1c > 08 00000001`8000387e : 00000281`eeb21170 00000281`eeb48dc0 > 00000281`eeb21170 00000281`eeb3fdd0 : LIBPQ!PQpingParams+0x2933 > 09 00000001`8000603c : 00000000`00000000 00000281`eeb21170 > 00000281`eeb01ad0 00000281`eeafc450 : LIBPQ!PQconnectPoll+0x63e > 0a 00000001`80003168 : 00000281`eeb21170 00000281`eeb01ad0 Maybe you'd be able to get a usable error message if you run the app under some other locale --- I'd try "C" locale for starters. gettext() really is not supposed to ever crash like that (at worst, it's supposed to return the original string if it fails to localize it). So I think you have grounds for a bug report to the libintl maintainers, independently of what exactly is causing libpq to want to get a translated message. regards, tom lane