Thread-safe configuration option appears to misfunction

Started by Peter Eisentrautover 22 years ago29 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Is it intended that libpq is always compiled with the so-called
"thread-safe" compiler option, regardless of whether I used
--enable-thread-thing?

--
Peter Eisentraut peter_e@gmx.net

#2Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#1)
Re: Thread-safe configuration option appears to misfunction

Peter Eisentraut wrote:

Is it intended that libpq is always compiled with the so-called
"thread-safe" compiler option, regardless of whether I used
--enable-thread-thing?

It certainly should not be doing that, but my OS has no thread flags, so
I am not seeing it here. What exactly do you see?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#2)
Re: Thread-safe configuration option appears to misfunction

Bruce Momjian writes:

Peter Eisentraut wrote:

Is it intended that libpq is always compiled with the so-called
"thread-safe" compiler option, regardless of whether I used
--enable-thread-thing?

It certainly should not be doing that, but my OS has no thread flags, so
I am not seeing it here. What exactly do you see?

It's using -D_REENTRANT etc. (linux template) when compiling libpq.

--
Peter Eisentraut peter_e@gmx.net

#4Larry Rosenman
ler@lerctr.org
In reply to: Peter Eisentraut (#3)
Re: Thread-safe configuration option appears to

--On Monday, August 04, 2003 17:54:41 +0200 Peter Eisentraut
<peter_e@gmx.net> wrote:

Bruce Momjian writes:

Peter Eisentraut wrote:

Is it intended that libpq is always compiled with the so-called
"thread-safe" compiler option, regardless of whether I used
--enable-thread-thing?

It certainly should not be doing that, but my OS has no thread flags, so
I am not seeing it here. What exactly do you see?

It's using -D_REENTRANT etc. (linux template) when compiling libpq.

I think we WANT to do that for libpq so it can be used in a threaded app,
since there
is no libc_r on Linux to the best of my knowledge.

I intend that to happen on UnixWare as well.

LER

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

#5Bruce Momjian
bruce@momjian.us
In reply to: Larry Rosenman (#4)
Re: Thread-safe configuration option appears to misfunction

We decided to make separate thread/nonthread libraries if the threading
requires any special flags --- we haven't done that yet, and only
configure controls it.

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

Larry Rosenman wrote:

--On Monday, August 04, 2003 17:54:41 +0200 Peter Eisentraut
<peter_e@gmx.net> wrote:

Bruce Momjian writes:

Peter Eisentraut wrote:

Is it intended that libpq is always compiled with the so-called
"thread-safe" compiler option, regardless of whether I used
--enable-thread-thing?

It certainly should not be doing that, but my OS has no thread flags, so
I am not seeing it here. What exactly do you see?

It's using -D_REENTRANT etc. (linux template) when compiling libpq.

I think we WANT to do that for libpq so it can be used in a threaded app,
since there
is no libc_r on Linux to the best of my knowledge.

I intend that to happen on UnixWare as well.

LER

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#6Larry Rosenman
ler@lerctr.org
In reply to: Bruce Momjian (#5)
Re: Thread-safe configuration option appears to

--On Monday, August 04, 2003 12:30:32 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

We decided to make separate thread/nonthread libraries if the threading
requires any special flags --- we haven't done that yet, and only
configure controls it.

That will be a POLA (principle of least astonishment) violation on UnixWare.

LER

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

Larry Rosenman wrote:

--On Monday, August 04, 2003 17:54:41 +0200 Peter Eisentraut
<peter_e@gmx.net> wrote:

Bruce Momjian writes:

Peter Eisentraut wrote:

Is it intended that libpq is always compiled with the so-called
"thread-safe" compiler option, regardless of whether I used
--enable-thread-thing?

It certainly should not be doing that, but my OS has no thread flags,
so I am not seeing it here. What exactly do you see?

It's using -D_REENTRANT etc. (linux template) when compiling libpq.

I think we WANT to do that for libpq so it can be used in a threaded
app, since there
is no libc_r on Linux to the best of my knowledge.

I intend that to happen on UnixWare as well.

LER

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

#7Bruce Momjian
bruce@momjian.us
In reply to: Larry Rosenman (#6)
Re: Thread-safe configuration option appears to

Larry Rosenman wrote:

--On Monday, August 04, 2003 12:30:32 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

We decided to make separate thread/nonthread libraries if the threading
requires any special flags --- we haven't done that yet, and only
configure controls it.

That will be a POLA (principle of least astonishment) violation on UnixWare.

When we have the capability to do dual library builds, we might have a
way to specify a threading flag that will apply to the main libpq and
not create a libpq_r. If it is a good flag, can we use it in the
template file for all compiling?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#8Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#3)
Re: Thread-safe configuration option appears to misfunction

OK, I fixed a number of problems in configure with threads --- please
give it a try now. Thanks.

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

Peter Eisentraut wrote:

Bruce Momjian writes:

Peter Eisentraut wrote:

Is it intended that libpq is always compiled with the so-called
"thread-safe" compiler option, regardless of whether I used
--enable-thread-thing?

It certainly should not be doing that, but my OS has no thread flags, so
I am not seeing it here. What exactly do you see?

It's using -D_REENTRANT etc. (linux template) when compiling libpq.

--
Peter Eisentraut peter_e@gmx.net

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#9Larry Rosenman
ler@lerctr.org
In reply to: Bruce Momjian (#7)
Re: Thread-safe configuration option appears to

--On Monday, August 04, 2003 12:50:31 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

Larry Rosenman wrote:

--On Monday, August 04, 2003 12:30:32 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

We decided to make separate thread/nonthread libraries if the threading
requires any special flags --- we haven't done that yet, and only
configure controls it.

That will be a POLA (principle of least astonishment) violation on
UnixWare.

When we have the capability to do dual library builds, we might have a
way to specify a threading flag that will apply to the main libpq and
not create a libpq_r. If it is a good flag, can we use it in the
template file for all compiling?

I **THINK** so. What I'm thinking of is -D_REENTRANT for UnixWare
especially for libpq.

the --with-threads would cause ecpg to be compiled/linked as -lpthread in
addition to
-D_REENTRANT

LER

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

#10Bruce Momjian
bruce@momjian.us
In reply to: Larry Rosenman (#9)
Re: Thread-safe configuration option appears to

Larry Rosenman wrote:

We decided to make separate thread/nonthread libraries if the threading
requires any special flags --- we haven't done that yet, and only
configure controls it.

That will be a POLA (principle of least astonishment) violation on
UnixWare.

When we have the capability to do dual library builds, we might have a
way to specify a threading flag that will apply to the main libpq and
not create a libpq_r. If it is a good flag, can we use it in the
template file for all compiling?

I **THINK** so. What I'm thinking of is -D_REENTRANT for UnixWare
especially for libpq.

the --with-threads would cause ecpg to be compiled/linked as -lpthread in
addition to
-D_REENTRANT

Nope, we are not going to link with -lpthread unless it is enabled in
configure.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#11Larry Rosenman
ler@lerctr.org
In reply to: Bruce Momjian (#10)
Re: Thread-safe configuration option appears to

--On Monday, August 04, 2003 13:11:45 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

Larry Rosenman wrote:

We decided to make separate thread/nonthread libraries if the
threading requires any special flags --- we haven't done that yet,
and only configure controls it.

That will be a POLA (principle of least astonishment) violation on
UnixWare.

When we have the capability to do dual library builds, we might have a
way to specify a threading flag that will apply to the main libpq and
not create a libpq_r. If it is a good flag, can we use it in the
template file for all compiling?

I **THINK** so. What I'm thinking of is -D_REENTRANT for UnixWare
especially for libpq.

the --with-threads would cause ecpg to be compiled/linked as -lpthread
in addition to
-D_REENTRANT

Nope, we are not going to link with -lpthread unless it is enabled in
configure.

Right. but libpq should be built with -D_REENTRANT on UnixWare regardless
of the
--with-threads.

Read what I said above.

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

#12Bruce Momjian
bruce@momjian.us
In reply to: Larry Rosenman (#11)
Re: Thread-safe configuration option appears to

Larry Rosenman wrote:

--On Monday, August 04, 2003 13:11:45 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

Larry Rosenman wrote:

We decided to make separate thread/nonthread libraries if the
threading requires any special flags --- we haven't done that yet,
and only configure controls it.

That will be a POLA (principle of least astonishment) violation on
UnixWare.

When we have the capability to do dual library builds, we might have a
way to specify a threading flag that will apply to the main libpq and
not create a libpq_r. If it is a good flag, can we use it in the
template file for all compiling?

I **THINK** so. What I'm thinking of is -D_REENTRANT for UnixWare
especially for libpq.

the --with-threads would cause ecpg to be compiled/linked as -lpthread
in addition to
-D_REENTRANT

Nope, we are not going to link with -lpthread unless it is enabled in
configure.

Right. but libpq should be built with -D_REENTRANT on UnixWare regardless
of the
--with-threads.

Well, let's see what additional functionality we need. I am not
feeling too friendly on SCO/Unixware right now to jump through hoops.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#13Larry Rosenman
ler@lerctr.org
In reply to: Bruce Momjian (#12)
Re: Thread-safe configuration option appears to

--On Monday, August 04, 2003 13:19:57 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

Larry Rosenman wrote:

--On Monday, August 04, 2003 13:11:45 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

Larry Rosenman wrote:

We decided to make separate thread/nonthread libraries if the
threading requires any special flags --- we haven't done that
yet, and only configure controls it.

That will be a POLA (principle of least astonishment) violation on
UnixWare.

When we have the capability to do dual library builds, we might
have a way to specify a threading flag that will apply to the main
libpq and not create a libpq_r. If it is a good flag, can we use
it in the template file for all compiling?

I **THINK** so. What I'm thinking of is -D_REENTRANT for UnixWare
especially for libpq.

the --with-threads would cause ecpg to be compiled/linked as -lpthread
in addition to
-D_REENTRANT

Nope, we are not going to link with -lpthread unless it is enabled in
configure.

Right. but libpq should be built with -D_REENTRANT on UnixWare
regardless of the
--with-threads.

Well, let's see what additional functionality we need. I am not
feeling too friendly on SCO/Unixware right now to jump through hoops.

Let's not go there. I'm not involved in the IP fight, but I am a USER on
that
platform, and SCO is thinking ****SERIOUSLY**** about shipping PG on the
Platform
as part of their extensions offering.

What the fr*** harm is it in passing -D_REENTRANT into the libpq build on
UnixWare
irregardless of the --with-threads* flag?

Same argument for allowing the PORT to determine whether to allow/permit
the full
pathname in for DT_SONAME.

Let's not run people off because of what the damn lawyers are doing.

LER

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

#14Tom Lane
tgl@sss.pgh.pa.us
In reply to: Larry Rosenman (#13)
Re: Thread-safe configuration option appears to

Larry Rosenman <ler@lerctr.org> writes:

SCO is thinking ****SERIOUSLY**** about shipping PG on the Platform as
part of their extensions offering.

Why, how nice of them. I don't intend to lift a finger to help.

regards, tom lane

#15Larry Rosenman
ler@lerctr.org
In reply to: Tom Lane (#14)
Re: Thread-safe configuration option appears to

--On Monday, August 04, 2003 14:06:34 -0400 Tom Lane <tgl@sss.pgh.pa.us>
wrote:

Larry Rosenman <ler@lerctr.org> writes:

SCO is thinking ****SERIOUSLY**** about shipping PG on the Platform as
part of their extensions offering.

Why, how nice of them. I don't intend to lift a finger to help.

Grr. I guess I'll get off the lists now.

regards, tom lane

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

#16scott.marlowe
scott.marlowe@ihs.com
In reply to: Tom Lane (#14)
Re: Thread-safe configuration option appears to

On Mon, 4 Aug 2003, Tom Lane wrote:

Larry Rosenman <ler@lerctr.org> writes:

SCO is thinking ****SERIOUSLY**** about shipping PG on the Platform as
part of their extensions offering.

Why, how nice of them. I don't intend to lift a finger to help.

I don't know, I can think of ONE finger I'd be willing to lift. But not
to help really. :-)

#17Bruce Momjian
bruce@momjian.us
In reply to: Larry Rosenman (#13)
Re: Thread-safe configuration option appears to
Would you send over a modified template/unixware and template/sco to at
least allow threading when enabled --- see linux or freebsd for examples
--- that is how we are enabling threading.

Are you saying you want that flag without --enable-thread-safety?

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

Larry Rosenman wrote:

--On Monday, August 04, 2003 13:19:57 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

Larry Rosenman wrote:

--On Monday, August 04, 2003 13:11:45 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

Larry Rosenman wrote:

We decided to make separate thread/nonthread libraries if the
threading requires any special flags --- we haven't done that
yet, and only configure controls it.

That will be a POLA (principle of least astonishment) violation on
UnixWare.

When we have the capability to do dual library builds, we might
have a way to specify a threading flag that will apply to the main
libpq and not create a libpq_r. If it is a good flag, can we use
it in the template file for all compiling?

I **THINK** so. What I'm thinking of is -D_REENTRANT for UnixWare
especially for libpq.

the --with-threads would cause ecpg to be compiled/linked as -lpthread
in addition to
-D_REENTRANT

Nope, we are not going to link with -lpthread unless it is enabled in
configure.

Right. but libpq should be built with -D_REENTRANT on UnixWare
regardless of the
--with-threads.

Well, let's see what additional functionality we need. I am not
feeling too friendly on SCO/Unixware right now to jump through hoops.

Let's not go there. I'm not involved in the IP fight, but I am a USER on
that
platform, and SCO is thinking ****SERIOUSLY**** about shipping PG on the
Platform
as part of their extensions offering.

What the fr*** harm is it in passing -D_REENTRANT into the libpq build on
UnixWare
irregardless of the --with-threads* flag?

Same argument for allowing the PORT to determine whether to allow/permit
the full
pathname in for DT_SONAME.

Let's not run people off because of what the damn lawyers are doing.

LER

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#18Bruce Momjian
bruce@momjian.us
In reply to: Larry Rosenman (#13)
Re: Thread-safe configuration option appears to

Let's not go there. I'm not involved in the IP fight, but I am a USER on
that
platform, and SCO is thinking ****SERIOUSLY**** about shipping PG on the
Platform
as part of their extensions offering.

What the fr*** harm is it in passing -D_REENTRANT into the libpq build on
UnixWare
irregardless of the --with-threads* flag?

Same argument for allowing the PORT to determine whether to allow/permit
the full
pathname in for DT_SONAME.

We did have a discussion on whether we should enable threading by
default, and the issue was that we don't even have enough platforms
supported at this point, so by running configure with the thread flag,
you are asking us to generate a threaded libpq and ecpg, and we will
fail if we can't.

On BSD/OS, that flag does nothing (the binaries are the same), but we
have the flag so people can know if their libs are thread-safe. I think
the template files are the way to go at this point. If we support
threads on all/most of our platforms, we can think about doing something
by default.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#19Larry Rosenman
ler@lerctr.org
In reply to: Bruce Momjian (#18)
Re: Thread-safe configuration option appears to

As soon as a beta tarball shows up, I'll cut changes for UnixWare for
--enable-threads,
and also to do -D_REENTRANT anyway on UnixWare.

What about Kean's change to allow absolute DT_SONAME's?

Can that get applied, and used for SCO and UnixWare?

LER

--On Monday, August 04, 2003 18:16:02 -0400 Bruce Momjian
<pgman@candle.pha.pa.us> wrote:

Let's not go there. I'm not involved in the IP fight, but I am a USER
on that
platform, and SCO is thinking ****SERIOUSLY**** about shipping PG on the
Platform
as part of their extensions offering.

What the fr*** harm is it in passing -D_REENTRANT into the libpq build
on UnixWare
irregardless of the --with-threads* flag?

Same argument for allowing the PORT to determine whether to allow/permit
the full
pathname in for DT_SONAME.

We did have a discussion on whether we should enable threading by
default, and the issue was that we don't even have enough platforms
supported at this point, so by running configure with the thread flag,
you are asking us to generate a threaded libpq and ecpg, and we will
fail if we can't.

On BSD/OS, that flag does nothing (the binaries are the same), but we
have the flag so people can know if their libs are thread-safe. I think
the template files are the way to go at this point. If we support
threads on all/most of our platforms, we can think about doing something
by default.

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

#20Bruce Momjian
bruce@momjian.us
In reply to: Larry Rosenman (#19)
Re: Thread-safe configuration option appears to

Larry Rosenman wrote:

As soon as a beta tarball shows up, I'll cut changes for UnixWare for
--enable-threads,
and also to do -D_REENTRANT anyway on UnixWare.

OK.

What about Kean's change to allow absolute DT_SONAME's?

Can that get applied, and used for SCO and UnixWare?

Can you verify if it needed only because they honor LD_LIBRARY_PATH on
suid executables? If so, I would like to have something that is only
in the template file and Makefile.shlib. I think that is possible.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#21Larry Rosenman
ler@lerctr.org
In reply to: Bruce Momjian (#20)
#22Lee Kindness
lkindness@csl.co.uk
In reply to: Larry Rosenman (#13)
#23Bruce Momjian
bruce@momjian.us
In reply to: Lee Kindness (#22)
#24Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#23)
#25Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#24)
#26Dann Corbit
DCorbit@connx.com
In reply to: Bruce Momjian (#25)
#27Bruce Momjian
bruce@momjian.us
In reply to: Dann Corbit (#26)
#28Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#27)
#29Philip Yarra
philip@utiba.com
In reply to: Tom Lane (#28)