Re: BUG #17299: Exit code 3 when open connections concurrently (PQisthreadsafe() == 1)

From: Clemens Zeidler <clemens(at)sussol(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17299: Exit code 3 when open connections concurrently (PQisthreadsafe() == 1)
Date: 2021-11-26 03:10:44
Message-ID: 45a5a8c0-da4c-31f7-0bf9-23a622bc44e6@sussol.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks Tom,

With "C" local you meant running:

> LANGUAGE=C ./my_app

right? unfortunately this didn't give any better errors when crashing...

I had a look at the memory of the crashed process and the second arg for
libintl_dcigettext points to a string in memory: 'connection to server
at "%s" (%s), port %s failed:'

which is the same what my app prints when it is not crashing, e.g.
'Failed to initialize connection 1: connection to server at "localhost"
(::1), port 5432 failed: fe_sendauth: no password supplied'

So it seems we are on the right track (?).

Is this of any further help or should I continue looking in in libintl?
that's part of glib, is it?

Regards

    Clemens

On 26/11/21 9:57 am, Tom Lane wrote:
> PG Bug reporting form <noreply(at)postgresql(dot)org> 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Juan José Santamaría Flecha 2021-11-26 12:37:49 Re: BUG #17288: PSQL bug with COPY command (Windows)
Previous Message Tom Lane 2021-11-25 20:57:32 Re: BUG #17299: Exit code 3 when open connections concurrently (PQisthreadsafe() == 1)