From owner-freebsd-gnome@FreeBSD.ORG Wed Apr 11 18:19:24 2012 Return-Path: Delivered-To: gnome@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F806106564A; Wed, 11 Apr 2012 18:19:24 +0000 (UTC) (envelope-from taku@tackymt.homeip.net) Received: from basalt.tackymt.homeip.net (unknown [IPv6:2001:3e0:577:0:20d:61ff:fecc:2253]) by mx1.freebsd.org (Postfix) with ESMTP id 87E528FC16; Wed, 11 Apr 2012 18:19:23 +0000 (UTC) Received: from basalt.tackymt.homeip.net (localhost [127.0.0.1]) by basalt.tackymt.homeip.net (Postfix) with ESMTP id 8695A83A0; Thu, 12 Apr 2012 03:19:21 +0900 (JST) X-Virus-Scanned: amavisd-new at tackymt.homeip.net Received: from localhost by basalt.tackymt.homeip.net (amavisd-new, unix socket) with ESMTP id jq31JY63g9wl; Thu, 12 Apr 2012 03:19:19 +0900 (JST) Received: from biotite.tackymt.homeip.net (biotite.tackymt.homeip.net [IPv6:2001:3e0:577:0:216:cfff:febc:1472]) by basalt.tackymt.homeip.net (Postfix) with ESMTPSA; Thu, 12 Apr 2012 03:19:19 +0900 (JST) Date: Thu, 12 Apr 2012 03:19:19 +0900 From: Taku YAMAMOTO To: Konstantin Belousov Message-Id: <20120412031919.be6c584e.taku@tackymt.homeip.net> In-Reply-To: <20120411125338.GK2358@deviant.kiev.zoral.com.ua> References: <20120410063153.GA1458@mole.fafoe.narf.at> <20120411113400.GA1399@mole.fafoe.narf.at> <20120411125338.GK2358@deviant.kiev.zoral.com.ua> X-Mailer: Sylpheed 3.1.0 (GTK+ 2.22.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Thu__12_Apr_2012_03_19_19_+0900_RWOoxKRa_Zd/w1ay" Cc: Stefan Farfeleder , gnome@freebsd.org, AN , David Chisnall , freebsd-current@freebsd.org Subject: Re: recent update breaks some ports X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 18:19:24 -0000 This is a multi-part message in MIME format. --Multipart=_Thu__12_Apr_2012_03_19_19_+0900_RWOoxKRa_Zd/w1ay Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 11 Apr 2012 15:53:38 +0300 Konstantin Belousov wrote: > On Wed, Apr 11, 2012 at 01:34:01PM +0200, Stefan Farfeleder wrote: > > On Tue, Apr 10, 2012 at 08:31:53AM +0200, Stefan Farfeleder wrote: > > > On Tue, Apr 10, 2012 at 01:44:02AM -0400, AN wrote: > > > > FreeBSD FBSD10 10.0-CURRENT FreeBSD 10.0-CURRENT #7 r234042: Sun Apr 8 > > > > 17:36:38 EDT 2012 root@FBSD10:/usr/obj/usr/src/sys/MYKERNEL amd64 > > > > > > > > After a recent update on Sunday to r234042 I am having a problem with 2 > > > > ports: > > > > > > > > gedit > > > > evince > > > > (using Gnome2 - ports tree up to date) > > > > > > > > My last update (before this past Sun build/install world) was 2 weeks ago, > > > > so it was definitely a change made in the last 2 weeks. > > > > > > > > Gedit will not start from the command line, or the applications menu. > > > > There is no error message on the command line. Evince will start, however > > > > when you try to open a document the program freezes. > > > > > > > > I have tried to: > > > > make deinstall > > > > make clean > > > > make install clean > > > > > > > > for both ports but they are still broken. I would appreciate any help. > > > > > > I'm experiencing that too (r234038), xine also no longer starts (hangs > > > at splash screen). > > > > FWIW backing out r233749 fixes evince and xine for me. > Please recompile at least rtld/libc/libthr with debugging symbols and get > a backtrace from the hung process. My wild guess tells me that the rtld_bind_lock gets held recursively when resolving filtered symbol. The attached band-aid patch supports the guess. I have the world/kernel as of r234038 and have difficulty to launch XFce's xfdesktop-settings (w/ im-scim.so which loads libstdc++), where every threads of xfdesktop-settings stuck into either "urdlck" or "uwrlck" states. I have to admit that the attached patch is something like 3-minute-hacking quality, but it at least avoids the stall. -- -|-__ YAMAMOTO, Taku | __ < - A chicken is an egg's way of producing more eggs. - --Multipart=_Thu__12_Apr_2012_03_19_19_+0900_RWOoxKRa_Zd/w1ay Content-Type: text/plain; name="thr_rtld_lock-recursive.patch" Content-Disposition: attachment; filename="thr_rtld_lock-recursive.patch" Content-Transfer-Encoding: 7bit --- lib/libthr/thread/thr_rtld.c.orig 2011-01-23 09:17:50.657791000 +0900 +++ lib/libthr/thread/thr_rtld.c 2012-04-12 02:48:05.091322596 +0900 @@ -52,6 +52,10 @@ static void _thr_rtld_wlock_acquire(void struct rtld_lock { struct urwlock lock; + struct pthread * volatile owner; + int nested; + int count_rw; /* total rlock-within-wlock incidents */ + int count_ww; /* total wlock-within-wlock incidents */ char _pad[CACHE_LINE_SIZE - sizeof(struct urwlock)]; }; @@ -106,6 +110,15 @@ _thr_rtld_lock_destroy(void *lock) errno = errsave; \ } +#define HANDLE_NESTED_ACQ(statfield) { \ + if ((l->lock.rw_state & URWLOCK_WRITE_OWNER) != 0 && \ + l->owner == curthread) { \ + l->nested++; \ + l->statfield++; \ + return; \ + } \ + } + static void _thr_rtld_rlock_acquire(void *lock) { @@ -117,6 +130,7 @@ _thr_rtld_rlock_acquire(void *lock) SAVE_ERRNO(); l = (struct rtld_lock *)lock; + HANDLE_NESTED_ACQ(count_rw); THR_CRITICAL_ENTER(curthread); while (_thr_rwlock_rdlock(&l->lock, 0, NULL) != 0) ; @@ -135,9 +149,11 @@ _thr_rtld_wlock_acquire(void *lock) SAVE_ERRNO(); l = (struct rtld_lock *)lock; + HANDLE_NESTED_ACQ(count_ww); THR_CRITICAL_ENTER(curthread); while (_thr_rwlock_wrlock(&l->lock, NULL) != 0) ; + l->owner = curthread; RESTORE_ERRNO(); } @@ -154,6 +170,14 @@ _thr_rtld_lock_release(void *lock) l = (struct rtld_lock *)lock; state = l->lock.rw_state; + if ((state & URWLOCK_WRITE_OWNER) != 0) { + if (l->nested == 0) + l->owner = NULL; + else { + l->nested--; + return; + } + } if (_thr_rwlock_unlock(&l->lock) == 0) { if ((state & URWLOCK_WRITE_OWNER) == 0) curthread->rdlock_count--; --Multipart=_Thu__12_Apr_2012_03_19_19_+0900_RWOoxKRa_Zd/w1ay--