From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#59055: [PATCH] Fix possible deadlock. Date: Sun, 20 Nov 2022 18:19:07 +0100 Message-ID: <87wn7p5yt0.fsf@gnu.org> References: <20221105165923.5426-1-olivier.dion@polymtl.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29673"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: 59055-done@debbugs.gnu.org To: Olivier Dion Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sun Nov 20 18:20:57 2022 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1owo00-0007VL-Qq for guile-bugs@m.gmane-mx.org; Sun, 20 Nov 2022 18:20:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ownz9-0001Eu-J3; Sun, 20 Nov 2022 12:20:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ownz8-0001EP-Lq for bug-guile@gnu.org; Sun, 20 Nov 2022 12:20:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ownz8-0006aO-Ce for bug-guile@gnu.org; Sun, 20 Nov 2022 12:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ownz8-0002N6-7b for bug-guile@gnu.org; Sun, 20 Nov 2022 12:20:02 -0500 Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Sun, 20 Nov 2022 17:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 59055 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Mail-Followup-To: 59055@debbugs.gnu.org, ludo@gnu.org, olivier.dion@polymtl.ca Original-Received: via spool by 59055-done@debbugs.gnu.org id=D59055.16689647579051 (code D ref 59055); Sun, 20 Nov 2022 17:20:02 +0000 Original-Received: (at 59055-done) by debbugs.gnu.org; 20 Nov 2022 17:19:17 +0000 Original-Received: from localhost ([127.0.0.1]:44438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ownyO-0002Lu-Kk for submit@debbugs.gnu.org; Sun, 20 Nov 2022 12:19:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ownyN-0002Lh-5P for 59055-done@debbugs.gnu.org; Sun, 20 Nov 2022 12:19:16 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ownyH-0006Sp-VL; Sun, 20 Nov 2022 12:19:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=g678kWuoJbgY17yKLKNxvah4dTYbM0oxBIJmwe6VNFo=; b=PtIZ0qfoy9VRtQOeIPBZ pwz+aEFPD7eXpafNNuaVrwvKo9InUnFw4/tGvDunqY7US8rGgKGf2J8Mkecb9fGg8/IEnSTfW/nLl mzrLvjMHj0Hzx2UdKaUHv3kh5zUR0x+dZ43/yC2+cN8wITUY82Zutv9J7BoZmbEM40v5Wgi87a8j0 kEPuszNGddX9MBp7AN0aMqYpSBtWbGzGNaJluuYTckFoE+SeXg9F7ShepQH6KVPCaOr11LFmdh1Z+ bhj+pqK7A57mR3FEOxoSOngVbdztSPTnSyzHEct6ko3ysGGGK4PDymEI3DoSwDf6upeL6VjMTO7zY 52XYsxypJjAUWQ==; Original-Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ownyH-0001uJ-Em; Sun, 20 Nov 2022 12:19:09 -0500 In-Reply-To: <20221105165923.5426-1-olivier.dion@polymtl.ca> (Olivier Dion's message of "Sat, 5 Nov 2022 12:59:23 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10438 Archived-At: Hi, Olivier Dion skribis: > If we got interrupted while waiting on our condition variable, we unlock > the kernel mutex momentarily while executing asynchronous operations > before putting us back into the waiting queue. > > However, we have to retry acquiring the mutex before getting back into > the queue, otherwise it's possible that we wait indefinitely since > nobody could be the owner for a while. > > * libguile/threads.c (lock_mutex): Try acquring the mutex after signal > interruption. Looks reasonable to me; applied. Did you try to come up with a reproducer? That would be awesome but I guess it=E2=80=99s hard because you need to trigger EINTR at the right poin= t. Thanks, Ludo=E2=80=99.