From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Micha=C5=82?= Krzywkowski Newsgroups: gmane.emacs.bugs Subject: bug#37892: 27.0.50; Crash when signaling a thread Date: Sat, 26 Oct 2019 14:29:43 +0200 Message-ID: <87blu3lmfc.fsf@gmail.com> References: <87zhhro0gt.fsf@gmail.com> <83sgnhw6xr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="247350"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.0; emacs 26.3.50 Cc: 37892@debbugs.gnu.org, =?UTF-8?Q?Micha=C5=82?= Krzywkowski To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 26 14:31:22 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iOLE1-00128k-1D for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Oct 2019 14:31:21 +0200 Original-Received: from localhost ([::1]:39938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOLDz-0001Rn-RB for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Oct 2019 08:31:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39547) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOLDk-00016d-3X for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 08:31:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOLDj-00061N-0V for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 08:31:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOLDi-00060x-U5 for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 08:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iOLDh-0004E7-P9 for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 08:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Micha=C5=82?= Krzywkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Oct 2019 12:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37892 X-GNU-PR-Package: emacs Original-Received: via spool by 37892-submit@debbugs.gnu.org id=B37892.157209303816213 (code B ref 37892); Sat, 26 Oct 2019 12:31:01 +0000 Original-Received: (at 37892) by debbugs.gnu.org; 26 Oct 2019 12:30:38 +0000 Original-Received: from localhost ([127.0.0.1]:39776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOLDJ-0004DR-P6 for submit@debbugs.gnu.org; Sat, 26 Oct 2019 08:30:38 -0400 Original-Received: from mail-lj1-f176.google.com ([209.85.208.176]:46696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOLDF-0004DB-2p for 37892@debbugs.gnu.org; Sat, 26 Oct 2019 08:30:34 -0400 Original-Received: by mail-lj1-f176.google.com with SMTP id w8so1727426lji.13 for <37892@debbugs.gnu.org>; Sat, 26 Oct 2019 05:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=J715dQAkzVYwNovshQvSc5FKmyQVjFVXA9FMt/pvGHw=; b=Ebpy9kP3oHwHgn5n1QTUYIYgDJbDElWFPmEjR5HDDH4VAKOVVifyGZbXSnG/Nk25F5 yUb53BsXtDAPeLUmLwqNve5nLA735q7HRUfGPyxfdXNYUBXtyJES5T7SdjpZbOQcaxB6 hOpQsKB1kkLhcim6Bbs4u3l/IMju6GSmWAX0XM5l83Xec0/BNpVDXqGQN3ofJ7glyIVo 1Vanw8pbB7SLgUcbXkh8LJ1bNVYNXcZbywAkh/UAGVLXFUu0NVjhB6U3bYNhDS7/Rgik lFqQxGuRQ+37qB41gv8kABm9H9JphDH+wYedsPCFiosirdUxbrGuDkiDL1HtiiO9ot8E sk3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=J715dQAkzVYwNovshQvSc5FKmyQVjFVXA9FMt/pvGHw=; b=WpTB4y/gpUdNruIZy8CuuGlW0u38fWUHtU0Wy7H8T7EeJG299a6Qxk6NgZnmdGwypa Ir4c5szzqHiSoyS9awXnOw22WFRC8iICBHS4sFd29rKmD5qB5T57INAiwQwh9pwsNaNI L3fb9mrQ7sUTNgKnTDfTvhPn0jMlZ0K1aE9yBSLRMOrLKcStJ/iPhNVOeJsP0GzkPdXv G5IKqt91kwKkF3uPx+b4hfYgRA91OyOouwspbiswpymJ2+v4nkkYiVipiqmNxaCenk5J inzqXYyKRLqeqBoPEz/dCrqgYvMN9Y7pRX4owhCcI+YubvfIQ/1ngSvSHXbdL0xMp7VZ YaqA== X-Gm-Message-State: APjAAAV8fBZdHDyc1fwR6m2duF/B8TGsiHpZIXk0GKNok859xp69eh8V NjVBllqxTBFtIyOGNNXq2oLjkEZH X-Google-Smtp-Source: APXvYqx5VRAlxV+ES5/kmbIZaEHcGm9iTs9FF+83Xuxk/UVUmNWZ9P8fV84i1VqMtvKTZ1uSu7KkTQ== X-Received: by 2002:a2e:7c13:: with SMTP id x19mr6032872ljc.0.1572093026834; Sat, 26 Oct 2019 05:30:26 -0700 (PDT) Original-Received: from debian (89-65-39-79.dynamic.chello.pl. [89.65.39.79]) by smtp.gmail.com with ESMTPSA id g3sm2281677ljj.59.2019.10.26.05.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Oct 2019 05:30:25 -0700 (PDT) In-reply-to: <83sgnhw6xr.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170195 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> "Eli" =3D=3D Eli Zaretskii writes: >> From: Micha=C5=82 Krzywkowski >> 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=3Dsi= g@entry=3D6, backtrace_limit=3Dbacktrace_limit@entry=3D40) at emacs.c:371 >> 371 signal (sig, SIG_DFL); >> #0 0x000000000041f40b in terminate_due_to_signal (sig=3Dsig@entry= =3D6, backtrace_limit=3Dbacktrace_limit@entry=3D40) at emacs.c:371 >> #1 0x000000000041f866 in emacs_abort () at sysdep.c:2450 >> #2 0x000000000042154b in signal_or_quit (error_symbol=3DXIL(0x90), = data=3DXIL(0), keyboard_quit=3D) at eval.c:1598 >> #3 0x0000000000421564 in Fsignal (error_symbol=3D, d= ata=3D) at eval.c:1568 >> #4 0x0000000000423929 in post_acquire_global_lock (self=3D) at thread.c:115 >> #5 0x00000000005c5e62 in acquire_global_lock (self=3D0x1465e50) at = thread.c:123 Eli> Emacs doesn't allow signals while it waits for input. Eli> We could ignore thread-signal in such cases, or we could make it an Eli> error (which will then signal an error in the thread which called Eli> thread-signal). What do people think? Are there any other ideas = for Eli> handling this situation? Maybe the signal should be raised in the thread right after it returns from sit-for? Ignoring signals sounds like a bad idea. Eli> Micha=C5=82, can you tell why you needed to call thread-signal whi= le the Eli> thread was in sit-for? I wanted to signal some background thread which was doing some work and then Emacs crashed, because it just so happened that it was in sit-for. The thread function was doing _more_ than just sit-for. I actually don't care (and can't know) what another thread is doing, I just want to send a signal to it. Eli> Thanks. Thank you. =2D- Micha=C5=82 Krzywkowski PGP: A5A7 06C4 28EF 8F64 2868 13A1 7BDE C129 F0B8 09A1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEWxyvIOWnapfz9K2Z20CneWXMPiIFAl20PDcACgkQ20CneWXM PiKj4wf+PYbtOHfGTe+rgVr5KS8c4qinuf2VvwzmDHuO4/mAy+Sui1BRHC9N8G8I /w0tmwP20MpMw8DMO68Bui7xKEkwtkekcoMwmN+huhuNq3/OMouqsiq9cekUwBwJ N5/k2QxyWUrHzKwKd9kKIKryufPrAL2dzfGlpRdRzSQep0pu26YD4DqHmaaKlyNw MU+FyAu3i7gSI4yPrDDl8FdVFPQohjeTsMUkKskvJRTAFWlSgTzbjfqEEBClmRCV b0DnHt2cqZf0bBCMla3qOwifmHf5z7WqFj/PcyI2abUYAXoRCEShAevAb5hxEupg YdERJ/eUIPzaPplanaOUj+BbVH4baQ== =chpl -----END PGP SIGNATURE----- --=-=-=--