Re: [HACKERS] 7.4.2 Build broken on (Sparc) Solaris 7 and 8

2004-03-21 Thread Jim Seymour
Bruce Momjian [EMAIL PROTECTED] wrote:
 
[snip]
 
 OK, patch attached and applied.  It adds configure tests for the 5-arg
 version of getpwuid_r() and properly falls back to the Posix draft
 version you have on Solaris.  Seems Solaris 9 also still has the draft
 version.
[snip]

Well, yes and no.  If you define _POSIX_PTHREAD_SEMANTICS, you get the
5-arg version.  It looks like this has been the case at least back to
Solaris 2.5.1.

I didn't really expect anything prior to 2.5.1 to be an issue, so I
didn't bother looking into fixes for anything beyond that.

Regards,
Jim

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


Re: [HACKERS] 7.4.2 Build broken on (Sparc) Solaris 7 and 8

2004-03-21 Thread Bruce Momjian
Jim Seymour wrote:
 Bruce Momjian [EMAIL PROTECTED] wrote:
  
 [snip]
  
  OK, patch attached and applied.  It adds configure tests for the 5-arg
  version of getpwuid_r() and properly falls back to the Posix draft
  version you have on Solaris.  Seems Solaris 9 also still has the draft
  version.
 [snip]
 
 Well, yes and no.  If you define _POSIX_PTHREAD_SEMANTICS, you get the
 5-arg version.  It looks like this has been the case at least back to
 Solaris 2.5.1.
 
 I didn't really expect anything prior to 2.5.1 to be an issue, so I
 didn't bother looking into fixes for anything beyond that.

Oh, very interesting.  CVS HEAD has in template/solaris:

# tools/thread/thread_test must be run
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 added the -D_POSIX_PTHREAD_SEMANTICS  flags into post-7.4.2, so it
seems this platform would work even without checking for the 4-arg
getpwuid_r version.  However, I noticed that 'man getpwuid_r' only
mentions the 4-arg version.

I will leave the 4-arg check in. The original author thought it might be
needed, and the Solaris manual mentions it, so odds are some other
platforms will hit it too, and perhaps not have the 5-arg version.

Thanks for the research.  I will add a mention in the solaris template
file.

-- 
  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


[HACKERS] 7.4.2 Build broken on (Sparc) Solaris 7 and 8

2004-03-19 Thread Bruce Momjian
 Environment:
 
 SunOS 5.8 Generic_108528-27 sun4u sparc SUNW,Ultra-250
 gcc version 3.3.1
 PostgreSQL-7.4.2
 ./configure --with-java --enable-thread-safety
 
 make results in:
 
 gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes 
 -Wmissing-declarations -fPIC -I. -I../../../src/include   
 -DFRONTEND -DSYSCONFDIR='/usr/local/pgsql/etc'  -c -o thread.o 
 thread.c
 thread.c: In function `pqGetpwuid':
 thread.c:116: error: too many arguments to function `*getpwuid_r*'
 
 
 Environment:
 
 SunOS 5.7 Generic_106541-29 sun4u sparc SUNW,UltraSPARC-IIi-Engine
 gcc version 3.3.1
 PostgreSQL-7.4.2
 ./configure --with-java --enable-thread-safety
 
 make' results in:
 
 gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes 
 -Wmissing-declarations -fPIC -I. -I../../../src/include   
 -DFRONTEND -DSYSCONFDIR='/usr/local/pgsql/etc'  -c -o thread.o 
 thread.c
 thread.c: In function `pqGetpwuid':
 thread.c:116: error: too many arguments to function `*getpwuid_r*'
 thread.c: In function `pqGethostbyname':
 thread.c:189: error: `resbuf' undeclared (first use in this function)
 thread.c:189: error: (Each undeclared identifier is reported only once
 thread.c:189: error: for each function it appears in.)
 
 Diff'ing thread.c between 7.4.1 and 7.4.2, it *looks* like, at first
 blush, nothing changed that should affect the relevant code.
 
 Anybody got any idea what's broken?

Unfortunately, I know exactly what is broken.  First, pre7.4.2 didn't
use thread.c properly.  Now that it does, you are breaking on this
issue:

/*
 * Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
 *getpwuid_r(uid, resultbuf, buffer, buflen)
 * Do we need to support it?  bjm 2003-08-14
 */
/* POSIX version */
getpwuid_r(uid, resultbuf, buffer, buflen, result);

Notice the comment.  Do we have to support getpwuid_r that returns
passwd *, and doesn't take a fourth argument?  Yea, for Solaris 7  8,
we now we now do.  I think you can get yours working by just changing
the call to:
 
   result = getpwuid_r(uid, resultbuf, buffer, buflen);

I will have to add configure tests for this and it will work properly
for you in 7.4.3.

-- 
  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 8: explain analyze is your friend


[HACKERS] 7.4.2 Build broken on (Sparc) Solaris 7 and 8

2004-03-13 Thread Jim Seymour
Hi,

Environment:

SunOS 5.8 Generic_108528-27 sun4u sparc SUNW,Ultra-250
gcc version 3.3.1
PostgreSQL-7.4.2
./configure --with-java --enable-thread-safety

make results in:

gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes 
-Wmissing-declarations -fPIC -I. -I../../../src/include   
-DFRONTEND -DSYSCONFDIR='/usr/local/pgsql/etc'  -c -o thread.o 
thread.c
thread.c: In function `pqGetpwuid':
thread.c:116: error: too many arguments to function `getpwuid_r'


Environment:

SunOS 5.7 Generic_106541-29 sun4u sparc SUNW,UltraSPARC-IIi-Engine
gcc version 3.3.1
PostgreSQL-7.4.2
./configure --with-java --enable-thread-safety

make' results in:

gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes 
-Wmissing-declarations -fPIC -I. -I../../../src/include   
-DFRONTEND -DSYSCONFDIR='/usr/local/pgsql/etc'  -c -o thread.o 
thread.c
thread.c: In function `pqGetpwuid':
thread.c:116: error: too many arguments to function `getpwuid_r'
thread.c: In function `pqGethostbyname':
thread.c:189: error: `resbuf' undeclared (first use in this function)
thread.c:189: error: (Each undeclared identifier is reported only once
thread.c:189: error: for each function it appears in.)

Diff'ing thread.c between 7.4.1 and 7.4.2, it *looks* like, at first
blush, nothing changed that should affect the relevant code.

Anybody got any idea what's broken?

Regards,
Jim
-- 
Jim Seymour  | PGP Public Key available at:
[EMAIL PROTECTED] | http://www.uk.pgp.net/pgpnet/pks-commands.html
http://jimsun.LinxNet.com|

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] 7.4.2 Build broken on (Sparc) Solaris 7 and 8

2004-03-13 Thread Tom Lane
[EMAIL PROTECTED] (Jim Seymour) writes:
 Diff'ing thread.c between 7.4.1 and 7.4.2, it *looks* like, at first
 blush, nothing changed that should affect the relevant code.

 Anybody got any idea what's broken?

The relevant change is probably this one:

2004-02-11 12:32  momjian

* configure, configure.in, src/include/pg_config.h.in
(REL7_4_STABLE): Properly set NEED_REENTRANT_FUNCS for threaded
libpq/ecpg.

Without this patch, no thread locking or *_r functions were being
used.

(I also see some post-7.4.1 changes in src/template/solaris, so you
possibly should look there too.)

I'm betting that thread.c never worked on your platform, but wasn't
compiled before.

Easiest answer is probably to not do --enable-thread-safety.  If you
really want that, you'll need to dig in and figure out how to make that
code work on your platform.  Send a patch if you figure it out.

regards, tom lane

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] 7.4.2 Build broken on (Sparc) Solaris 7 and 8

2004-03-13 Thread Jim Seymour
Tom Lane [EMAIL PROTECTED] wrote:
 
[snip]
 
 (I also see some post-7.4.1 changes in src/template/solaris, so you
 possibly should look there too.)
[snip]
 

I think I have the fix for part of it, but this remains...

gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes 
-Wmissing-declarations -fPIC -I. -I../../../src/include  
-D_POSIX_PTHREAD_SEMANTICS -DFRONTEND 
-DSYSCONFDIR='/usr/local/pgsql/etc'  -c -o thread.o thread.c
thread.c: In function `pqGethostbyname':
thread.c:189: error: `resbuf' undeclared (first use in this function)

Looking at src/port/thread.c, line 189, it looks like somebody typo'd.
Looks like that second parameter should be resultbuf, not resbuf?

The above compile error happens on Solaris 7, but not Solaris 8.  So
next I have to see why the difference and if there *should* be a
difference.  But I still suspect the above is a coding error.  Let me
know and, if so, I'll fix it here, look into the other part, and submit
a patch for it all.

Regards,
Jim



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