From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 11 19:35:49 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 EE7A6106566C for ; Thu, 11 Sep 2008 19:35:49 +0000 (UTC) (envelope-from titanandrews@gmail.com) Received: from mail-gx0-f17.google.com (mail-gx0-f17.google.com [209.85.217.17]) by mx1.freebsd.org (Postfix) with ESMTP id 949CD8FC24 for ; Thu, 11 Sep 2008 19:35:48 +0000 (UTC) (envelope-from titanandrews@gmail.com) Received: by gxk10 with SMTP id 10so17180565gxk.19 for ; Thu, 11 Sep 2008 12:35:48 -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:mime-version:content-type; bh=ZnbJV8CCMo2A6ZejpxjspIGM70YOYePMxENbwPD5TXA=; b=scpYyUlz4Cjxc8WYom0uneca9cWfZrCRCfvgM1RaYLWIcG5sjwXS4OHyknLIjBey/J dk+TM++4o2FyugzSLDBFXyEPo7MW4llPrp4sTkDcpDA7FbvXi6gNgM69DcIqDx0G7uwN Y+pMwD2WCU0IENhFmi3ivXnFBtXB+P/jDaAeo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=B+x2aBNn4YcK5U2yFXHMcAMew+EKWqbIQ/PXtO7pizzMzN6z3fAORDfSYMQfA+o1nR xKqJWnotadyQW8T6AzrWGXguzRIS1TW6lj1s8otyqX5idhQLOtrAxceEx+y5alhBXXcF a9OLbgIa63eZ6/eBdlzR3vyJC8s+mkxCZ9Xes= Received: by 10.100.12.2 with SMTP id 2mr1188719anl.143.1221159995764; Thu, 11 Sep 2008 12:06:35 -0700 (PDT) Received: by 10.100.154.2 with HTTP; Thu, 11 Sep 2008 12:06:35 -0700 (PDT) Message-ID: Date: Thu, 11 Sep 2008 15:06:35 -0400 From: "Barry Andrews" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: 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: Thu, 11 Sep 2008 19:35:50 -0000 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. I can get around this issue, by doing export LD_PRELOAD=libpthread.so.1, however this is a hack at best. Is there any other way to get around this issue other than linking tclsh with libpthread ( because that's not an option) I thought of re-building libpthread with the offending code commented out, and that did work, however I ran into other issues, so I think it's not a very "safe" option. My feeling is that this is a FreeBSD issue because it's not happening on other platforms, Linux, Solaris. Any suggestions are welcome. Many thanks! -B * *