On October 29, 2019 5:52:02 PM EDT, Lars Ingebrigtsen wrote: >"A.C." writes: > >>>In any case, Emacs 27 has bignum support, so this should hopefully >not >>>be a problem any more. Can you try the test case with the current >>>Emacs >>>trunk and see whether it's still present? >> >> That will be tough. This 32-bit machine overheats something fierce; I >> doubt I can even clone the git repo without it dying, let alone >> compile. > >Testing a bit more, the bug is present even on 64-bits systems. > >While this works: > >(format-time-string "%a %b %d %H:%M:%S %Y GMT" 9460800000000000 t) >=> "Wed Apr 08 00:00:00 299802787 GMT" > >(format-time-string "%a %b %d %H:%M:%S %Y GMT" 94608000000000000 t) > >errors out with > >"Specified time is not representable" Absolutely; I noted as much in the follow-up email to the one you cited above: While 32-bit systems are vulnerable to the "year-2038 problem" 64-bit ones have an issue with year 2147485548 = 1900 + 2**31 So you can only go up to Wed Dec 31 23:59:59 GMT 2147485547 meaning the highest it'll run without error is (format-time-string "%a %b %d %H:%M:%S %Y GMT" 67768036191676799 t) As soon as you try 67768036191676800 = 67768036191676799 + 1 you'll get the "Specified time is not representable" complaint. > >Test case: > >(url-cookie-handle-set-cookie "browser=68.133.6.220.1572324160979722; >path=/; max-age=946080000000000000; domain=.arxiv.org") > >The input is completely controlled by the server, of course, and bogus >data may appear in the cookie, and the URL library should protect >against this, so I've now made it ignore these errors in Emacs 27. >This >patch may also apply to the version of Emacs you're using; I haven't >checked. > >diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el >index 31fc3e7266..740a43fa16 100644 >--- a/lisp/url/url-cookie.el >+++ b/lisp/url/url-cookie.el >@@ -304,9 +304,10 @@ url-cookie-handle-set-cookie > (url-filename url-current-object)))) > (expires nil)) > (if (and max-age (string-match "\\`-?[0-9]+\\'" max-age)) >- (setq expires (format-time-string "%a %b %d %H:%M:%S %Y GMT" >- (time-add nil (read max-age)) >- t)) >+ (setq expires (ignore-errors >+ (format-time-string "%a %b %d %H:%M:%S %Y GMT" >+ (time-add nil (read max-age)) >+ t))) > (setq expires (cdr-safe (assoc-string "expires" args t)))) > (while (consp trusted) > (if (string-match (car trusted) current-url) -- Sent from my Android device with K-9 Mail. Please excuse my brevity.