Subject: bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer

From: Eli Zaretskii <[email-masked]>
Date: Thu, 10 Dec 2020 18:41:51 +0200

> From: João Távora <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 10 Dec 2020 16:15:42 +0000
> 
> Anyway, it seems process_quit_flag is being called and throwing (though
> I don't see "Quit" in the *Messages*). And didn't you tell me that idle
> timers run with inhibit-quit = t?

Yes, see for yourself, this fragment from timer_check_2, which calls
timer-event-handler:

	      specbind (Qinhibit_quit, Qt);  <<<<<<<<<<<<<<<<<<<

	      call1 (Qtimer_event_handler, chosen_timer);
	      Vdeactivate_mark = old_deactivate_mark;
	      timers_run++;
	      unbind_to (count, Qnil);

> But inhibit-quit seems to be nil (which I also confirmed from
> Elisp.)

I guess some code called from the timer resets inhibit-quit to nil?
You could put a watchpoint on Vinhibit_quit and see who does that.