From: Tom Lane <tgl@sss.pgh.pa.us>
To: Frank van Vugt <ftm.van.vugt@foxi.nl>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Multi-threaded user app segfaults when using libpq with separate connections
Date: Mon, 04 Aug 2003 11:47:35 -0400
Message-ID: <2778.1060012055@sss.pgh.pa.us> (raw)
In-Reply-To: <200308041729.13212.ftm.van.vugt@foxi.nl>
References: <200308041729.13212.ftm.van.vugt@foxi.nl>
Frank van Vugt <ftm.van.vugt@foxi.nl> writes:
> // PostgreSQL header <catalog/pg_type.h> redefines errno erroneously.
> #if defined(errno)
> # undef errno
> #endif
> #define errno qt_psql_errno
> #include <catalog/pg_type.h>
> #undef errno
It seems highly unlikely that the above is a good idea. errno is a
macro on all threaded platforms I'm aware of, but the above coding
forgets the definition. The behavior complained of in the comment
is gone anyway in PG 7.3.
Not sure that this explains your problem though.
There are several places in libpq that invoke libc routines that are
not thread-safe (on most platforms anyway). We have attempted to
rectify this for PG 7.4. You may care to try your test with CVS tip and
see if it works better.
regards, tom lane
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-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, ftm.van.vugt@foxi.nl
Subject: Re: Multi-threaded user app segfaults when using libpq with separate connections
In-Reply-To: <2778.1060012055@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