From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Julian Graham" Newsgroups: gmane.lisp.guile.devel Subject: Re: deadlock in scm_join_thread(_timed) Date: Mon, 26 May 2008 22:53:20 -0400 Message-ID: <2bc5f8210805261953s18bef0b9i9e32ee7cb4486c0e@mail.gmail.com> References: <2bc5f8210805242233x3ac66a60r6d135abd1d8a80a5@mail.gmail.com> <49dd78620805250616n47ae2ecfjfe4015f066199d24@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_8086_24673104.1211856801158" X-Trace: ger.gmane.org 1211856820 16372 80.91.229.12 (27 May 2008 02:53:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 May 2008 02:53:40 +0000 (UTC) Cc: guile-devel To: "Neil Jerram" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue May 27 04:54:21 2008 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.50) id 1K0pKN-0002ai-7r for guile-devel@m.gmane.org; Tue, 27 May 2008 04:54:19 +0200 Original-Received: from localhost ([127.0.0.1]:42314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0pJc-0007aU-3U for guile-devel@m.gmane.org; Mon, 26 May 2008 22:53:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0pJW-0007aP-Vk for guile-devel@gnu.org; Mon, 26 May 2008 22:53:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0pJU-0007aD-Ee for guile-devel@gnu.org; Mon, 26 May 2008 22:53:25 -0400 Original-Received: from [199.232.76.173] (port=40129 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0pJU-0007aA-9H for guile-devel@gnu.org; Mon, 26 May 2008 22:53:24 -0400 Original-Received: from fk-out-0910.google.com ([209.85.128.187]:31135) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K0pJT-0000zW-ND for guile-devel@gnu.org; Mon, 26 May 2008 22:53:24 -0400 Original-Received: by fk-out-0910.google.com with SMTP id 18so2252231fkq.10 for ; Mon, 26 May 2008 19:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=zAdJzMkThocaLFgX2QZunsxgJWufzhwSYn1xKUnfLLU=; b=bkfp20QfoCHnlMh4LUrF1uhcKL2sFkRAaUE4oMsX8gi6hmQ35A0Zwp/ohblInlUhr0q4qjRJuY3Lcl5P6etAxgggPPmF1bIhFj4IaBP/NQj5dO7H1EUR9FOlJ82zcyEwrCRD1e46qPKsRUEPWtmMjnKo0KHMVvkmAHmZ8/2Yiv4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=r2IUEnsedOgV1wFamz9pqgpoxWl+MwhcB/i2VJUl6yADcJDVm5HL5/YIDGj3qGz+jUlcLa+PYK8KIgOeyJA+472dh8Bcn3/Xan07o/wkVYFYg1TYzibOvqyUGzHXCid6jKCcLb+AqoIXI+6cfjeNkSo8RkW4pM0UxynhQ/yKQL8= Original-Received: by 10.82.126.1 with SMTP id y1mr211460buc.20.1211856801218; Mon, 26 May 2008 19:53:21 -0700 (PDT) Original-Received: by 10.82.100.3 with HTTP; Mon, 26 May 2008 19:53:20 -0700 (PDT) In-Reply-To: <49dd78620805250616n47ae2ecfjfe4015f066199d24@mail.gmail.com> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:7274 Archived-At: ------=_Part_8086_24673104.1211856801158 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Neil, > Based on the synopsis above, I agree that moving step 1 inside the loop > should fix this. In addition, though, I think it would be very good if we > could add a minimal test that currently reproduces the deadlock, and so will > serve to guard against future regressions here. Do you have such a test? I don't -- it seems to be pretty dependent on timing. I noticed it while running my SRFI-18 test suite in a loop, and it took hours to trigger. Any suggestions? > No need for a patch against both 1.8 and 1.9; just one will do, and git > cherry-pick will handle the other for us (unless the fix is significantly > different in the two branches). Okay, find it attached. Regards, Julian ------=_Part_8086_24673104.1211856801158 Content-Type: text/x-diff; name=0001-threads.c-join_thread_timed-Avoid-deadlock-by-a.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_fgpvyvlq0 Content-Disposition: attachment; filename=0001-threads.c-join_thread_timed-Avoid-deadlock-by-a.patch RnJvbSAxYTkwODM1YmQ0YzY0NmZiMTc3NmQ2YTgzNDg5ODIwNzcyZmI1YmJkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKdWxpYW4gR3JhaGFtIDxqdWxpYW5Ac21va2Vib3R0bGUuKG5v bmUpPgpEYXRlOiBNb24sIDI2IE1heSAyMDA4IDIxOjI3OjI0IC0wNDAwClN1YmplY3Q6IFtQQVRD SF0gKiB0aHJlYWRzLmMgKGpvaW5fdGhyZWFkX3RpbWVkKTogQXZvaWQgZGVhZGxvY2sgYnkgYWx3 YXlzIGNoZWNraW5nCiB0aHJlYWQgZXhpdCBzdGF0dXMuCgotLS0KIGxpYmd1aWxlL3RocmVhZHMu YyB8ICAgMzIgKysrKysrKysrKysrLS0tLS0tLS0tLS0tLS0tLS0tLS0KIDEgZmlsZXMgY2hhbmdl ZCwg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IGJsb2NrX3NlbGYgKHQtPmpvaW5fcXVldWUsIHRocmVh ZCwgJnQtPmFkbWluX211dGV4LCB0aW1lb3V0X3B0cik7CisgICAgICBpZiAoZXJyID09IEVUSU1F RE9VVCkKKwlicmVhazsKKworICAgICAgc2NtX2lfcHRocmVhZF9tdXRleF91bmxvY2sgKCZ0LT5h ZG1pbl9tdXRleCk7CisgICAgICBTQ01fVElDSzsKKyAgICAgIHNjbV9pX3NjbV9wdGhyZWFkX211 dGV4X2xvY2sgKCZ0LT5hZG1pbl9tdXRleCk7CiAgICAgfQogCiAgIHNjbV9pX3B0aHJlYWRfbXV0 ZXhfdW5sb2NrICgmdC0+YWRtaW5fbXV0ZXgpOwotLSAKMS41LjQuMwoK ------=_Part_8086_24673104.1211856801158--