From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#39944: 27.0.90; JIT Stealth timer errors Date: Sat, 7 Mar 2020 10:02:28 -0800 Organization: UCLA Computer Science Department Message-ID: References: <83a74tiyyd.fsf@gnu.org> <837dzxiyr8.fsf@gnu.org> <835zfhiyag.fsf@gnu.org> <83h7z1bh0d.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------64FEC9E8C0543FA65826C051" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="29547"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Cc: 39944@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 07 19:03:20 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jAdnE-0007aj-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Mar 2020 19:03:20 +0100 Original-Received: from localhost ([::1]:51446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAdnC-0005nI-Uf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Mar 2020 13:03:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57518) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAdmx-0005n1-PC for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 13:03:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAdmw-0004nk-Ka for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 13:03:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41537) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jAdmw-0004nF-FP for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 13:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jAdmw-00032G-C0 for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 13:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Mar 2020 18:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39944 X-GNU-PR-Package: emacs Original-Received: via spool by 39944-submit@debbugs.gnu.org id=B39944.158360415711636 (code B ref 39944); Sat, 07 Mar 2020 18:03:02 +0000 Original-Received: (at 39944) by debbugs.gnu.org; 7 Mar 2020 18:02:37 +0000 Original-Received: from localhost ([127.0.0.1]:47510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAdmW-00031c-W5 for submit@debbugs.gnu.org; Sat, 07 Mar 2020 13:02:37 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAdmV-00031P-B9 for 39944@debbugs.gnu.org; Sat, 07 Mar 2020 13:02:36 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B92FE1600C3; Sat, 7 Mar 2020 10:02:29 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id lfAfZGIs46cE; Sat, 7 Mar 2020 10:02:28 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D6D231600C5; Sat, 7 Mar 2020 10:02:28 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id C3wxxXcemeBs; Sat, 7 Mar 2020 10:02:28 -0800 (PST) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 934131600C3; Sat, 7 Mar 2020 10:02:28 -0800 (PST) In-Reply-To: <83h7z1bh0d.fsf@gnu.org> Content-Language: en-US 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177022 Archived-At: This is a multi-part message in MIME format. --------------64FEC9E8C0543FA65826C051 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 3/6/20 8:11 AM, Eli Zaretskii wrote: > (the comments in that part of the code can really use some > enhancement; they currently seem to target only experts in both time > handling and GMP: many macros whose names don't explain what they do, > and plethora of calls to libgmp functions that have no comments > whatsoever). Although comments in that area no doubt could use improvement, I'd rather not see comments like this: /* Add TM_YEAR_BASE to mpz[0]. */ mpz_add_ui (mpz[0], mpz[0], TM_YEAR_BASE); as they would be the rough equivalent of: /* Add 1 to I. */ i++; > + (when (numberp time) > + (setq time (timer-relative-time nil time)) > + (or (consp time) > + (setq time (time-convert time 'list)))) This would catch some problems but not all, as the real bug here is in the code (or (consp time) (error "Invalid time format")) which occurs a few lines later. As near as I can tell this later code is both wrong and unnecessary. It's wrong because it's no longer true that only conses are time values. It's unnecessary because the immediately following (timer-set-function timer function args) call checks the validity of TIME. On the off chance that a validity check is still helpful (because we don't want to create garbage?) I installed the attached patch. But it might be better in master to remove the "Invalid time format" check entirely. --------------64FEC9E8C0543FA65826C051 Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-bug-with-JIT-stealth-timers.patch" Content-Disposition: attachment; filename="0001-Fix-bug-with-JIT-stealth-timers.patch" Content-Transfer-Encoding: quoted-printable >From 363d927086dbdc4e5073393889b76eb0470785f4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 7 Mar 2020 09:47:03 -0800 Subject: [PATCH] Fix bug with JIT stealth timers MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/emacs-lisp/timer.el (run-at-time): Don=E2=80=99t assume that Lisp time values must be conses (Bug#39944). --- lisp/emacs-lisp/timer.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 74a94957e7..9eb8feed0f 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -378,7 +378,7 @@ This function returns a timer object which you can us= e in (decoded-time-year now) (decoded-time-zone now))))))) =20 - (or (consp time) + (or (time-equal-p time time) (error "Invalid time format")) =20 (let ((timer (timer-create))) --=20 2.17.1 --------------64FEC9E8C0543FA65826C051--