From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Neil Jerram" Newsgroups: gmane.lisp.guile.bugs Subject: Re: [PATCH] Final: thread lock nesting debugging Date: Wed, 19 Nov 2008 23:21:53 +0000 Message-ID: <49dd78620811191521vdc920cenacc5c4d4040a37a1@mail.gmail.com> References: <3ae3aa420811162042n4b5d50e3i136a9f7b00262a69@mail.gmail.com> <49dd78620811191514m6e73438esd4f1474c9926880d@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1227136953 4511 80.91.229.12 (19 Nov 2008 23:22:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Nov 2008 23:22:33 +0000 (UTC) Cc: bug-guile@gnu.org To: linasvepstas@gmail.com Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Nov 20 00:23:36 2008 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L2wOT-00048P-PF for guile-bugs@m.gmane.org; Thu, 20 Nov 2008 00:23:34 +0100 Original-Received: from localhost ([127.0.0.1]:42786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2wNL-0003mt-0V for guile-bugs@m.gmane.org; Wed, 19 Nov 2008 18:22:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2wMw-0003dk-2o for bug-guile@gnu.org; Wed, 19 Nov 2008 18:21:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2wMu-0003cy-Oi for bug-guile@gnu.org; Wed, 19 Nov 2008 18:21:57 -0500 Original-Received: from [199.232.76.173] (port=37014 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2wMu-0003cs-HZ for bug-guile@gnu.org; Wed, 19 Nov 2008 18:21:56 -0500 Original-Received: from po-out-1718.google.com ([72.14.252.158]:26393) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L2wMu-0006RB-Lx for bug-guile@gnu.org; Wed, 19 Nov 2008 18:21:56 -0500 Original-Received: by po-out-1718.google.com with SMTP id y22so234781pof.1 for ; Wed, 19 Nov 2008 15:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=8rA1TZju9kEgymANeBUMprlEUsBTP9fuzC9eagjUJKQ=; b=HRI41Ktfl7B9hrQPjx9ADJXZ/EGGrz3lnx8DU7HWgukfyijZnVO9HCiFcHcuEHh7lR h8HDdTw67jEY9B3DL/XXnpEsCsV52w4aX6vCLIxfiGFZMAV3R33AjA0S/4nXqp57vssL 1N5u8pVGVxvu+AGJe51zdOLVVpZWTj31nwPWI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=U3eVGDmcgY9I5nWnP5bWSc1YQA2zGRg2aosnBzRh5DmLmE6ituyWhaNhGBKb5hJp84 6vkFbzWyNrT6tbd2Hw7j17aZP8pOqPUmloLWPt/kJqt1NIF0D1L2BVMI9v14Y3RM0mqQ rnDZYCVFkbPPEVMaQiyEhB5aCLo4GjQND9VMY= Original-Received: by 10.141.29.18 with SMTP id g18mr873191rvj.89.1227136913435; Wed, 19 Nov 2008 15:21:53 -0800 (PST) Original-Received: by 10.140.142.15 with HTTP; Wed, 19 Nov 2008 15:21:53 -0800 (PST) In-Reply-To: <49dd78620811191514m6e73438esd4f1474c9926880d@mail.gmail.com> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4118 Archived-At: 2008/11/19 Neil Jerram : > 2008/11/17 Linas Vepstas : >> I've been seeing all sorts of deadlocks in guile, and so I wrote a small >> debugging utility to try to track down the problems. > > Interesting patch! > > One query; I may be being a bit dumb, I'm only just recovering from a > bad cold, but anyway... Your patch checks for a thread unlocking > mutexes in the reverse order that it locked them in (let's call this > point "A"). But I thought your recent investigations had shown that > the problem was threads doing locking in inconsistent order, e.g. > thread 1 locks M1 and then M2, while thread 2 locks M2 and then M1 > (point "B"). Are points "A" and "B" equivalent? (It isn't obvious to > me if so.) Also I wondered if there are already tools to debug this kind of thing (without new Guile code), and a quick search finds this [1], which suggests that helgrind could catch bad lock ordering for us. [1] http://www.network-theory.co.uk/docs/valgrind/valgrind_113.html Neil