From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | wespvp(at)syntegra(dot)com |
Cc: | Jan Wieck <JanWieck(at)yahoo(dot)com>, Kris Jurka <books(at)ejurka(dot)com>, 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 21:43:03 |
Message-ID: | 200403252143.i2PLh3a15857@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
wespvp(at)syntegra(dot)com wrote:
> 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.
I assume you were using 7.4.0, rather than 7.4.2. Current CVS has in
template/solaris:
# tools/thread/thread_test must be run
# -D_POSIX_PTHREAD_SEMANTICS enables 5-arg getpwuid_r, among other
things
if test "$GCC" = yes
then THREAD_CPPFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
THREAD_LIBS="-pthread"
else THREAD_CPPFLAGS="-mt -D_POSIX_PTHREAD_SEMANTICS"
THREAD_LIBS="-lpthread"
fi
That should work for you.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2004-03-25 21:43:27 | Re: 7.4.2 on Solaris 9 - Error |
Previous Message | Bruce Momjian | 2004-03-25 21:42:05 | Re: 7.4.2 on Solaris 9 - Error |