unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "A.C." <achirvasub@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 37974@debbugs.gnu.org
Subject: bug#37974: eww produces "error in process filter: Specified time is not representable"
Date: Tue, 29 Oct 2019 18:23:04 -0400	[thread overview]
Message-ID: <F5EBF259-BDFC-403B-8479-F2530E482F14@gmail.com> (raw)
In-Reply-To: <871ruvz0cd.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 2685 bytes --]



On October 29, 2019 5:52:02 PM EDT, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>"A.C." <achirvasub@gmail.com> 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.

[-- Attachment #2: Type: text/html, Size: 3071 bytes --]

  reply	other threads:[~2019-10-29 22:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29  0:32 bug#37974: eww produces "error in process filter: Specified time is not representable" Stuart Little
2019-10-29  4:51 ` Stuart Little
2019-10-29 10:25   ` Stuart Little
2019-10-29 12:05     ` A.C.
2019-10-29 12:47       ` Lars Ingebrigtsen
2019-10-29 14:06         ` A.C.
2019-10-29 14:41           ` A.C.
2019-10-29 21:52           ` Lars Ingebrigtsen
2019-10-29 22:23             ` A.C. [this message]
2019-10-30 10:19               ` Colin Baxter
2019-10-30 11:01                 ` Lars Ingebrigtsen
2019-10-31 18:50                   ` A.C.
2019-11-01 13:46                     ` Lars Ingebrigtsen
2019-11-01  8:05 ` Paul Eggert
2019-11-01 23:22   ` Paul Eggert
2019-11-02  7:34     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F5EBF259-BDFC-403B-8479-F2530E482F14@gmail.com \
    --to=achirvasub@gmail.com \
    --cc=37974@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).