GNU bug report logs -
#36609
27.0.50; Possible race-condition in threading implementation
Previous Next
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 #59 received at 36609 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Fri, Jul 12, 2019 at 6:34 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > Sorry, I don't want to call unwind-protect there. Call me paranoid,
> > if you want.
>
> Maybe I should explain the rationale behind that paranoia. The main
I don't think it's paranoia, I just wasn't sure there was a good way
to avoid it.
I'm now convinced that there simply is no safe way to call select()
from two threads at once when using glib.
I think our options are hacking around it and hoping nothing breaks
(this is what the attached patch does; it releases the main context
glib lock from the wrong thread soon "after" the other thread called
select, but there's actually no way to ensure that "after" is
accurate), or rewriting things so we have a single thread that does
all the select()ing.
> reason is that you are proposing to do that inside code that can
> switch threads. Switching threads means switching to another stack
> and also to another set of handlers. So using the unwind-protect
> machinery in this situation is IMO asking for trouble.
Thanks for explaining.
[glib-hack.diff (application/x-patch, attachment)]
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.