From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#39944: 27.0.90; JIT Stealth timer errors Date: Sat, 07 Mar 2020 20:29:47 +0200 Message-ID: <831rq49fxg.fsf@gnu.org> References: <83a74tiyyd.fsf@gnu.org> <837dzxiyr8.fsf@gnu.org> <835zfhiyag.fsf@gnu.org> <83h7z1bh0d.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="7194"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39944@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 07 19:30:11 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 1jAeDD-0001nR-EB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Mar 2020 19:30:11 +0100 Original-Received: from localhost ([::1]:51618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAeDC-0001fZ-0J for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Mar 2020 13:30:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33018) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAeD5-0001fQ-9u for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 13:30:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAeD4-0006dT-8K for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 13:30:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41567) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jAeD4-0006dG-5Q for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 13:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jAeD3-0003ey-WE for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 13:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Mar 2020 18:30:01 +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.158360579614035 (code B ref 39944); Sat, 07 Mar 2020 18:30:01 +0000 Original-Received: (at 39944) by debbugs.gnu.org; 7 Mar 2020 18:29:56 +0000 Original-Received: from localhost ([127.0.0.1]:47540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAeCy-0003eJ-Ir for submit@debbugs.gnu.org; Sat, 07 Mar 2020 13:29:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46103) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAeCw-0003e6-RB for 39944@debbugs.gnu.org; Sat, 07 Mar 2020 13:29:55 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jAeCr-0006WA-6D; Sat, 07 Mar 2020 13:29:49 -0500 Original-Received: from [176.228.60.248] (port=4131 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jAeCp-00070g-KJ; Sat, 07 Mar 2020 13:29:48 -0500 In-Reply-To: (message from Paul Eggert on Sat, 7 Mar 2020 10:02:28 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:177025 Archived-At: > Cc: 39944@debbugs.gnu.org > From: Paul Eggert > Date: Sat, 7 Mar 2020 10:02:28 -0800 > > > (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); There are quite a few of similar comments there, and they actually help, because they save us from consulting the GMP manual on every step. But I really meant that stuff like this lacks a comment: hz = make_integer_mpz (); mpz_swap (mpz[0], *iticks); ticks = make_integer_mpz (); And also functions like timespec_ticks, lisp_time_hz_ticks, and lisp_time_seconds, which don't have a single comment describing how they do their thing. Following that code with the purpose of tracking some specific result is not for the faint at heart. I think adding a comment here and there might make that easier. > > + (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. Thanks. > But it might be better in master to remove the "Invalid time format" > check entirely. I'm fine with removing that test, if we are sure that invoking run-at-time with something utterly un-timely, like a symbol or a a string that cannot be a valid time description, will trigger an error (presumably from timer-set-time).