Open yantar92 opened 4 years ago
The hang happened while displaying company candidates in an org buffer. I attempted to send SIGUSR2 to emacs several times, though it did not have any effect.
I think what happened is:
debug
got called directly? - or an error in (#f(compiled-function () #<bytecode 0xa351effab488f>))
. Note that this is called inside fontify-now
which is in redisplay_internal
recursive-edit
to start.Quick question:
As part of attempting to display this buffer, explain-pause-mode
"should have" to disabled itself. So to clarify, what did you mean by "attempted to send SIGUSR2 to emacs several times"? At least Emacs didn't lock up? Or did it?
As for the error itself:
I never wrapped any code that called out of redisplay_internal()
because redisplay hooks should never be calling any code that waits on user input. However, I did not anticipate what happens when the debugger runs.
I checked debug.el
, and it refuses to start if inhibit-redisplay
is set. This code hasn't changed (except for bug fixes and an extension for batch mode) in at least 18 years. This makes sense; if you're redisplaying you can't really start the debugger. BUT, there is a specific comment in keyboard.c
recursive_edit_1
calling out literally the use case of debug
in fontification-functions
and overriding inhibit-redisplay
... so I guess this is a normal use case.
I'm not quite sure yet how I want to fix this.
fontification-functions
?As part of attempting to display this buffer, explain-pause-mode "should have" to disabled itself. So to clarify, what did you mean by "attempted to send SIGUSR2 to emacs several times"? At least Emacs didn't lock up? Or did it?
Emacs did hang during redisplay, which is something to do with one of my custom fontifications in org-mode. Then, I ran killalll -SIGUSR2 emacs
to "unhang" emacs. Sending SIGUSR2 makes Emacs call debugger (see debug-on-event
) and thus all the mess.
As part of attempting to display this buffer, explain-pause-mode "should have" to disabled itself. So to clarify, what did you mean by "attempted to send SIGUSR2 to emacs several times"? At least Emacs didn't lock up? Or did it?
Emacs did hang during redisplay, which is something to do with one of my custom fontifications in org-mode. Then, I ran
killalll -SIGUSR2 emacs
to "unhang" emacs. Sending SIGUSR2 makes Emacs call debugger (seedebug-on-event
) and thus all the mess.
Oh, I see, then this makes perfect sense. You forced debug out of SIGUSR2, that would skip the command-execute
path and there would be no root frame.
This is a pretty important use case, and in general, SIGUSR2 causes debug
to happen on the next call in eval.c
, so basically anywhere. So I think (debug)
needs some special handling. I will think more on this.
I also think it'll probably be a good idea to hook the fontification functions.