From owner-freebsd-threads@FreeBSD.ORG Mon Sep 1 12:17:51 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 75434106567C; Mon, 1 Sep 2008 12:17:51 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id DE63B8FC13; Mon, 1 Sep 2008 12:17:50 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 6144E43F5D5; Mon, 1 Sep 2008 15:17:48 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pvh1Y6pQ1uog; Mon, 1 Sep 2008 15:17:48 +0300 (EEST) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [91.198.50.114]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id BBA9643F3B0; Mon, 1 Sep 2008 15:17:47 +0300 (EEST) Message-ID: <48BBDD6A.60002@icyb.net.ua> Date: Mon, 01 Sep 2008 15:17:46 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.16 (X11/20080805) MIME-Version: 1.0 To: Kostik Belousov 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> <20080901111215.GS2038@deviant.kiev.zoral.com.ua> In-Reply-To: <20080901111215.GS2038@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit 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 12:17:51 -0000 on 01/09/2008 14:12 Kostik Belousov said the following: > 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 ? >> In what sense? >> The test program that I posted seems to hang in both cases (patched and >> 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. I understand, but I am not sure what exactly needs to be tested. "Still works" is too broad in this context. -- Andriy Gapon