threads/104297: mixing libthr and libpthread through libs segfaults the binary

Gergely CZUCZY phoemix at harmless.hu
Wed Oct 11 07:30:17 PDT 2006


>Number:         104297
>Category:       threads
>Synopsis:       mixing libthr and libpthread through libs segfaults the binary
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-threads
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 11 14:30:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Gergely CZUCZY
>Release:        FreeBSD 6.1-RELEASE-p7 i386
>Organization:
Harmless Digital Ltd
>Environment:
System: FreeBSD marvin.harmless.hu 6.1-RELEASE-p7 FreeBSD 6.1-RELEASE-p7 #0: Sun Sep 24 09:02:34 CEST 2006 root at marvin.harmless.hu:/usr/obj/usr/src/sys/MARVIN i386
installed PostgreSQL 8.1 which uses pthread (-lpthread)

>Description:
If you build a binary which you link against libthr, and it
will also be linked against a library which is linked against libpthread
the output binary will segfault.


>How-To-Repeat:
$ cat > test.c
int main(int argc, char *argv[]) {
  return 0;
}
^C
$ export LDFLAGS="-lthr -L/usr/local/lib -lpq"
$ make test && ./test
c++ -O2 -pipe -march=pentium4 -lkse -L/usr/local/lib -lpq test.cc -o test
Segmentation fault: 11 (core dumped)

I've tested it with three variation of LDFLAGS, it apperas
that only libthr is broken.
working ones:
export LDFLAGS="-lthread -L/usr/local/lib -lpq"
export LDFLAGS="-lc_r -L/usr/local/lib -lpq"

segfaults:
export LDFLAGS="-lthr -L/usr/local/lib -lpq"


>Fix:
N/A



>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-threads mailing list