From mboxrd@z Thu Jan 1 00:00:00 1970 From: Colin Baxter Subject: Re: Arithmetic range error Date: Fri, 08 Feb 2019 08:54:14 +0000 Message-ID: <87o97mfyo9.fsf@yandex.com> References: <87ef8jwzs5.fsf@yandex.com> <874l9f68ok.fsf@kyleam.com> <87ftszwi0p.fsf@yandex.com> <87womb5net.fsf@nicolasgoaziou.fr> <871s4j56e9.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:38551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs1vT-0001cS-Aq for emacs-orgmode@gnu.org; Fri, 08 Feb 2019 03:54:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gs1vS-0004hG-CD for emacs-orgmode@gnu.org; Fri, 08 Feb 2019 03:54:23 -0500 Received: from forward104o.mail.yandex.net ([37.140.190.179]:46714) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gs1vR-0004Yx-HJ for emacs-orgmode@gnu.org; Fri, 08 Feb 2019 03:54:22 -0500 In-Reply-To: <871s4j56e9.fsf@kyleam.com> (Kyle Meyer's message of "Thu, 07 Feb 2019 22:02:54 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Kyle Meyer Cc: emacs-orgmode@gnu.org, Nicolas Goaziou >>>>> "Kyle" == Kyle Meyer writes: Kyle> Nicolas Goaziou writes: >> Colin Baxter writes: >> >>> I can now confirm that if the above commit is reversed then my >>> Arithmetic range error disappears. >>> >>> diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index >>> d9fc8d2..2144aa1 100644 --- a/lisp/ox-publish.el +++ >>> b/lisp/ox-publish.el @@ -1366,7 +1366,9 @@ does not exist." >>> (expand-file-name (or (file-symlink-p file) file) >>> (file-name-directory file))))) (if (not attr) (error "No such >>> file: \"%s\"" file) - (floor (float-time >>> (file-attribute-modification-time attr)))))) + (+ (ash (car (nth >>> 5 attr)) 16) + (cadr (nth 5 attr)))))) +;; (floor (float-time >>> (file-attribute-modification-time attr)))))) >> >> I think it is worth reporting it to Emacs devel list, because the >> commented code doesn't look wrong. Kyle> And in the report it'd be good to include some of the Kyle> information asked for elsewhere in this thread (full Kyle> backtrace, system details) as well as a recipe to reproduce. Kyle> I haven't had any luck triggering the issue, but that's Kyle> unsurprisingly given that the code looks correct and the Kyle> number reported in the error isn't extreme: Kyle> (floor 1549541220.7500212) ; => 1549541220 Kyle> (format-time-string "%Y-%m-%d %I:%M:%S" (seconds-to-time Kyle> 1549541220.7500212)) ; => "2019-02-07 07:07:00" With a very inelegant ECM below, I can reproduce the arithmetic range error in emacs-26.1 but not in the development emacs-27.0.50. I have tested the ECM on machines running Debian 3.16.0-7-686-pae and 4.9.0-8-686-pae, with the same results. 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'. 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'. I hope to post a report to emacs-dev later today. Best wishes, -- Colin Baxter m43cap@yandex.com