From: Eli Zaretskii <eliz@gnu.org>
To: "Michał Krzywkowski" <mkrzywkow@gmail.com>
Cc: 37892@debbugs.gnu.org
Subject: bug#37892: 27.0.50; Crash when signaling a thread
Date: Fri, 25 Oct 2019 11:44:16 +0300 [thread overview]
Message-ID: <83sgnhw6xr.fsf@gnu.org> (raw)
In-Reply-To: <87zhhro0gt.fsf@gmail.com> (message from Michał Krzywkowski on Wed, 23 Oct 2019 19:06:42 +0200)
> From: Michał Krzywkowski <mkrzywkow@gmail.com>
> Date: Wed, 23 Oct 2019 19:06:42 +0200
>
> When I evaluate this sexp, Emacs aborts:
>
> (let ((thread (make-thread (lambda () (sit-for 1.0)))))
> (sit-for 0.5)
> (thread-signal thread 'error nil))
>
> Backtrace:
>
> Thread 5 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:371
> 371 signal (sig, SIG_DFL);
> #0 0x000000000041f40b in terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:371
> #1 0x000000000041f866 in emacs_abort () at sysdep.c:2450
> #2 0x000000000042154b in signal_or_quit (error_symbol=XIL(0x90), data=XIL(0), keyboard_quit=<optimized out>) at eval.c:1598
> #3 0x0000000000421564 in Fsignal (error_symbol=<optimized out>, data=<optimized out>) at eval.c:1568
> #4 0x0000000000423929 in post_acquire_global_lock (self=<optimized out>) at thread.c:115
> #5 0x00000000005c5e62 in acquire_global_lock (self=0x1465e50) at thread.c:123
Emacs doesn't allow signals while it waits for input.
We could ignore thread-signal in such cases, or we could make it an
error (which will then signal an error in the thread which called
thread-signal). What do people think? Are there any other ideas for
handling this situation?
Michał, can you tell why you needed to call thread-signal while the
thread was in sit-for?
Thanks.
next prev parent reply other threads:[~2019-10-25 8:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 17:06 bug#37892: 27.0.50; Crash when signaling a thread Michał Krzywkowski
2019-10-25 8:44 ` Eli Zaretskii [this message]
2019-10-26 12:29 ` Michał Krzywkowski
2019-10-26 12:58 ` Eli Zaretskii
2019-10-27 10:16 ` Michał Krzywkowski
2019-10-27 13:25 ` Eli Zaretskii
2019-10-27 19:26 ` Michał Krzywkowski
2021-12-05 3:15 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83sgnhw6xr.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=37892@debbugs.gnu.org \
--cc=mkrzywkow@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.