GNU bug report logs -
#56487
xgselect race condition leading to abort when USE_GTK not defined
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
There is a race condition in xgselect.c leading to an abort being
raised in glib code. I have attached a patch that fixes the issue.
It took an absurd amount of time to track this down and debug. The
patch and repro file contain more information.
This is not the easiest bug to test for because the race condition is
non-deterministic, I have attached the elisp file that I use to
explore and reproduce the issue.
Ensure that you have glib installed and that you are building --with-x
so that the code in xgselect is enabled. Run configure as ./configure
--with-x-toolkit=lucid (or anything except gtk), and then run make.
Assuming process-thread-bugs.el is in the top level of the emacs repo
define the following function
function loop-abort () { while true; do src/emacs -Q -batch -l \
./process-thread-bugs.el will abort 1 || return $?; done }
You can then run loop-abort; echo $? and when the patch is not applied
Emacs will eventually abort. You can also add a call to fputs in
thread.c at the location of the comment and you will almost
immediately see the abort behavior, even when building with gtk.
[0001-xgselect.c-avoid-race-condition-leading-to-abort.patch (application/x-patch, attachment)]
[process-thread-bugs.el (application/x-lisp, attachment)]
This bug report was last modified 115 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.