[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally
From: |
João Távora |
Subject: |
bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer |
Date: |
Wed, 09 Dec 2020 11:24:47 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
[ We've been CC-ing bug-gnu-emacs@gnu.org for a while. My fault, the
typical CC blunder. Wonder how debbugs was dealing with that so
gracefully tho. ]
Eli Zaretskii <eliz@gnu.org> writes:
>> From: João Távora <joaotavora@gmail.com>
>> Cc: bug-gnu-emacs@gnu.org
>> Date: Tue, 08 Dec 2020 15:56:49 +0000
>>
>> > Can you elaborate on the evidence you found of this non-local exit?
>>
>> It was evidenced by M-x trace-function process-send-string RET and also
>> by substituting the snippet I posted earlier with:
> few places we call sys_longjmp, and when it breaks, show the C and
> Lisp backtrace from there.
Right, so I got this setup, compiled Emacs 27.1 with all debugging
flags. I can reproduce it, and even with GDB attached, great. The
problem is the breakpoints.
If I set breakpoints at _all_ places where we call sys_longjmp(), I risk
tearing down my X, which I did a couple of times.
So I skip those "dangerous" breakpoints. I'm guessing one of the
interesting loci to break is unwind_to_catch in eval.c. Of course that
gets called every dang time a signal is thrown, so it's hard for me to
catch the precise situation, even if I set up nicely and then call M-x
redraw-display, and only then enable the breakpoint.
It breaks near immediately, and the `bt` output I get is always from
some other function that expectedly signalled an error as part of its
normal control flow. (Yeah, maybe I shouldn't be using signals for
normal control flow, but that's another matter.)
So:
1. I have to find a way to set the unwind_to_catch() breakpoint
conditional on some Elisp/near-elisp context, in this case something
inside the Elisp function sly-net-send() or Fprocess_send_string.
Do you think setting a silly global in Fprocess_send_string() and
then checking that as the breakpoint condition would be a good idea?
Where would I reset the flag? Is there some C-version of
"unwind-protect"?
2. The mysterious long jump may be coming from some other place. I
enabled a breakpoint in the sys_longjmp call in
quit_throw_to_read_char(), but that's not it, I can reproduce the
error and it doesn't break there. Then there are some in image.c
loci that I don't think matter much and the one in alloc.c which
freezes my X.
3. I set up one of those "tracer" breakpoints for the that you once
showed me (how did that go?) They're going to make a LOT of noise,
but at least we should be able to register the correct
unwind_to_catch() context.
João
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, João Távora, 2020/12/08
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, Eli Zaretskii, 2020/12/08
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, João Távora, 2020/12/08
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, Eli Zaretskii, 2020/12/08
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, João Távora, 2020/12/08
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer,
João Távora <=
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, Eli Zaretskii, 2020/12/09
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, João Távora, 2020/12/10
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, Eli Zaretskii, 2020/12/10
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, João Távora, 2020/12/10
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, João Távora, 2020/12/10
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, Dmitry Gutov, 2020/12/10
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, Stefan Monnier, 2020/12/10
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, João Távora, 2020/12/10
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, Stefan Monnier, 2020/12/10
- bug#45117: 28.0.50; process-send-string mysteriously exiting non-locally when called from timer, Eli Zaretskii, 2020/12/10