GNU bug report logs -
#25178
26.0.50; Crash when pressing C-g in TTY mode
Previous Next
Reported by: Elias Martenson <elias.martenson <at> murex.com>
Date: Mon, 12 Dec 2016 04:34:01 UTC
Severity: normal
Tags: fixed
Found in version 26.0.50
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: Elias Martenson <elias.martenson <at> murex.com>, 25178 <at> debbugs.gnu.org
> Date: Tue, 13 Dec 2016 20:26:10 +0100
>
> On Dez 13 2016, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > Hmm... Is calling pthread_mutex_unlock twice in a row, without an
> > intervening call to pthread_mutex_lock, supposed to segfault?
>
> It's undefined, so anything can happen. Just don't do that.
At this point, I'd like to establish whether the fact Emacs does do it
could explain crashes reported by Elias which I cannot reproduce on a
different GNU/Linux system.
What I think happens is that C-g on a TTY produces a SIGINT that
interrupts the call to pselect and runs handle_interrupt, which then
longjmps back to read_char, which then calls thread_select. But since
pselect inside the previous call to thread_select was interrupted, the
following call to acquire_global_lock was not done, and we are now
running with the global lock unlocked. Then thread_select calls
release_global_lock which attempts to unlock the (unlocked) mutex.
The question is whether this is just bad, or causes the crash. It
doesn't crash for me.
Thanks.
This bug report was last modified 8 years and 140 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.