unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Olivier Dion <olivier.dion@polymtl.ca>
Cc: 59055-done@debbugs.gnu.org
Subject: bug#59055: [PATCH] Fix possible deadlock.
Date: Sun, 20 Nov 2022 18:19:07 +0100	[thread overview]
Message-ID: <87wn7p5yt0.fsf@gnu.org> (raw)
In-Reply-To: <20221105165923.5426-1-olivier.dion@polymtl.ca> (Olivier Dion's message of "Sat, 5 Nov 2022 12:59:23 -0400")

Hi,

Olivier Dion <olivier.dion@polymtl.ca> 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’s hard because you need to trigger EINTR at the right point.

Thanks,
Ludo’.





  reply	other threads:[~2022-11-20 17:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05 16:59 bug#59055: [PATCH] Fix possible deadlock Olivier Dion via Bug reports for GUILE, GNU's Ubiquitous Extension Language
2022-11-20 17:19 ` Ludovic Courtès [this message]
2022-11-20 18:33   ` Olivier Dion via Bug reports for GUILE, GNU's Ubiquitous Extension Language

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wn7p5yt0.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=59055-done@debbugs.gnu.org \
    --cc=olivier.dion@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).