[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re-entering the event loop

From: Alan Third
Subject: Re-entering the event loop
Date: Sat, 18 Jun 2016 12:38:27 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

The NS port has an event loop that contains this code:

    if (++apploopnr != 1)
        emacs_abort ();

So if the loop is entered again it crashes Emacs instantly and gives
a stack trace. This shows up in a couple of bugs.

Bug#11049, for example, is where it receives a SIGHUP and should quit
cleanly and write out backups of open buffers, etc. but actually just
crashes because it re-enters the event loop.

What happens here is that the SIGHUP is received as an event, which
then calls a function that unblocks *all* input. Then Emacs tries to
clean up before quitting but that results with it handling input
events again, therefore re-entering the event loop and aborting.

I've sent a patch to this bug that simply re-blocks input, but the
alternative is to remove this check and let Emacs re-enter the event
loop. As far as I can tell this works fine for this particular case
(SIGHUP), but I don't know if it will break something else.

Is there any way, other than sending signal to kill it, that would
result in Emacs re-entering the event loop?

Alan Third

Attachment: remove-abort.patch
Description: Remove event loop abort

reply via email to

[Prev in Thread] Current Thread [Next in Thread]