Re: openbsd, plpython, missing threading symbols

Lists: pgsql-hackers
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: openbsd, plpython, missing threading symbols
Date: 2005-08-03 14:33:21
Message-ID: 42F0D5B1.2060601@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Did we recently make some fixes for FBSD that cured the problem with
unresolved pthread* symbols for plpython? If so, should we look at
possibly doing something similar for OpenBSD? That might clean up
buildfarm member spoonbill which has been failing ever since we started
testing PLs. Stefan has upgraded the buildfarm code on this machine so
we can now see all the logs from tha various buildfarm stages, if that
is any help.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: openbsd, plpython, missing threading symbols
Date: 2005-08-03 15:46:29
Message-ID: 1761.1123083989@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Did we recently make some fixes for FBSD that cured the problem with
> unresolved pthread* symbols for plpython?

No, it's not fixed. I think the owner of the freebsd buildfarm machine
masked the problem by building an unthreaded libpython.

The only fix that so far looks like it would work is to build the
backend with threading (CPPFLAGS += -D_THREAD_SAFE and LIBS += -pthread,
IIUC). This seems sufficiently invasive that I'm quite loath to do it.
Does anyone have a handle on the likely performance and stability costs
of doing this on BSDen?

The alternative is to say that plpython isn't supported on BSDen unless
you choose to build an unthreaded libpython. Unpleasant as that may be,
I do not care for the proposition that plpython gets to dictate our
choice of libc. Whatever costs are incurred by that will be paid by
people who are not even using plpython, and that's not the direction
I want to see the pain flowing in.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: openbsd, plpython, missing threading symbols
Date: 2005-08-03 20:28:21
Message-ID: 42F128E5.3020705@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>
>>Did we recently make some fixes for FBSD that cured the problem with
>>unresolved pthread* symbols for plpython?
>>
>>
>
>No, it's not fixed. I think the owner of the freebsd buildfarm machine
>masked the problem by building an unthreaded libpython.
>
>The only fix that so far looks like it would work is to build the
>backend with threading (CPPFLAGS += -D_THREAD_SAFE and LIBS += -pthread,
>IIUC). This seems sufficiently invasive that I'm quite loath to do it.
>Does anyone have a handle on the likely performance and stability costs
>of doing this on BSDen?
>
>The alternative is to say that plpython isn't supported on BSDen unless
>you choose to build an unthreaded libpython. Unpleasant as that may be,
>I do not care for the proposition that plpython gets to dictate our
>choice of libc. Whatever costs are incurred by that will be paid by
>people who are not even using plpython, and that's not the direction
>I want to see the pain flowing in.
>
>
>
>

I'm OK with that, but if that's what's done I think we should check for
it up front at configure time and not let it fail at run time like we do
now.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: openbsd, plpython, missing threading symbols
Date: 2005-08-03 20:49:15
Message-ID: 3898.1123102155@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Tom Lane wrote:
>> The alternative is to say that plpython isn't supported on BSDen unless
>> you choose to build an unthreaded libpython.

> I'm OK with that, but if that's what's done I think we should check for
> it up front at configure time and not let it fail at run time like we do
> now.

If you can create a suitable configure test, it'd be fine with me.

regards, tom lane


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: openbsd, plpython, missing threading symbols
Date: 2005-08-04 18:14:51
Message-ID: 42F25B1B.2010402@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>>Tom Lane wrote:
>>
>>>The alternative is to say that plpython isn't supported on BSDen unless
>>>you choose to build an unthreaded libpython.
>
>
>>I'm OK with that, but if that's what's done I think we should check for
>>it up front at configure time and not let it fail at run time like we do
>>now.
>
>
> If you can create a suitable configure test, it'd be fine with me.

Not sure if it is of any help but mod_python seems to be using this
configure.in snippet to detect (and reject) a threaded python installation:

# check if python is compiled with threads
AC_MSG_CHECKING(whether Python is compiled with thread support)
PyTHREADS=`$PYTHON_BIN -c "import sys; print \"thread\" in
sys.builtin_module_names"`
if test "$PyTHREADS" = "1"; then
AC_MSG_RESULT(yes)
echo
echo " ****** WARNING ******"
echo " Python is compiled with thread support. Apache 1.3 does not
use threads."
echo " On some systems this will cause problems during compilation,
on others "
echo " it may result in unpredictable behaviour of your Apache
server. Yet on"
echo " others it will work just fine. The recommended approach is to
compile"
echo " Python without thread support in a separate location and
specify it with"
echo " --with-python option to this ./configure script."
echo
else
AC_MSG_RESULT([no threads, good])
fi

Stefan


From: Marko Kreen <marko(at)l-t(dot)ee>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: openbsd, plpython, missing threading symbols
Date: 2005-08-04 19:52:02
Message-ID: 20050804195202.GA8724@l-t.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Aug 04, 2005 at 08:14:51PM +0200, Stefan Kaltenbrunner wrote:
> Tom Lane wrote:
> >Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> >>Tom Lane wrote:
> >>>The alternative is to say that plpython isn't supported on BSDen unless
> >>>you choose to build an unthreaded libpython.
> >>I'm OK with that, but if that's what's done I think we should check for
> >>it up front at configure time and not let it fail at run time like we do
> >>now.
> >
> > If you can create a suitable configure test, it'd be fine with me.
>
> Not sure if it is of any help but mod_python seems to be using this
> configure.in snippet to detect (and reject) a threaded python installation:

Ok, I converted this to patch against config/python.m4.

Also made it work with python 2.3, 2.4 that return 'True' not '1'.

The error is thrown only on BSD's. As I understand threaded
python works fine on other OS'es?

Error message may need clarifying.

--
marko

Attachment Content-Type Size
pythread.diff text/plain 892 bytes

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Marko Kreen <marko(at)l-t(dot)ee>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: openbsd, plpython, missing threading symbols
Date: 2005-08-13 02:27:16
Message-ID: 200508130227.j7D2RGL29778@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Where are we going with this patch? It doesn't test specific OS's known
to fail.

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

Marko Kreen wrote:
> On Thu, Aug 04, 2005 at 08:14:51PM +0200, Stefan Kaltenbrunner wrote:
> > Tom Lane wrote:
> > >Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > >>Tom Lane wrote:
> > >>>The alternative is to say that plpython isn't supported on BSDen unless
> > >>>you choose to build an unthreaded libpython.
> > >>I'm OK with that, but if that's what's done I think we should check for
> > >>it up front at configure time and not let it fail at run time like we do
> > >>now.
> > >
> > > If you can create a suitable configure test, it'd be fine with me.
> >
> > Not sure if it is of any help but mod_python seems to be using this
> > configure.in snippet to detect (and reject) a threaded python installation:
>
> Ok, I converted this to patch against config/python.m4.
>
> Also made it work with python 2.3, 2.4 that return 'True' not '1'.
>
> The error is thrown only on BSD's. As I understand threaded
> python works fine on other OS'es?
>
> Error message may need clarifying.
>
> --
> marko
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

--
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: Marko Kreen <marko(at)l-t(dot)ee>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: openbsd, plpython, missing threading symbols
Date: 2005-08-13 09:25:45
Message-ID: 20050813092545.GA11733@l-t.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 12, 2005 at 10:27:16PM -0400, Bruce Momjian wrote:
> Where are we going with this patch? It doesn't test specific OS's known
> to fail.

I hoped people more familiar with the problem would tune it...

Here is updated patch where I test specifically
'openbsd*|freebsd*' instead of '*bsd*'. Although
AFAIK all BSD's use similar libc/libc_r setup so
*bsd* should have been fine.

Also I 'clarified' the error message a bit.

There is one notable feature of this patch - it will check
for threaded Python on all platforms and print the result,
this hopefully helps tracking problems on other platforms too.

--
marko

Attachment Content-Type Size
pythread2.diff text/plain 869 bytes

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Marko Kreen <marko(at)l-t(dot)ee>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: openbsd, plpython, missing threading symbols
Date: 2005-09-26 16:48:19
Message-ID: 200509261648.j8QGmJT15423@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Patch applied. Thanks.

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

Marko Kreen wrote:
> On Fri, Aug 12, 2005 at 10:27:16PM -0400, Bruce Momjian wrote:
> > Where are we going with this patch? It doesn't test specific OS's known
> > to fail.
>
> I hoped people more familiar with the problem would tune it...
>
> Here is updated patch where I test specifically
> 'openbsd*|freebsd*' instead of '*bsd*'. Although
> AFAIK all BSD's use similar libc/libc_r setup so
> *bsd* should have been fine.
>
> Also I 'clarified' the error message a bit.
>
> There is one notable feature of this patch - it will check
> for threaded Python on all platforms and print the result,
> this hopefully helps tracking problems on other platforms too.
>
> --
> marko
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

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