Re: 7.4.2 on Solaris 9 - Error

From: <wespvp(at)syntegra(dot)com>
To: Jan Wieck <JanWieck(at)yahoo(dot)com>, Kris Jurka <books(at)ejurka(dot)com>
Cc: Carmen Gloria Sepulveda Dedes <csepulveda(at)atichile(dot)com>, pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: 7.4.2 on Solaris 9 - Error
Date: 2004-03-25 13:57:26
Message-ID: BC884166.77BD%wespvp@syntegra.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/25/04 7:27 AM, "Jan Wieck" <JanWieck(at)yahoo(dot)com> wrote:

> One other problem I am looking into (and why I tried to compile with
> thread safety in the first place) is that this somehow did not turn on
> -D_REENTRANT in the CFLAGS for libpq. And that leads to libpq not using
> the threadsafe definition of errno, leading to serious communication
> trouble in the end (pqReadData() failing with ENOENT while the real
> error is a harmless EAGAIN from a nonblocking recv()).

This sounds like the problem I just solved late yesterday, except that I'm
seeing it manifest itself in ecpglib with C programs build using ecpg. I had
absolutely no error handling. The error flag was never set. I put some
debug code into the various library functions and found it was setting the
error code in sqlca - but in a different copy of sqlca than was active.

The root problem turns out to be that configure is setting -pthread instead
of -lpthread in config.status. I manually changed the config.status line

s,@THREAD_LIBS@,-pthread,;t t

To

s,@THREAD_LIBS@,-lpthread,;t t

And everything appears to be working now. I don't see -D_REENTRANT being
set, but everything appears to work now.

Let me know if this solves your test case also.

Wes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message wespvp 2004-03-25 14:07:04 Re: Solaris ecpg program doesn't work - pulling my hair
Previous Message H A Prahalad 2004-03-25 13:56:39 PostgreSQL7.3.4-8