List Info

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




threads/104297: mixing libthr and libpthread through libs segfaults the binary
user name
2006-10-11 14:29:03
>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 rootmarvin.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:
_______________________________________________
freebsd-threadsfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-threa
ds
To unsubscribe, send any mail to
"freebsd-threads-unsubscribefreebsd.org"
threads/104297: mixing libthr and libpthread through libs segfaults the binary
user name
2006-10-11 16:12:32
On Wed, 11 Oct 2006, Gergely CZUCZY wrote:

>
>> Number:         104297
>> Category:       threads
>> Synopsis:       mixing libthr and libpthread
through libs segfaults the binary

Of course it does, and that's to be expected.  This is not
a bug.

-- 
DE
_______________________________________________
freebsd-threadsfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-threa
ds
To unsubscribe, send any mail to
"freebsd-threads-unsubscribefreebsd.org"
threads/104297: mixing libthr and libpthread through libs segfaults the binary
user name
2006-10-11 16:14:14
On Wed, Oct 11, 2006 at 12:12:32PM -0400, Daniel Eischen
wrote:
> On Wed, 11 Oct 2006, Gergely CZUCZY wrote:
> 
> >
> >>Number:         104297
> >>Category:       threads
> >>Synopsis:       mixing libthr and libpthread
through libs segfaults the binary
> 
> Of course it does, and that's to be expected.  This is
not
> a bug.
it see. then why can pthread and libc_r be mixed?
and how do i use libthr if one of the libs i link against
is using libpthread?

Bye,

Gergely Czuczy
mailto: gergely.czuczyharmless.hu

-- 
Weenies test. Geniuses solve problems that arise.
threads/104297: mixing libthr and libpthread through libs segfaults the binary
user name
2006-10-11 16:28:53
On Wed, 11 Oct 2006, Gergely CZUCZY wrote:

> On Wed, Oct 11, 2006 at 12:12:32PM -0400, Daniel
Eischen wrote:
>> On Wed, 11 Oct 2006, Gergely CZUCZY wrote:
>>
>>>
>>>> Number:         104297
>>>> Category:       threads
>>>> Synopsis:       mixing libthr and
libpthread through libs segfaults the binary
>>
>> Of course it does, and that's to be expected.  This
is not
>> a bug.
> it see. then why can pthread and libc_r be mixed?

They can't and it isn't supported.

> and how do i use libthr if one of the libs i link
against
> is using libpthread?

You can't unless you relink everything or you use
libmap.conf(5).

-- 
DE
_______________________________________________
freebsd-threadsfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-threa
ds
To unsubscribe, send any mail to
"freebsd-threads-unsubscribefreebsd.org"
threads/104297: mixing libthr and libpthread through libs segfaults the binary
user name
2006-10-11 16:35:16
On Wed, Oct 11, 2006 at 12:28:53PM -0400, Daniel Eischen
wrote:
> >and how do i use libthr if one of the libs i link
against
> >is using libpthread?
> You can't unless you relink everything or you use
libmap.conf(5).
so, the choice of which threading library the system uses
is decieded by the authors of all ports.
shouldn't there be a way to specify for _all_ ports,
sources, everything, which solution is the prefered
one for the system?

Bye,

Gergely Czuczy
mailto: gergely.czuczyharmless.hu

-- 
Weenies test. Geniuses solve problems that arise.
[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )