From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Colin Baxter Newsgroups: gmane.emacs.devel Subject: Arithmetic range error Date: Fri, 08 Feb 2019 10:55:46 +0000 Message-ID: <87k1iaft1p.fsf@yandex.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="90511"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Kyle Meyer , Nicolas Goaziou To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 08 11:56:14 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gs3pN-000NO2-Jl for ged-emacs-devel@m.gmane.org; Fri, 08 Feb 2019 11:56:13 +0100 Original-Received: from localhost ([127.0.0.1]:54536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs3pM-0008JE-JI for ged-emacs-devel@m.gmane.org; Fri, 08 Feb 2019 05:56:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs3pD-0008Iw-LL for emacs-devel@gnu.org; Fri, 08 Feb 2019 05:56:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gs3pC-00020g-I8 for emacs-devel@gnu.org; Fri, 08 Feb 2019 05:56:03 -0500 Original-Received: from [195.159.176.226] (port=55330 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gs3pC-0001xV-9S for emacs-devel@gnu.org; Fri, 08 Feb 2019 05:56:02 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1gs3p4-000MwW-Fh for emacs-devel@gnu.org; Fri, 08 Feb 2019 11:55:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ X-Face: -P+89ASh_wrs;AUGm`!l[}/o-lyK}5W.gq\fkJ{#d6Gu,hWrZNz::iMm5PJb} __A96]-LUrl)X=uF=V|\3-\9/sXvBs/H Face: iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAABmJLR0QA/wD/AP+gvaeTAAAA JElEQVQokWP8/5+BeMBEglpSVTMyMJDgFFq6ZFQ1JmAcNOkEALdPBRfKw9nqAAAAAElFTkSuQmCC Cancel-Lock: sha1:XkEiKHPYXTydPLsc2ijmMdfxpZo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233115 Archived-At: I originally posted an Arithmetic range error using org-publish to gmane.emacs.orgmode. My original post is [[gnus:gmane.emacs.orgmode#87ef8jwzs5.fsf@yandex.com][here]]. It was suggested that I also report it to emacs-dev. The error occurs using org-mode from git and seems to effect emacs-26.1 but not emacs-27.0.50. With a very inelegant ECM below, I can reproduce the arithmetic range error. I have tested the ECM on machines running Debian 3.16.0-7-686-pae and Debian 4.9.0-8-686-pae, with the same results. ------ Begin ECM ------------- 1. emacs -Q 2. We need a directory for testing. This ECM uses ~/temp. 3. In the scratch buffer, evaluate the following: #+begin_src emacs-lisp (add-to-list 'load-path (expand-file-name "~/path/to/git/org-mode/lisp")) #+end_src #+begin_src emacs-lisp (setq org-publish-project-alist '(("org" :base-directory "~/temp/" :publishing-directory "~/temp" :publishing-function org-html-publish-to-html))) #+end_src 4. Create file ~/temp/test.org. 5. Enter some text (e.g. This is a test) in test.org and save file. 6. M-x org-publish-current-file . 7. A satisfactory ~/temp/test.html is produced. 8. emacs-26.1 gives 'org-publish-cache-ctime-of-src: Arithmetic range error: "floor", 1549541220.7500212' 9. emacs-27.0.50 gives no arithmetic range error. 10. Also no errors are produced if emacs-26.1 and emacs-27.0.50 use only their generic org-modes, namely 'release_9.1.9-65-g5e4542'. ------ End ECM ------------- The issue is apparently triggered by a backport of Emacs's 662bee7d7, specifically: * lisp/ox-publish.el (org-publish-cache-ctime-of-src): Prefer float-time to doing time arithmetic by hand. [...] @@ -1364,8 +1366,7 @@ (defun org-publish-cache-ctime-of-src (file) (expand-file-name (or (file-symlink-p file) file) (file-name-directory file))))) (if (not attr) (error "No such file: \"%s\"" file) - (+ (ash (car (nth 5 attr)) 16) - (cadr (nth 5 attr)))))) + (floor (float-time (file-attribute-modification-time attr)))))) It would appear that the code is sound, but if the above commit is reversed then the error disappears. -- Colin Baxter m43cap@yandex.com