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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 10 Dec 2020 17:23:33 +0200

> From: João Távora <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 10 Dec 2020 15:00:58 +0000
> 
>     6       breakpoint     keep y   0x0000555555966de5 in unwind_to_catch at eval.c:1178
>             stop only if bidi_inhibit_bpa != 0

You have put the breakpoint at the point where sys_longjmp is about to
be called, right?  But all the unwind forms are already done at that
point, so I guess bidi_inhibit_bpa is again zero, and the breakpoint
doesn't break.  So I suggest to move the breakpoint before the
do-while loop in unwind_to_catch:

  do
    {
      /* Unwind the specpdl stack, and then restore the proper set of
	 handlers.  */
      unbind_to (handlerlist->pdlcount, Qnil);
      last_time = handlerlist == catch;
      if (! last_time)
	handlerlist = handlerlist->next;
    }
  while (! last_time);

> 1. Shouldn't all of these have triggered the breakpoint??  I'm setting
>    the Elisp/C variable in the macro.  I tested the technique
>    separately.
> 
> 2. Are we sure that no other mechanisms other than throw/catch/signal
>    can trigger a non-local exit (that unwind-protect can still somehow
>    catch?).

Let's see if it works to move the breakpoint location, and take it
from there.