Re: solaris libpq threaded build fails

Lists: pgsql-hackers
From: Andrew Chernow <ac(at)esilo(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: solaris libpq threaded build fails
Date: 2008-11-18 19:07:33
Message-ID: 49231275.6050105@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

for anyone interested....

Solaris 2.5.1 with --enable-thread-safety

configure:25848: gcc -o conftest -O2 -Wall -Wmissing-prototypes
-Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
-fno-strict-aliasing -fwrapv -pthreads -pthreads -D_REENTRANT
-D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DIN_CONFIGURE -lgcc_s
-lvsnprintf conftest.c -lz -lposix4 -lsocket -ldl -lm -lpthread
-lpthread >&5
In file included from conftest.c:129:
./src/test/thread/thread_test.c: In function `main':
./src/test/thread/thread_test.c:179: warning: implicit declaration of
function `mkstemp'
./src/test/thread/thread_test.c:188: warning: implicit declaration of
function `gethostname'
Undefined first referenced
symbol in file
gethostbyname /var/tmp//ccclix3s.o (symbol
belongs to implicit dependency /usr/lib/libnsl.so.1)
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure:25851: $? = 1
configure: program exited with status 1
configure: failed program was:

so far: hpux 10.20, solaris 2.5.1 and cygwin builds all fail when thread
safe is enable.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-13 01:50:37
Message-ID: 200901130150.n0D1obA10836@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


I supposed Solaris 2.5.1 (release 1996) is just too old to add
threading, and this code has been unchanged for years.

---------------------------------------------------------------------------

Andrew Chernow wrote:
> for anyone interested....
>
> Solaris 2.5.1 with --enable-thread-safety
>
> configure:25848: gcc -o conftest -O2 -Wall -Wmissing-prototypes
> -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
> -fno-strict-aliasing -fwrapv -pthreads -pthreads -D_REENTRANT
> -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DIN_CONFIGURE -lgcc_s
> -lvsnprintf conftest.c -lz -lposix4 -lsocket -ldl -lm -lpthread
> -lpthread >&5
> In file included from conftest.c:129:
> ./src/test/thread/thread_test.c: In function `main':
> ./src/test/thread/thread_test.c:179: warning: implicit declaration of
> function `mkstemp'
> ./src/test/thread/thread_test.c:188: warning: implicit declaration of
> function `gethostname'
> Undefined first referenced
> symbol in file
> gethostbyname /var/tmp//ccclix3s.o (symbol
> belongs to implicit dependency /usr/lib/libnsl.so.1)
> ld: fatal: Symbol referencing errors. No output written to conftest
> collect2: ld returned 1 exit status
> configure:25851: $? = 1
> configure: program exited with status 1
> configure: failed program was:
>
> so far: hpux 10.20, solaris 2.5.1 and cygwin builds all fail when thread
> safe is enable.
>
> --
> Andrew Chernow
> eSilo, LLC
> every bit counts
> http://www.esilo.com/
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Emanuel Calvo Franco <postgres(dot)arg(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-13 13:33:58
Message-ID: f205bb120901130533g2aabc27em717e5bb6ced4696d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2009/1/12 Bruce Momjian <bruce(at)momjian(dot)us>:
>
> I supposed Solaris 2.5.1 (release 1996) is just too old to add
> threading, and this code has been unchanged for years.
>
> ---------------------------------------------------------------------------
>
> Andrew Chernow wrote:
>> for anyone interested....
>>
>> Solaris 2.5.1 with --enable-thread-safety
>>
>> configure:25848: gcc -o conftest -O2 -Wall -Wmissing-prototypes
>> -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
>> -fno-strict-aliasing -fwrapv -pthreads -pthreads -D_REENTRANT
>> -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DIN_CONFIGURE -lgcc_s
>> -lvsnprintf conftest.c -lz -lposix4 -lsocket -ldl -lm -lpthread
>> -lpthread >&5
>> In file included from conftest.c:129:
>> ./src/test/thread/thread_test.c: In function `main':
>> ./src/test/thread/thread_test.c:179: warning: implicit declaration of
>> function `mkstemp'
>> ./src/test/thread/thread_test.c:188: warning: implicit declaration of
>> function `gethostname'
>> Undefined first referenced
>> symbol in file
>> gethostbyname /var/tmp//ccclix3s.o (symbol
>> belongs to implicit dependency /usr/lib/libnsl.so.1)
>> ld: fatal: Symbol referencing errors. No output written to conftest
>> collect2: ld returned 1 exit status
>> configure:25851: $? = 1
>> configure: program exited with status 1
>> configure: failed program was:
>>
>> so far: hpux 10.20, solaris 2.5.1 and cygwin builds all fail when thread
>> safe is enable.
>>

Sun garantee 10 years of appilcation compatibility, now we are in 11 version.
thread-safety is the only option that fails?

>> --
>> Andrew Chernow
>> eSilo, LLC
>> every bit counts
>> http://www.esilo.com/
>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> + If your life is a hard drive, Christ can be your backup. +
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

--
Emanuel Calvo Franco
ArPUG / AOSUG Member
Postgresql Support & Admin


From: Andrew Chernow <ac(at)esilo(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-13 15:47:15
Message-ID: 496CB783.7020102@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> I supposed Solaris 2.5.1 (release 1996) is just too old to add
> threading, and this code has been unchanged for years.
>

Yeah, its old. Unfortunately for us, we still have to support it.

To set the record straight, the issue is not threads. Threads work fine
on 2.5.1. This is a configure system linking issue, "gethostbyname"
requires linking with libnsl.so. So, thread_test.c must link with -lnsl.

The bigger issue is that the configure script needs to include -lnsl for
older solaris platforms. Solaris 2.5.1 has "gethostbyname_r" but the
configure check fails for the same reason.

configure:19821: checking for gethostbyname_r
configure:19877: gcc -o conftest -O2 -Wall [...snip...]
Undefined first referenced
symbol in file
gethostbyname_r /var/tmp//ccSuGLEn.o (symbol
belongs to implicit dependency /usr/lib/libnsl.so.1)
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status

This is why thread_test.c thought it had to fall back on gethostbyname
in the first place.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


From: Andrew Chernow <ac(at)esilo(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-13 16:28:12
Message-ID: 496CC11C.1000000@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Chernow wrote:
> Bruce Momjian wrote:
>> I supposed Solaris 2.5.1 (release 1996) is just too old to add
>> threading, and this code has been unchanged for years.
>>
>
> Yeah, its old. Unfortunately for us, we still have to support it.
>
> To set the record straight, the issue is not threads. Threads work fine
> on 2.5.1. This is a configure system linking issue, "gethostbyname"
> requires linking with libnsl.so. So, thread_test.c must link with -lnsl.
>
> The bigger issue is that the configure script needs to include -lnsl for
> older solaris platforms. Solaris 2.5.1 has "gethostbyname_r" but the
> configure check fails for the same reason.
>
> configure:19821: checking for gethostbyname_r
> configure:19877: gcc -o conftest -O2 -Wall [...snip...]
> Undefined first referenced
> symbol in file
> gethostbyname_r /var/tmp//ccSuGLEn.o (symbol
> belongs to implicit dependency /usr/lib/libnsl.so.1)
> ld: fatal: Symbol referencing errors. No output written to conftest
> collect2: ld returned 1 exit status
>
> This is why thread_test.c thought it had to fall back on gethostbyname
> in the first place.
>

Forgot to mention, there is an easy fix:

~]# LDFLAGS="-lnsl" ./configure --enable-thread-safety

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 03:39:19
Message-ID: 200901140339.n0E3dJD21843@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Chernow wrote:
> Bruce Momjian wrote:
> > I supposed Solaris 2.5.1 (release 1996) is just too old to add
> > threading, and this code has been unchanged for years.
> >
>
> Yeah, its old. Unfortunately for us, we still have to support it.
>
> To set the record straight, the issue is not threads. Threads work fine
> on 2.5.1. This is a configure system linking issue, "gethostbyname"
> requires linking with libnsl.so. So, thread_test.c must link with -lnsl.
>
> The bigger issue is that the configure script needs to include -lnsl for
> older solaris platforms. Solaris 2.5.1 has "gethostbyname_r" but the
> configure check fails for the same reason.
>
> configure:19821: checking for gethostbyname_r
> configure:19877: gcc -o conftest -O2 -Wall [...snip...]
> Undefined first referenced
> symbol in file
> gethostbyname_r /var/tmp//ccSuGLEn.o (symbol
> belongs to implicit dependency /usr/lib/libnsl.so.1)
> ld: fatal: Symbol referencing errors. No output written to conftest
> collect2: ld returned 1 exit status
>
> This is why thread_test.c thought it had to fall back on gethostbyname
> in the first place.

Well, part of the problem is we are running the thread test program from
_within_ configure so we don't have everything set up yet to work around
this problem, and with an OS that old, is it worth trying?

If you give me something that will uniquely indentify this
platform/version in configure and in C, I might be able to send you a
test patch to try, and if it works, I can apply it for 8.4.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 03:41:56
Message-ID: 200901140341.n0E3fuq22178@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Chernow wrote:
> Andrew Chernow wrote:
> > Bruce Momjian wrote:
> >> I supposed Solaris 2.5.1 (release 1996) is just too old to add
> >> threading, and this code has been unchanged for years.
> >>
> >
> > Yeah, its old. Unfortunately for us, we still have to support it.
> >
> > To set the record straight, the issue is not threads. Threads work fine
> > on 2.5.1. This is a configure system linking issue, "gethostbyname"
> > requires linking with libnsl.so. So, thread_test.c must link with -lnsl.
> >
> > The bigger issue is that the configure script needs to include -lnsl for
> > older solaris platforms. Solaris 2.5.1 has "gethostbyname_r" but the
> > configure check fails for the same reason.
> >
> > configure:19821: checking for gethostbyname_r
> > configure:19877: gcc -o conftest -O2 -Wall [...snip...]
> > Undefined first referenced
> > symbol in file
> > gethostbyname_r /var/tmp//ccSuGLEn.o (symbol
> > belongs to implicit dependency /usr/lib/libnsl.so.1)
> > ld: fatal: Symbol referencing errors. No output written to conftest
> > collect2: ld returned 1 exit status
> >
> > This is why thread_test.c thought it had to fall back on gethostbyname
> > in the first place.
> >
>
> Forgot to mention, there is an easy fix:
>
> ~]# LDFLAGS="-lnsl" ./configure --enable-thread-safety

But I assume that only works if I use gethostbyname_r(), right? But we
do check for that in thread_test.c. So that library that is all that is
needed?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Andrew Chernow <ac(at)esilo(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 04:09:34
Message-ID: 496D657E.4070707@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


>>>
>> Forgot to mention, there is an easy fix:
>>
>> ~]# LDFLAGS="-lnsl" ./configure --enable-thread-safety
>
> But I assume that only works if I use gethostbyname_r(), right?

No, works for gethostbyname as well. They are all in libnsl.

> But we do check for that in thread_test.c.

The problem with the current check is its only an AC_CHECK_FUNCS. We need an
AC_SEARCH_LIBS first so the proper -llibrary is appended to LIBS, which is used
by AC_CHECK_FUNCS.

AC_SEARCH_LIBS(gethostbyname_r, c nsl)
AC_CHECK_FUNCS([strerror_r getpwuid_r gethostbyname_r])

(AC_CHECK_FUNCS from configure.in line 1371)

> So that library that is all that is
> needed?
>

It worked for me.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 14:02:14
Message-ID: 496DF066.60109@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Chernow wrote:
> The problem with the current check is its only an AC_CHECK_FUNCS. We
> need an AC_SEARCH_LIBS first so the proper -llibrary is appended to
> LIBS, which is used by AC_CHECK_FUNCS.
>
> AC_SEARCH_LIBS(gethostbyname_r, c nsl)

Just don't put "c" in there. You usually don't want an explicit -lc to
appear in your link commands.


From: Andrew Chernow <ac(at)esilo(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 14:13:54
Message-ID: 496DF322.3070302@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>> AC_SEARCH_LIBS(gethostbyname_r, c nsl)
>
> Just don't put "c" in there. You usually don't want an explicit -lc to
> appear in your link commands.

Correct. Copied that from an internal project, which I should fix.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 16:43:26
Message-ID: 200901141643.n0EGhQS18861@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Chernow wrote:
>
> >>>
> >> Forgot to mention, there is an easy fix:
> >>
> >> ~]# LDFLAGS="-lnsl" ./configure --enable-thread-safety
> >
> > But I assume that only works if I use gethostbyname_r(), right?
>
> No, works for gethostbyname as well. They are all in libnsl.
>
> > But we do check for that in thread_test.c.
>
> The problem with the current check is its only an AC_CHECK_FUNCS.
> We need an AC_SEARCH_LIBS first so the proper -llibrary is
> appended to LIBS, which is used by AC_CHECK_FUNCS.
>
> AC_SEARCH_LIBS(gethostbyname_r, c nsl) AC_CHECK_FUNCS([strerror_r
> getpwuid_r gethostbyname_r])
>
> (AC_CHECK_FUNCS from configure.in line 1371)

OK, patch attached and applied to CVS HEAD. The nsl (not 'nls') library
check was removed in Postgres 8.2 here:

http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/configure.in.diff?r1=1.448;r2=1.445;f=h

The new code is more specific by testing for gethostbyname_r() and only
on Solaris. I also added a comment about why it was re-added.

The next question is do we backpatch this back to 8.2?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 3.5 KB

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Andrew Chernow" <ac(at)esilo(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 16:56:32
Message-ID: b42b73150901140856w3d45c4eekbb7afca82652e4e7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 1/14/09, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> OK, patch attached and applied to CVS HEAD. The nsl (not 'nls') library
> check was removed in Postgres 8.2 here:

As long as you are looking at this, can you take a peek at this patch?
http://archives.free.net.ph/message/20081116.053100.15b5801d.fi.html

We had a similar problem on hpux 10.20. This was more invasive change
though.. At the time, Tom was ambivalent and Dunstan voted that the
platform was too old, so it never went in.

merlin


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Andrew Chernow <ac(at)esilo(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 18:05:26
Message-ID: 200901141805.n0EI5QA04510@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Merlin Moncure wrote:
> On 1/14/09, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > OK, patch attached and applied to CVS HEAD. The nsl (not 'nls') library
> > check was removed in Postgres 8.2 here:
>
> As long as you are looking at this, can you take a peek at this patch?
> http://archives.free.net.ph/message/20081116.053100.15b5801d.fi.html
>
> We had a similar problem on hpux 10.20. This was more invasive change
> though.. At the time, Tom was ambivalent and Dunstan voted that the
> platform was too old, so it never went in.

Thanks, I looked it over. It does have the danger of affecting other
platforms, so there would have to be more checks in there. Also the
calling of the function with all null pointers seems dangerous, though I
am not sure how else we could test this. It might be safer to create a
conflicting function prototype and see if that throws a warning.

I did a Google search and it seems there isn't an easy way to do the
configure check except the approach you have taken. Your changes to
thread.c seem fine.

Comp.programming.threads, has a pretty ugly autoconf example in their
FAQ with the conclusion:

http://www.lambdacs.com/cpt/FAQ.html

> Whom do I shoot?

take your pick :-(

Let me see if I can work up a more minimal patch.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Andrew Chernow <ac(at)esilo(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 18:11:36
Message-ID: 496E2AD8.2010106@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
>
> Also the
> calling of the function with all null pointers seems dangerous,

Its only trying to compile it, AC_TRY_COMPILE, not execute it. I don't
"think?" the NULL pointers could ever raise havoc.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Andrew Chernow <ac(at)esilo(dot)com>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 22:06:21
Message-ID: 200901142206.n0EM6LH12008@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> Merlin Moncure wrote:
> > On 1/14/09, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > > OK, patch attached and applied to CVS HEAD. The nsl (not 'nls') library
> > > check was removed in Postgres 8.2 here:
> >
> > As long as you are looking at this, can you take a peek at this patch?
> > http://archives.free.net.ph/message/20081116.053100.15b5801d.fi.html
> >
> > We had a similar problem on hpux 10.20. This was more invasive change
> > though.. At the time, Tom was ambivalent and Dunstan voted that the
> > platform was too old, so it never went in.
>
> Thanks, I looked it over. It does have the danger of affecting other
> platforms, so there would have to be more checks in there. Also the
> calling of the function with all null pointers seems dangerous, though I
> am not sure how else we could test this. It might be safer to create a
> conflicting function prototype and see if that throws a warning.
>
> I did a Google search and it seems there isn't an easy way to do the
> configure check except the approach you have taken. Your changes to
> thread.c seem fine.
>
> Comp.programming.threads, has a pretty ugly autoconf example in their
> FAQ with the conclusion:
>
> http://www.lambdacs.com/cpt/FAQ.html
>
> > Whom do I shoot?
>
> take your pick :-(
>
> Let me see if I can work up a more minimal patch.

OK, I ended up doing a compile test as you suggested because I was
worried that a mismatched 'const' might throw an error.

The patch is very similar to the one posted, though perhaps a little
cleaner.

I don't need the #undef _XOPEN_SOURCE_EXTENDED in autoconf because I am
testing for the 5-argument version.

Would someone please test this to make sure it works on their platforms.

Is there any objection to applying this to 8.4? While the operating
system is old, it seems we are having new users use threading on these
older operating systems, hence the need for a patch.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/pgpatches/thread text/x-diff 4.7 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Andrew Chernow <ac(at)esilo(dot)com>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 22:17:01
Message-ID: 22869.1231971421@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Is there any objection to applying this to 8.4?

Yes. I don't think we should bother with a one-operating-system patch
for an OS version that was obsolete ten years ago. (Even if I am still
running it ;-).) If we do this, the next thing will be trying to work
around whatever threading bugs exist in the platform, and you can be
sure there are some.

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Andrew Chernow <ac(at)esilo(dot)com>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 22:29:45
Message-ID: 200901142229.n0EMTjA18020@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Is there any objection to applying this to 8.4?
>
> Yes. I don't think we should bother with a one-operating-system patch
> for an OS version that was obsolete ten years ago. (Even if I am still
> running it ;-).) If we do this, the next thing will be trying to work
> around whatever threading bugs exist in the platform, and you can be
> sure there are some.

True, but from my reading AIX was also in the mix. We can just wait for
another bug report, of course.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Andrew Chernow <ac(at)esilo(dot)com>
Subject: Re: solaris libpq threaded build fails
Date: 2009-01-14 22:39:29
Message-ID: 23292.1231972769@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Tom Lane wrote:
>> Bruce Momjian <bruce(at)momjian(dot)us> writes:
>>> Is there any objection to applying this to 8.4?
>>
>> Yes. I don't think we should bother with a one-operating-system patch
>> for an OS version that was obsolete ten years ago. (Even if I am still
>> running it ;-).) If we do this, the next thing will be trying to work
>> around whatever threading bugs exist in the platform, and you can be
>> sure there are some.

> True, but from my reading AIX was also in the mix. We can just wait for
> another bug report, of course.

I think the appropriate level of effort is just to document that we
don't support threading on HPUX 10.x. And the same for whatever ancient
AIX version might have the same problem ...

regards, tom lane