From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@inria.fr (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#14640: SA_RESTART prevents execution of signal handlers Date: Tue, 21 Jun 2016 09:48:33 +0200 Organization: Inria Bordeaux Sud-Ouest Message-ID: <87wpljdlta.fsf@inria.fr> References: <87sj0gx2oq.fsf@inria.fr> <87twgn59ou.fsf@pobox.com> Reply-To: ludo@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1466496375 11372 80.91.229.3 (21 Jun 2016 08:06:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2016 08:06:15 +0000 (UTC) Cc: 14640-done@debbugs.gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Jun 21 10:06:04 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bFGh7-0003Xp-5p for guile-bugs@m.gmane.org; Tue, 21 Jun 2016 10:06:01 +0200 Original-Received: from localhost ([::1]:49550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFGh6-0005ys-7N for guile-bugs@m.gmane.org; Tue, 21 Jun 2016 04:06:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFGQk-000441-LY for bug-guile@gnu.org; Tue, 21 Jun 2016 03:49:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFGQg-0003Qp-Hq for bug-guile@gnu.org; Tue, 21 Jun 2016 03:49:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFGQg-0003Qi-EP for bug-guile@gnu.org; Tue, 21 Jun 2016 03:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bFGQg-0001cI-B2 for bug-guile@gnu.org; Tue, 21 Jun 2016 03:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: ludovic.courtes@inria.fr (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 21 Jun 2016 07:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14640 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 14640-done@debbugs.gnu.org id=D14640.14664953236175 (code D ref 14640); Tue, 21 Jun 2016 07:49:02 +0000 Original-Received: (at 14640-done) by debbugs.gnu.org; 21 Jun 2016 07:48:43 +0000 Original-Received: from localhost ([127.0.0.1]:48488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFGQN-0001bW-5s for submit@debbugs.gnu.org; Tue, 21 Jun 2016 03:48:43 -0400 Original-Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:43617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFGQK-0001bF-HS for 14640-done@debbugs.gnu.org; Tue, 21 Jun 2016 03:48:41 -0400 X-IronPort-AV: E=Sophos;i="5.26,502,1459807200"; d="scan'208";a="181948410" Original-Received: from pluto.bordeaux.inria.fr (HELO pluto) ([193.50.110.57]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 21 Jun 2016 09:48:33 +0200 X-URL: http://people.bordeaux.inria.fr/lcourtes/ X-Revolutionary-Date: 4 Messidor an 224 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87twgn59ou.fsf@pobox.com> (Andy Wingo's message of "Tue, 21 Jun 2016 08:37:37 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) 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-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8062 Archived-At: Andy Wingo skribis: > On Mon 17 Jun 2013 15:54, ludovic.courtes@inria.fr (Ludovic Court=C3=A8s)= writes: > >> When using SA_RESTART, signal handlers are never executed, as in this >> example (checked on 2.0.9+): >> >> (sigaction SIGALRM >> (lambda (signum) >> (pk 'sig signum)) >> SA_RESTART) >> (alarm 3) >> (pk 'char (read-char)) >> >> Presumably this is because the read(2) syscall is automatically >> restarted, leaving no chance for the handler async to run. > > Thinking about this a bit -- since we always handle signals > asynchronously and have no intention of handling them synchronously, > then we just have to document this behavior. Done in e877e1b: I think it=E2=80=99s problematic though. With the current design, signal delivery is unreliable (with or without SA_RESTART; what we observe with SA_RESTART occurs similarly if you make a syscall right after queuing, but not running, an async.) The more I think about it, the more I think a different approach is needed. On GNU/Linux, signalfd(2) may be part of the solution. Ludo=E2=80=99.