From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: Hang in threads.test Date: Thu, 23 Sep 2010 23:40:05 +0100 Message-ID: <87y6asqe2i.fsf@ossau.uklinux.net> References: <87tylmrch6.fsf@ossau.uklinux.net> <87zkv94jf9.fsf@ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1285281657 24523 80.91.229.12 (23 Sep 2010 22:40:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Sep 2010 22:40:57 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Sep 24 00:40:56 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OyuTG-00044l-Er for guile-devel@m.gmane.org; Fri, 24 Sep 2010 00:40:54 +0200 Original-Received: from localhost ([127.0.0.1]:33765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyuTF-0007FX-VO for guile-devel@m.gmane.org; Thu, 23 Sep 2010 18:40:54 -0400 Original-Received: from [140.186.70.92] (port=47816 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyuT7-0007EG-3h for guile-devel@gnu.org; Thu, 23 Sep 2010 18:40:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyuT5-0006LE-TB for guile-devel@gnu.org; Thu, 23 Sep 2010 18:40:45 -0400 Original-Received: from mail3.uklinux.net ([80.84.72.33]:57403) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyuT5-0006DP-MH for guile-devel@gnu.org; Thu, 23 Sep 2010 18:40:43 -0400 Original-Received: from arudy (unknown [78.149.119.168]) by mail3.uklinux.net (Postfix) with ESMTP id D48391F67FB for ; Thu, 23 Sep 2010 23:40:05 +0100 (BST) Original-Received: from neil-laptop (unknown [192.168.1.5]) by arudy (Postfix) with ESMTP id 8D8B03800B for ; Thu, 23 Sep 2010 23:40:05 +0100 (BST) In-Reply-To: <87zkv94jf9.fsf@ossau.uklinux.net> (Neil Jerram's message of "Wed, 22 Sep 2010 21:23:06 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10948 Archived-At: --=-=-= Neil Jerram writes: > Neil Jerram writes: > >> My nightly build of master, on a relatively slow old machine, is >> hanging, on most nights, in `make check'. > > FWIW, I realized that my backtraces are very similar to those reported > by Dale here: > http://www.mail-archive.com/bug-guile@gnu.org/msg05066.html. I think I have a reliable workaround for this, attached below. My nightly build will now use this patch, and hopefully that'll mean that it reliably produces benchmark data again. The hang seems to be caused by one thread (A) running (gc) at the same time as another thread (B) is doing GC_malloc_atomic. The third thread in the backtrace is the signal delivery thread, and not involved. But in the "mutex with owner not retained (bug #27450)" test there is no thread B, so where does it come from? It's left over from the "locking mutex on behalf of other thread" test, two tests previously. Adding (join-thread t) to that earlier test means that the thread has to run and complete before we get to the (gc) test. My libgc is Debian version 1:7.1-3, so possibly this is a known libgc issue that's already fixed upstream; I haven't tried to check that yet. Regards, Neil --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Workaround-for-hang-in-threads.test.patch >From 6013922c08c35a4e1051d4481d5bb4580bda1430 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Thu, 23 Sep 2010 23:13:39 +0100 Subject: [PATCH] Workaround for hang in threads.test --- test-suite/tests/threads.test | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/test-suite/tests/threads.test b/test-suite/tests/threads.test index 58a2eba..234fb73 100644 --- a/test-suite/tests/threads.test +++ b/test-suite/tests/threads.test @@ -358,7 +358,9 @@ (let* ((m (make-mutex)) (t (begin-thread 'foo))) (lock-mutex m #f t) - (eq? (mutex-owner m) t))) + (let ((result (eq? (mutex-owner m) t))) + (join-thread t) + result))) (pass-if "locking mutex with no owner" (let ((m (make-mutex))) -- 1.7.1 --=-=-=--