GNU bug report logs - #36609
27.0.50; Possible race-condition in threading implementation

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Thu, 11 Jul 2019 20:52:02 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in version 28.1

Done: dick <dick.r.chiang <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #120 received at 36609 <at> debbugs.gnu.org (full text, mbox):

From: dick.r.chiang <at> gmail.com
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, pipcet <at> gmail.com, politza <at> hochschule-trier.de,
 36609 <at> debbugs.gnu.org
Subject: Re: bug#36609: 27.0.50; Possible race-condition in threading
 implementation
Date: Wed, 09 Jun 2021 17:40:28 -0400
[Message part 1 (text/plain, inline)]
EZ> You will have to provide a more detailed analysis, sorry.

There is no guarantee the static variable `threads_holding_glib_lock`
introduced in xgselect.c in commit 9c62ffb is synchronized across threads.  As
such, relying on it becoming zero in time for release_select_lock() is fraught.
(If you add print statements, this particular heisenbug disappears, at least
on Linux kernel 4.15.0-99-generic).

Four attachments:

1. Desired patch to master (reverts 9c62ffb, adds main-thread-p check).
[0001-Only-acquire-glib-context-if-main-thread.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
2. OP's original "my code doesn't work, here you figure it out", obfuscated MRE
Run as:
for i in 1 2 3 ; do src/emacs -Q -l ./report-orig.el & done
Fails if:
One of the emacsen stops responding
[report-orig.el (application/emacs-lisp, attachment)]
[Message part 5 (text/plain, inline)]
3. "Affine" redaction of OP's MRE *infrequently* breaks on tip of master (succeeds
after patch)
Run as:
for i in 1 2 3 ; do src/emacs -Q -l ./report.el & done
Fails if:
One of the emacsen stops responding
[report.el (application/emacs-lisp, attachment)]
[Message part 7 (text/plain, inline)]
4. My MRE *frequently* breaks tip of master (succeeds after patch)
[42.el (application/emacs-lisp, attachment)]
[Message part 9 (text/plain, inline)]
Run as:
for i in 1 2 3 ; do src/emacs -Q -l ./42.el & done
Fails if:
One of the emacsen stops responding

This bug report was last modified 4 years and 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.