From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry OReilly Newsgroups: gmane.emacs.bugs Subject: bug#15561: Timer can miss its SIGALRM Date: Tue, 8 Oct 2013 10:20:47 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b2e4c46973bb304e83b79be X-Trace: ger.gmane.org 1381242077 17663 80.91.229.3 (8 Oct 2013 14:21:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2013 14:21:17 +0000 (UTC) To: 15561@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 08 16:21:20 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1VTY9x-0007km-JN for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Oct 2013 16:21:13 +0200 Original-Received: from localhost ([::1]:37245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTY9x-0001Uy-6K for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Oct 2013 10:21:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTY9o-0001Q0-B8 for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 10:21:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTY9n-0003qE-2V for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 10:21:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTY9m-0003pl-VY for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 10:21:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VTY9m-0006Tj-7G for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 10:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Barry OReilly Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Oct 2013 14:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15561 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138124205524883 (code B ref -1); Tue, 08 Oct 2013 14:21:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Oct 2013 14:20:55 +0000 Original-Received: from localhost ([127.0.0.1]:34914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTY9e-0006TG-CD for submit@debbugs.gnu.org; Tue, 08 Oct 2013 10:20:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36224) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTY9c-0006T9-Kp for submit@debbugs.gnu.org; Tue, 08 Oct 2013 10:20:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTY9b-0003mQ-4S for submit@debbugs.gnu.org; Tue, 08 Oct 2013 10:20:52 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTY9b-0003mM-1M for submit@debbugs.gnu.org; Tue, 08 Oct 2013 10:20:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTY9Z-0001Or-UK for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 10:20:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTY9Y-0003lp-QJ for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 10:20:49 -0400 Original-Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]:56727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTY9Y-0003lh-Ko for bug-gnu-emacs@gnu.org; Tue, 08 Oct 2013 10:20:48 -0400 Original-Received: by mail-ob0-f182.google.com with SMTP id wn1so529359obc.27 for ; Tue, 08 Oct 2013 07:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=V2oNcnbsaXLIdqNfE39Jat/Lj28Xj9Me6fI/U6ENkYc=; b=gTb7i5hAsGrHUcNLkueV/pgtxsQobhYXAW+pBNLrJQAk+ErmkqgRo+aSYx/zAcDyXJ 3glCRCtcECYdutHO87Fw0PG9m9pI4rhhmfmQNGpaNWRPNbwYylgZG6vw1WYmFrbraN6A tTP2TT18wr5/XrAd9P61npwoq4xEc8QOdnfJQf6/Je5tT7Ua28/Txbkan0yzO0Cl+ij+ eIJYJNB4h9ES7SoyW6QT0W1aPIgeXpGbQeZ+61/iBJcLZcBh+8lyh4Ezbp7GcTuZhZ4I SG3c7TF69jJpP3LBj6VayC4GqHz8q+9yymfYxI6yyCty4G+lWaev7ywJYevIOLROWwYR tVmg== X-Received: by 10.60.140.168 with SMTP id rh8mr50952oeb.76.1381242047507; Tue, 08 Oct 2013 07:20:47 -0700 (PDT) Original-Received: by 10.76.156.103 with HTTP; Tue, 8 Oct 2013 07:20:47 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79033 Archived-At: --047d7b2e4c46973bb304e83b79be Content-Type: text/plain; charset=ISO-8859-1 Looking over the timer code, the do_pending_atimers function does: block_atimers (); run_timers (); unblock_atimers (); The last line of run_timers is: set_alarm (); But what happens if the next timer happens to be soon, and Emacs receives SIGALRM inbetween set_alarm and unblock_timers? What is the purpose of sigmasking SIGALRM anyway? If it means to block SIGALRM during timers, that doesn't always happen because timers run within timers. The end of an inner timer would unblock SIGALRM and the outer timer would finish with the sigmask unblocked. --047d7b2e4c46973bb304e83b79be Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Looking over the timer code, the do_pending_atimers functi= on does:

=A0=A0=A0=A0=A0 block_atimers ();
=A0=A0=A0=A0=A0 run_ti= mers ();
=A0=A0=A0=A0=A0 unblock_atimers ();

The last line of run= _timers is:

=A0 set_alarm ();

But what happens if the next timer happens to be soon, and Emacs
rec= eives SIGALRM inbetween set_alarm and unblock_timers?

What is the pu= rpose of sigmasking SIGALRM anyway? If it means to block
SIGALRM during = timers, that doesn't always happen because timers run
within timers. The end of an inner timer would unblock SIGALRM and
the o= uter timer would finish with the sigmask unblocked.

--047d7b2e4c46973bb304e83b79be--