From owner-freebsd-threads@FreeBSD.ORG Wed Oct 11 14:30:17 2006 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 75F4C16A4D4 for ; Wed, 11 Oct 2006 14:30:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CBE843D53 for ; Wed, 11 Oct 2006 14:30:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k9BEUGQR067052 for ; Wed, 11 Oct 2006 14:30:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k9BEUGDi067051; Wed, 11 Oct 2006 14:30:16 GMT (envelope-from gnats) Resent-Date: Wed, 11 Oct 2006 14:30:16 GMT Resent-Message-Id: <200610111430.k9BEUGDi067051@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gergely CZUCZY Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4709116A40F for ; Wed, 11 Oct 2006 14:29:12 +0000 (UTC) (envelope-from phoemix@marvin.harmless.hu) Received: from marvin.harmless.hu (mostly.harmless.hu [195.56.55.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97FCB43D46 for ; Wed, 11 Oct 2006 14:29:11 +0000 (GMT) (envelope-from phoemix@marvin.harmless.hu) Received: from localhost (marvin-mail [192.168.0.2]) by marvin (Postfix) with ESMTP id 3857F7BFF6D for ; Wed, 11 Oct 2006 16:29:10 +0200 (CEST) Received: from marvin.harmless.hu ([192.168.0.2]) by localhost (marvin.harmless.hu [192.168.0.2]) (amavisd-new, port 10024) with ESMTP id 3oH9i5ljysxK for ; Wed, 11 Oct 2006 16:29:04 +0200 (CEST) Received: from marvin.harmless.hu (localhost [127.0.0.1]) by marvin (Postfix) with ESMTP id 3FF7F7BFF6B for ; Wed, 11 Oct 2006 16:29:03 +0200 (CEST) Received: (from phoemix@localhost) by marvin.harmless.hu (8.13.6/8.13.6/Submit) id k9BET3aF047135; Wed, 11 Oct 2006 16:29:03 +0200 (CEST) (envelope-from phoemix) Message-Id: <200610111429.k9BET3aF047135@marvin.harmless.hu> Date: Wed, 11 Oct 2006 16:29:03 +0200 (CEST) From: Gergely CZUCZY To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: threads/104297: mixing libthr and libpthread through libs segfaults the binary X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gergely CZUCZY List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2006 14:30:17 -0000 >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@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: