Re: [GENERAL] 7.4.2 on Solaris 9 - Error

2004-03-26 Thread Bruce Momjian
[EMAIL PROTECTED] wrote:
> On 3/25/04 4:13 PM, "Bruce Momjian" <[EMAIL PROTECTED]> wrote:
> 
> > Are you sure your change is correct?  We just added
> > "-D_POSIX_PTHREAD_SEMANTICS" in post 7.4.2, and the submitters did not
> > mention any problems with the -pthread line for gcc.
> > 
> > I just tried it on Sourceforge's Solaris 9 and I see:
> > 
> > bash-2.05$ gcc -pthread
> > gcc: unrecognized option `-pthread'
> > gcc: no input files
> > 
> > which seems to indicate you are right.  I am kind of surprised.  Some
> > platforms to take -pthread, some -lpthread, so I am pretty sure it was
> > specified by the original Solaris guy.
> 
> Don't know...  I assume it was just a typo that wouldn't show up if you were
> using SUNWSPRO compiler instead of GCC.
>  
> > OK, new template/solaris version applied to 7.4.X and head:
> 
> [snip]
> 
> > THREAD_SUPPORT=yes
> > NEED_REENTRANT_FUNCS=yes# 5.6 2003-09-13
> > THREAD_CPPFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
> > if test "$GCC" != yes
> > thenTHREAD_CPPFLAGS="$THREAD_CPPFLAGS -mt"
> > fi
> > THREAD_LIBS="-lpthread"
> 
> Shouldn't that be 
> 
> THREAD_CPPFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
> 
> According to Jan, -D_REENTRANT must also be specified for libpq to be built
> correctly.

OK, I added -D_REENTRANT.

> Why isn't -D_THREAD_SAFE required also?

No idea?  Someone?

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [GENERAL] 7.4.2 on Solaris 9 - Error

2004-03-26 Thread Wes Palmer
On 3/25/04 4:13 PM, "Bruce Momjian" <[EMAIL PROTECTED]> wrote:

> Are you sure your change is correct?  We just added
> "-D_POSIX_PTHREAD_SEMANTICS" in post 7.4.2, and the submitters did not
> mention any problems with the -pthread line for gcc.
> 
> I just tried it on Sourceforge's Solaris 9 and I see:
> 
> bash-2.05$ gcc -pthread
> gcc: unrecognized option `-pthread'
> gcc: no input files
> 
> which seems to indicate you are right.  I am kind of surprised.  Some
> platforms to take -pthread, some -lpthread, so I am pretty sure it was
> specified by the original Solaris guy.

Don't know...  I assume it was just a typo that wouldn't show up if you were
using SUNWSPRO compiler instead of GCC.
 
> OK, new template/solaris version applied to 7.4.X and head:

[snip]

> THREAD_SUPPORT=yes
> NEED_REENTRANT_FUNCS=yes# 5.6 2003-09-13
> THREAD_CPPFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
> if test "$GCC" != yes
> thenTHREAD_CPPFLAGS="$THREAD_CPPFLAGS -mt"
> fi
> THREAD_LIBS="-lpthread"

Shouldn't that be 

THREAD_CPPFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"

According to Jan, -D_REENTRANT must also be specified for libpq to be built
correctly.

Why isn't -D_THREAD_SAFE required also?

Wes


---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [GENERAL] 7.4.2 on Solaris 9 - Error

2004-03-25 Thread Bruce Momjian
Jan Wieck wrote:
> Changing config.status, now that's what I call a quick and dirty hack.
> 
> The attached diff against 7.4.2 incorporates Joe Conway's checks for 
> getqwuid_r() has 4/5 arguments with a pthread compile autoconf check 
> that I found a while back in the gnu autoconf archives.
> 
> I think we should change alltogether to that pthread check.
> 

Intersting.  Would this change require us to update to a newer version
of autoconf?

---

> 
> Jan
> 
> [EMAIL PROTECTED] wrote:
> 
> > On 3/25/04 7:27 AM, "Jan Wieck" <[EMAIL PROTECTED]> 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
> > 
> > 
> > ---(end of broadcast)---
> > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
> 
> 
> -- 
> #==#
> # It's easier to get forgiveness for being wrong than for being right. #
> # Let's break this rule - forgive me.  #
> #== [EMAIL PROTECTED] #

[ application/x-gzip is not supported, skipping... ]

> 
> ---(end of broadcast)---
> TIP 7: don't forget to increase your free space map settings

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [GENERAL] 7.4.2 on Solaris 9 - Error

2004-03-25 Thread Bruce Momjian
Jan Wieck wrote:
> > This problem was just recently fixed in cvs and will go out in the 7.4.3 
> > release.  For no your best bet is to checkout the 7.4 branch from cvs, or 
> > search the pgsql-committers archives to find the patch you need to apply.
> 
> Isn't that funny ... I just yesterday ran into the same problem with 
> 7.4.2 on Solaris.
> 
> 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()).

Please try REL7_4_STABLE to see if that works.  It has several Solaris
thread fixes, both for getpwuid_r and template/solaris.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [GENERAL] 7.4.2 on Solaris 9 - Error

2004-03-25 Thread Bruce Momjian
[EMAIL PROTECTED] wrote:
> On 3/25/04 7:27 AM, "Jan Wieck" <[EMAIL PROTECTED]> 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
thenTHREAD_CPPFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
THREAD_LIBS="-pthread"
elseTHREAD_CPPFLAGS="-mt -D_POSIX_PTHREAD_SEMANTICS"
THREAD_LIBS="-lpthread"
fi

That should work for you.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [GENERAL] 7.4.2 on Solaris 9 - Error

2004-03-25 Thread wespvp
On 3/25/04 3:43 PM, "Bruce Momjian" <[EMAIL PROTECTED]> wrote:

> 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
> thenTHREAD_CPPFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
>THREAD_LIBS="-pthread"
> elseTHREAD_CPPFLAGS="-mt -D_POSIX_PTHREAD_SEMANTICS"
>THREAD_LIBS="-lpthread"
> fi

I'm right in the middle - using 7.4.1 with GCC.  However, I did try 7.4.2
and it has the same problem.

Looks like a typo in template/solaris, and certainly explains the bad
parameter on gcc.  The "if gcc" has the incorrect "-pthread".

This would seem an appropriate place to add - -D_REENTRANT to fix the errno
issue, wouldn't it?

Wes


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [GENERAL] 7.4.2 on Solaris 9 - Error

2004-03-25 Thread Bruce Momjian
[EMAIL PROTECTED] wrote:
> On 3/25/04 3:43 PM, "Bruce Momjian" <[EMAIL PROTECTED]> wrote:
> 
> > 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
> > thenTHREAD_CPPFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
> >THREAD_LIBS="-pthread"
> > elseTHREAD_CPPFLAGS="-mt -D_POSIX_PTHREAD_SEMANTICS"
> >THREAD_LIBS="-lpthread"
> > fi
> 
> I'm right in the middle - using 7.4.1 with GCC.  However, I did try 7.4.2
> and it has the same problem.
> 
> Looks like a typo in template/solaris, and certainly explains the bad
> parameter on gcc.  The "if gcc" has the incorrect "-pthread".
> 
> This would seem an appropriate place to add - -D_REENTRANT to fix the errno
> issue, wouldn't it?

Are you sure your change is correct?  We just added
"-D_POSIX_PTHREAD_SEMANTICS" in post 7.4.2, and the submitters did not
mention any problems with the -pthread line for gcc.

I just tried it on Sourceforge's Solaris 9 and I see:

bash-2.05$ gcc -pthread
gcc: unrecognized option `-pthread'
gcc: no input files

which seems to indicate you are right.  I am kind of surprised.  Some
platforms to take -pthread, some -lpthread, so I am pretty sure it was
specified by the original Solaris guy.

OK, new template/solaris version applied to 7.4.X and head:

---


if test "$GCC" != yes ; then
  CC="$CC -Xa"  # relaxed ISO C mode
  CFLAGS="-O -v"# -v is like gcc -Wall
fi

# Pick right test-and-set (TAS) code.
case $host in
  sparc-*-solaris*)  need_tas=yes; tas_file=solaris_sparc.s ;;
  i?86-*-solaris*)   need_tas=yes; tas_file=solaris_i386.s ;;
esac

THREAD_SUPPORT=yes
NEED_REENTRANT_FUNCS=yes# 5.6 2003-09-13
THREAD_CPPFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
if test "$GCC" != yes 
thenTHREAD_CPPFLAGS="$THREAD_CPPFLAGS -mt"
fi
THREAD_LIBS="-lpthread"

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [GENERAL] 7.4.2 on Solaris 9 - Error

2004-03-25 Thread Jan Wieck
Changing config.status, now that's what I call a quick and dirty hack.

The attached diff against 7.4.2 incorporates Joe Conway's checks for 
getqwuid_r() has 4/5 arguments with a pthread compile autoconf check 
that I found a while back in the gnu autoconf archives.

I think we should change alltogether to that pthread check.

Jan

[EMAIL PROTECTED] wrote:

On 3/25/04 7:27 AM, "Jan Wieck" <[EMAIL PROTECTED]> 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

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


--
#==#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.  #
#== [EMAIL PROTECTED] #


threadsafe-libpq-742.diff.gz
Description: GNU Zip compressed data

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [GENERAL] 7.4.2 on Solaris 9 - Error

2004-03-24 Thread Kris Jurka


On Fri, 19 Mar 2004, Carmen Gloria Sepulveda Dedes wrote:

> Hi.
> 
> I want to install postgres 7.4.2 on solaris 9.
> 
> I configure with:  ./configure --enable-thread-safety
> and it works fine (no error).
> 
> When I do "gmake", I get this error:
> 
> thread.c: In function `pqGetpwuid':
> thread.c:116: error: too many arguments to function `getpwuid_r'
> make[3]: *** [thread.o] Error 1
> make[3]: Leaving directory 
> `/home/postgres/postgresql-7.4.2/src/interfaces/libpq'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/home/postgres/postgresql-7.4.2/src/interfaces'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/home/postgres/postgresql-7.4.2/src'
> make: *** [all] Error 2
> 
> Anybody knows the problem?
> 

This problem was just recently fixed in cvs and will go out in the 7.4.3 
release.  For no your best bet is to checkout the 7.4 branch from cvs, or 
search the pgsql-committers archives to find the patch you need to apply.

Kris Jurka


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly