From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 12 13:26:39 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E83B7106564A for ; Fri, 12 Sep 2008 13:26:39 +0000 (UTC) (envelope-from titanandrews@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.188]) by mx1.freebsd.org (Postfix) with ESMTP id 917488FC18 for ; Fri, 12 Sep 2008 13:26:39 +0000 (UTC) (envelope-from titanandrews@gmail.com) Received: by rn-out-0910.google.com with SMTP id j71so572008rne.12 for ; Fri, 12 Sep 2008 06:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=8UHH5eLTD/8pv7d9gaHdtRqPylRS81Smy23LkNaAgBo=; b=te7eJxcW3zGfQC+Dg/5dltd3kqFu4/fCEjUMPBMpjyGOoyiMcGI5WbSQl6k/Ok+3uR Bb/LetEbyghPJVteeMRxsbrDCkTro7B0AyT5ISSw7T5DR1mk4ENOoh1FEruyVIFzRlh+ v4jd/Vvs2fuxpXH1UPcggdRLfc9RnDZLJUxmc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=M7OL/k6xVp0ZAAbiUEvpFOCzRzgKbVLGXi/kGgGJQtGnIlwzOoesWXZy6HDrOSzoQW SjOn/ePW99+vorEVUPp85GUUgE8AQNvyHwfC+WNcZ25+D/TdLOG4PXoNkSQVavciULh6 O0HEmxYAMpLQvsrrx5NtT5JJq4e5lgvfc0TWo= Received: by 10.100.6.13 with SMTP id 13mr5145475anf.83.1221225997635; Fri, 12 Sep 2008 06:26:37 -0700 (PDT) Received: by 10.100.45.6 with HTTP; Fri, 12 Sep 2008 06:26:37 -0700 (PDT) Message-ID: Date: Fri, 12 Sep 2008 09:26:37 -0400 From: "Barry Andrews" To: "Jeremy Chadwick" In-Reply-To: <20080912131045.GA56923@icarus.home.lan> MIME-Version: 1.0 References: <48CA555A.4050104@gmail.com> <20080912131045.GA56923@icarus.home.lan> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Daniel Eischen , freebsd-hackers@freebsd.org Subject: Re: loading multi threaded library into executable enabled for single thread X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2008 13:26:40 -0000 I don't understand. If it was not broken, then why did it change in later FreeBSD versions? On Fri, Sep 12, 2008 at 9:10 AM, Jeremy Chadwick wrote: > On Fri, Sep 12, 2008 at 07:41:14AM -0400, Barry Andrews wrote: > > Do you know if this is documented in Release Notes or Known Issues or > > somewhere? > > Why would it be an "issue"? gcc -pthread and libpthread linking is > documented pretty much everywhere on the web. There isn't anything > broken about it, it's how it's done on older FreeBSD. > > Note that all of this has significantly changed in later FreeBSD > versions, and that the 5.x series was deprecated a very long time ago. > > >> On Thu, 11 Sep 2008, Barry Andrews wrote: > >> > >>> Hi All, > >>> > >>> I have a multi-threaded library that is linked against libpthread. > >>> When I > >>> load this lib into a tclsh process on FreeBSD, I get this error, > >>> "Recurse on > >>> private mutex". and crash. I understand that I can have this issue > >>> when the > >>> executable is not linked against libpthread but one of the loaded > >>> libs is. > >>> Basically, it thinks it's in single threaded mode. > >> > >> This must be an older version of FreeBSD. I think you must > >> link your application (tclsh or whatever) against libpthread > >> in order for this to work. The libc functions won't get properly > >> overloaded by their equivalents in libpthread unless you do > >> this. > > -- > | Jeremy Chadwick jdc at parodius.com | > | Parodius Networking http://www.parodius.com/ | > | UNIX Systems Administrator Mountain View, CA, USA | > | Making life hard for others since 1977. PGP: 4BD6C0CB | > >