Re: BUG #3728: pthread autoconf hangs

Поиск
Список
Период
Сортировка
От heasley
Тема Re: BUG #3728: pthread autoconf hangs
Дата
Msg-id 20071108191039.GA6245@shrubbery.net
обсуждение исходный текст
Ответ на Re: BUG #3728: pthread autoconf hangs  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Ответы Re: BUG #3728: pthread autoconf hangs  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Список pgsql-bugs
Thu, Nov 08, 2007 at 11:04:01AM +0100, Zdenek Kotala:
> heasley napsal(a):
> >The following bug has been logged online:
> >
> >Bug reference:      3728
> >Logged by:          heasley
> >Email address:      heas@shrubbery.net
> >PostgreSQL version: 8.1.10
> >Operating system:   sparc-sun-solaris2.9 gcc-4.1.1
> >Description:        pthread autoconf hangs
> >Details:
> >
> >If the autoconf script ends-up with a CFLAGS that includes pthreads knobs,
> >for example -DREENTRANT, it will try to find pthread_join() without linking
> >in libpthread (ie: without gcc -pthread). The result is a conftest that
> >hangs because it has some half-baked stub for (among others)
> >pthread_create() that does nothing and thus it spins waiting for the
> >thread{1,2}_done variables to be set by a threads that do not exist.
> >
> >squashing the result of the first check in config/acx_pthread.m4 allows it
> >find the proper results.
> >
> >Sorry, I do not know the proper fix given all the platforms that need to
> >coexist.
>
> Please, can you provide ./configure cmd line and CFLAGS and other related
> setting? Also some error output could help. Another question is gcc 4.1 is
> not in Solaris 9. How did you install this version?

The configure is via NetBSD's pkgsrc system.

./configure --sysconfdir=/usr/pkg/etc/postgresql --datadir=/usr/pkg/share/po
stgresql --with-docdir=/usr/pkg/share/doc/postgresql --with-template=solaris --w
ithout-readline --without-zlib --enable-nls --without-java --without-perl --with
out-python --without-tcl --with-openssl --with-readline --with-zlib --enable-thr
ead-safety --with-libiconv-prefix=/usr/pkg --with-libintl-prefix=/usr/pkg --pref
ix=/usr/pkg --host=sparc-sun-solaris2 --mandir=/usr/pkg/man

from config.log:
CFLAGS=-g -static-libgcc -static-libgcc -D_LARGEFILE64_SOURCE -mcpu=v9 -mtune=ultrasparc -m64 -D__sparc_v9__ -pipe
-I/usr/pkg/include-I/usr/include -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement
-Wendif-labels-fno-strict-aliasing 

www.shrubbery.net/~heas/pg_config.log.txt
www.shrubbery.net/~heas/conftest.c.txt

I built gcc 4.1, after having some difficulty with other versions.  It is a
fairly straight forward build, expect that it has a hack to avoid a libiconv
bug and is within a wrapper script that forces 64-bit options.  I did not have
this problem with pre-8.1.5 postgres as I recall; 8.1.4 built fine and I do
not believe there have been any pkgsrc changes that would affect this.

I did try adding an if () around the pthread_create()s, but it would seem that
they return 0.  And, indeed conftest did not have libpthread linked.

yew [22] ldd conftest
        libintl.so.3 =>  /usr/pkg/lib/libintl.so.3
        libssl.so.0.9.7 =>       /usr/pkg/lib/libssl.so.0.9.7
        libcrypto.so.0.9.7 =>    /usr/pkg/lib/libcrypto.so.0.9.7
        libz.so.1 =>     /usr/pkg/lib/libz.so.1
        libreadline.so.5 =>      /usr/pkg/lib/libreadline.so.5
        librt.so.1 =>    /usr/lib/64/librt.so.1
        libresolv.so.2 =>        /usr/lib/64/libresolv.so.2
        libgen.so.1 =>   /usr/lib/64/libgen.so.1
        libsocket.so.1 =>        /usr/lib/64/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/64/libnsl.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        libm.so.1 =>     /usr/lib/64/libm.so.1
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libiconv.so.2 =>         /usr/pkg/lib/libiconv.so.2
        libcurses.so.1 =>        /usr/lib/64/libcurses.so.1
        libaio.so.1 =>   /usr/lib/64/libaio.so.1
        libmd5.so.1 =>   /usr/lib/64/libmd5.so.1
        libmp.so.2 =>    /usr/lib/64/libmp.so.2
        /usr/platform/SUNW,Sun-Fire-280R/lib/sparcv9/libc_psr.so.1
        /usr/platform/SUNW,Sun-Fire-280R/lib/sparcv9/libmd5_psr.so.1

indeed there are weak symbols in libc:
[2776]  |        676344|          36|FUNC |WEAK |0    |9      |_pthread_create
[4109]  |        676580|          40|FUNC |WEAK |0    |9      |_pthread_join
[3999]  |        674772|          36|FUNC |WEAK |0    |9      |_pthread_mutex_lock

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Planner problems in 8.2.4 and 8.2.5 (was: Possible planner bug/regression introduced in 8.2.5)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #3731: ash table "PROCLOCK hash" corrupted