all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "A.C." <achirvasub@gmail.com>
Cc: 37974@debbugs.gnu.org
Subject: bug#37974: eww produces "error in process filter: Specified time is not representable"
Date: Tue, 29 Oct 2019 22:52:02 +0100	[thread overview]
Message-ID: <871ruvz0cd.fsf@gnus.org> (raw)
In-Reply-To: <EA2E4420-0B85-4C98-9183-B2D3227937A9@gmail.com> (A. C.'s message of "Tue, 29 Oct 2019 10:06:28 -0400")

"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"

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)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  parent reply	other threads:[~2019-10-29 21:52 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 [this message]
2019-10-29 22:23             ` A.C.
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

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

  git send-email \
    --in-reply-to=871ruvz0cd.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=37974@debbugs.gnu.org \
    --cc=achirvasub@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.