From owner-freebsd-threads@FreeBSD.ORG Mon Sep 1 11:12:21 2008 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C7AE1065676; Mon, 1 Sep 2008 11:12:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id E11768FC25; Mon, 1 Sep 2008 11:12:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1Ka7KV-000KcM-1g; Mon, 01 Sep 2008 14:12:19 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m81BCGMC088396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Sep 2008 14:12:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m81BCGZx027939; Mon, 1 Sep 2008 14:12:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m81BCFI7027938; Mon, 1 Sep 2008 14:12:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 1 Sep 2008 14:12:15 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20080901111215.GS2038@deviant.kiev.zoral.com.ua> References: <20080829190506.GA2038@deviant.kiev.zoral.com.ua> <20080830155622.GF2038@deviant.kiev.zoral.com.ua> <20080830184512.GH2038@deviant.kiev.zoral.com.ua> <48BBA369.9010108@freebsd.org> <48BBA925.1000303@icyb.net.ua> <20080901084548.GQ2038@deviant.kiev.zoral.com.ua> <48BBC9A3.1050905@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="I30T0A8abtL/6dyk" Content-Disposition: inline In-Reply-To: <48BBC9A3.1050905@icyb.net.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1Ka7KV-000KcM-1g b997649d9f733daac7082bb6a9bebbbf X-Terabit: YES Cc: Daniel Eischen , David Xu , freebsd-threads@freebsd.org Subject: Re: mysterious hang in pthread_create X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 11:12:21 -0000 --I30T0A8abtL/6dyk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 01, 2008 at 01:53:23PM +0300, Andriy Gapon wrote: > on 01/09/2008 11:45 Kostik Belousov said the following: > >On Mon, Sep 01, 2008 at 11:34:45AM +0300, Andriy Gapon wrote: > >>on 01/09/2008 11:10 David Xu said the following: > >>>The ancient bug is in rtld, rlock_acquire() and wlock_acquire() test > >>>thread_flag as a boolean value, because pt_iterate_phdr() tries to > >>>lock two locks at same time, this test will always fail once it > >>>acquired first lock. > >>> > >>>The following silly patch fixes the problem Andriy encountered: > >>I can confirm - this fixed the issue for me. > >>David, thanks! > > > >Does libc_r still work with patch applied ? >=20 > In what sense? > The test program that I posted seems to hang in both cases (patched and= =20 > unpatched rtld). The David' patch changes the code used to support libc_r operations. Even on CURRENT, if you run 4.x-compiled binary with the support of compat-4x libraries, this code from /libexec/ld-elf.so.1 (installed by CURRENT buildworld) provides locking for rtld. --I30T0A8abtL/6dyk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAki7zg8ACgkQC3+MBN1Mb4gT7ACcDy0jhMtJwBDPwvaJM+fRm8fW 4dUAn08j/3qJf8x59JTuJr01uJ4AXJPl =fZwf -----END PGP SIGNATURE----- --I30T0A8abtL/6dyk--