From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#28630: 27.0.50; C-g while a non-main thread is sitting crashes Emacs Date: Sat, 07 Oct 2017 13:53:43 +0000 Message-ID: References: <87efqri8x9.fsf@gmail.com> <874lrjy2rz.fsf@gmail.com> <831smm52v4.fsf@gnu.org> <87d166rb6n.fsf@gmail.com> <83o9pq3eix.fsf@gnu.org> <838tgt352c.fsf@gnu.org> <83fuazz7ja.fsf@gnu.org> <83a817z5sd.fsf@gnu.org> <834lrfz2pk.fsf@gnu.org> <83infuxdk4.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113779eabf1a8d055af549d5" X-Trace: blaine.gmane.org 1507384509 13965 195.159.176.226 (7 Oct 2017 13:55:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Oct 2017 13:55:09 +0000 (UTC) Cc: 28630@debbugs.gnu.org, tom@tromey.com, agrambot@gmail.com To: Eli Zaretskii , YAMAMOTO Mitsuharu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 07 15:55:04 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0pZH-0002sv-LT for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Oct 2017 15:55:03 +0200 Original-Received: from localhost ([::1]:49846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0pZP-0002jB-5p for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Oct 2017 09:55:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0pZJ-0002iv-3c for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2017 09:55:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0pZF-0003EV-WA for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2017 09:55:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45165) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0pZF-0003E3-Sr for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2017 09:55:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e0pZF-0000vs-KM for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2017 09:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Oct 2017 13:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28630 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28630-submit@debbugs.gnu.org id=B28630.15073844443507 (code B ref 28630); Sat, 07 Oct 2017 13:55:01 +0000 Original-Received: (at 28630) by debbugs.gnu.org; 7 Oct 2017 13:54:04 +0000 Original-Received: from localhost ([127.0.0.1]:53845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0pYJ-0000uV-KP for submit@debbugs.gnu.org; Sat, 07 Oct 2017 09:54:03 -0400 Original-Received: from mail-oi0-f46.google.com ([209.85.218.46]:46819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0pYG-0000tm-7g for 28630@debbugs.gnu.org; Sat, 07 Oct 2017 09:54:01 -0400 Original-Received: by mail-oi0-f46.google.com with SMTP id n82so26322796oig.3 for <28630@debbugs.gnu.org>; Sat, 07 Oct 2017 06:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lwENhnf75YKQjcKPRtKJzumycTxN3vnXs9CnDfaOAkU=; b=WfOtlEAnv7lQTKGxQj5QBXw7deFjC8pEDrKi1L4XJV7Aj7mBe7LAMpAldIiqAns8hd uXbtLmrWFWckR+e6uOEa8X3mK2eM29ZfLQRqfC+nY6Mu/V5pzWC8EI3RoXRQzNZ1zUEn GjwQOKOXdOAg411x/n4r4KBvTINhYrP6+mZK1s4mRh/DOVtlL905FUfUlzoHuoNmTpw0 OwXroxuMYV9L0HkbK6+CcTQRJ14PDMFh3Ua/ifBUVQYSknuhCyoG2hwrtg9arvUM5W5l nEKp0dHqzxj683R6If4pv17azRjwtHrB/5zPUQeROvQHUJraJIHfCYXFuvhNvdi/1dXS +VEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lwENhnf75YKQjcKPRtKJzumycTxN3vnXs9CnDfaOAkU=; b=EswVa35bb3a2RPjL3DgwMbUls3KnI42Zdutct8KPkTuxTIzsmHtrKqpi3RRSRubJP2 VTgMbjFVpuzdxGSoU0u5JnMgcCHeEU49ziS2AD180KpQrW3Nm/oX0nM3devBXOv5GKk0 7/L4LvXn8jlJQ7C9vOI7ZR0HpDoQNtbpFKLvLze/l1MynbXn9v/xp7o9YqVnP3lLiKEN gJYX6ZL6J3FDdtwrhIzK2TzSfLJLA08TRPpHjTZRitZoyKpnJzucArdTFZLyxJoTrG5Y 63nhgYkaHG3yV7lVky5/khi2ldUbKITDWLrgmaWRGsMI6ZN9a3cJ+6zCW2hN/ElD7lUj JQBw== X-Gm-Message-State: AMCzsaXPjOEPMGHKwVZksl0UUCtfje21R4rrtBWFrSmgArKCHcNTrcSm 1DMRN9fNt/maKBmJ6rAUGAJ9XeQk0A3KQKbTvgY= X-Google-Smtp-Source: AOwi7QC5sT79UvlCCqdzX4ScNpp0KoW0oor8RECjp4fZ4s/kJOnKAcBhlNuNbpIFNLewDiIpkU5djrzo3lkz48ydqus= X-Received: by 10.157.59.55 with SMTP id z52mr2797779otb.75.1507384434298; Sat, 07 Oct 2017 06:53:54 -0700 (PDT) In-Reply-To: <83infuxdk4.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: 208.118.235.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:138047 Archived-At: --001a113779eabf1a8d055af549d5 Content-Type: text/plain; charset="UTF-8" Eli Zaretskii schrieb am Do., 5. Okt. 2017 um 09:25 Uhr: > > Date: Thu, 05 Oct 2017 12:27:28 +0900 > > From: YAMAMOTO Mitsuharu > > Cc: agrambot@gmail.com, > > 28630-done@debbugs.gnu.org, > > tom@tromey.com > > > > >>>>> On Wed, 04 Oct 2017 12:23:19 +0300, Eli Zaretskii > said: > > > > >> > OOC, could you please see whether on X the sit-for call is > > >> > interrupted or not? That is, do you see the "there" message > > >> > after typing C-g? > > Same for NS. Interestingly, some variants of the original recipe > > behave differently with respect to C-g depending on the toolkit. > > > > Example 1: > > > > (thread-join > > (make-thread > > (lambda () > > (message "hello") > > (sit-for 2) > > (message "there")))) > > > > Interrupted: GTK+, Athena, no toolkit, Mac > > Not interrupted: NS > > > > > > Example 2: > > > > (thread-join > > (make-thread > > (lambda () > > (message "hello") > > (sleep-for 2) > > (message "there")))) > > > > Interrupted: GTK+ > > Not interrupted: Athena, no toolkit, Mac, NS > > For the record, on MS-Windows, both are interrupted. > > > Probably it has something to do with xg_select. > > Could be. > > The upshot of this is that doing keyboard I/O in non-main threads is > inherently unportable. Should we mention this in the manual? > > > > I'd rather see this as a bug and document it in etc/PROBLEMS. Also, if the behavior between main and non-main threads differ, there should probably a `in-main-thread-p' function. --001a113779eabf1a8d055af549d5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Do., 5. Okt. 2017 um 09:25=C2=A0Uhr:
> Date: Thu, 05 Oct 2017 12:27:28 +0900
> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> Cc: agrambot@g= mail.com,
>=C2=A0 =C2=A0 =C2=A0 =C2=A028630-done@debbugs.gnu.org,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0tom@tromey.com
>
> >>>>> On Wed, 04 Oct 2017 12:23:19 +0300, Eli Zaretskii= <eliz@gnu.org>= said:
>
> >> > OOC, could you please see whether on X the sit-for call = is
> >> > interrupted or not?=C2=A0 That is, do you see the "= there" message
> >> > after typing C-g?
> Same for NS.=C2=A0 Interestingly, some variants of the original recipe=
> behave differently with respect to C-g depending on the toolkit.
>
> Example 1:
>
> (thread-join
>=C2=A0 (make-thread
>=C2=A0 =C2=A0(lambda ()
>=C2=A0 =C2=A0 =C2=A0(message "hello")
>=C2=A0 =C2=A0 =C2=A0(sit-for 2)
>=C2=A0 =C2=A0 =C2=A0(message "there"))))
>
> Interrupted: GTK+, Athena, no toolkit, Mac
> Not interrupted: NS
>
>
> Example 2:
>
> (thread-join
>=C2=A0 (make-thread
>=C2=A0 =C2=A0(lambda ()
>=C2=A0 =C2=A0 =C2=A0(message "hello")
>=C2=A0 =C2=A0 =C2=A0(sleep-for 2)
>=C2=A0 =C2=A0 =C2=A0(message "there"))))
>
> Interrupted: GTK+
> Not interrupted: Athena, no toolkit, Mac, NS

For the record, on MS-Windows, both are interrupted.

> Probably it has something to do with xg_select.

Could be.

The upshot of this is that doing keyboard I/O in non-main threads is
inherently unportable.=C2=A0 Should we mention this in the manual?





I'd rather see this= as a bug and document it in etc/PROBLEMS.
Also, if the behavior = between main and non-main threads differ, there should probably a `in-main-= thread-p' function.=C2=A0
--001a113779eabf1a8d055af549d5--