unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date
@ 2015-02-07  4:49 Matthew Carter
  2015-02-07  8:17 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Matthew Carter @ 2015-02-07  4:49 UTC (permalink / raw)
  To: 19798

When running eww-mode and visiting a site using a cookie expiration date
set to "Mon, 06 Mar 2130 20:55:03 GMT" eww-mode will fail to load
subsequent URLs on the domain (in this case http://ahungry.com) and
instead simply print the following message in the echo area:

error in process sentinel: Invalid date: Mon, 06 Mar 2130 20:55:03 GMT

According to Wikipedia and other sources I can find online regarding the
HTTP cookie expires field, this date format is valid
(https://en.wikipedia.org/wiki/HTTP_cookie) and should not be causing 
an error in the process sentinel (and even if some site sent an invalid
date, I don't think it should halt further site interaction, but either
ignore the invalid date, or ignore the cookie).

Steps to reproduce under emacs -Q:

eww
ahungry.com
RET
TAB
TAB
RET

You'll then see the error pop up (instead of visiting the Blog link on
the site).

-- 
Matthew Carter (m@ahungry.com)
http://ahungry.com





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19799: Tangentally related to eww-mode Invalid Date bug just filed
@ 2015-02-07  5:15 Matthew Carter
  2015-02-08 19:28 ` Paul Eggert
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew Carter @ 2015-02-07  5:15 UTC (permalink / raw)
  To: 19799

Excuse the new thread (just signed up to bug-gnu-emacs list, whereas I
filed the original bug via the report function).

I've pinpointed the eww-mode bug to an issue with #'date-to-time in
time-date.el.

It appears to be a manifestation of the Year 2038 problem and caused by
the fact that the cookie being sent has an expiration date beyond year
2038.

As it turns out, I am unable to reproduce the issue on a 64-bit machine
(it only happens on my 32-bit ones).

Would it be better to rework #'date-to-time to handle future dates in a
more graceful manner on 32-bit machines, or to have eww-mode ignore
triggers that cause it to parse dates it cannot handle?

-- 
Matthew Carter (m@ahungry.com)
http://ahungry.com





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date
  2015-02-07  4:49 bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date Matthew Carter
@ 2015-02-07  8:17 ` Eli Zaretskii
  2015-02-07 13:46 ` Matthew Carter
  2015-02-08 19:30 ` Paul Eggert
  2 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2015-02-07  8:17 UTC (permalink / raw)
  To: Matthew Carter; +Cc: 19798

> From: Matthew Carter <m@ahungry.com>
> Date: Fri, 06 Feb 2015 23:49:18 -0500
> 
> When running eww-mode and visiting a site using a cookie expiration date
> set to "Mon, 06 Mar 2130 20:55:03 GMT" eww-mode will fail to load
> subsequent URLs on the domain (in this case http://ahungry.com) and
> instead simply print the following message in the echo area:
> 
> error in process sentinel: Invalid date: Mon, 06 Mar 2130 20:55:03 GMT

Is your Emacs a 32-bit executable?

More generally, please use "M-x report-emacs-bug RET" to report all
the details about your Emacs and the underlying OS features.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date
  2015-02-07  4:49 bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date Matthew Carter
  2015-02-07  8:17 ` Eli Zaretskii
@ 2015-02-07 13:46 ` Matthew Carter
  2015-02-08 19:30 ` Paul Eggert
  2 siblings, 0 replies; 12+ messages in thread
From: Matthew Carter @ 2015-02-07 13:46 UTC (permalink / raw)
  To: Eli Zaretskii, Matthew Carter; +Cc: 19798

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

It is and I did, but the emacs with the issue is not configured for gnus/mail yet so I was reporting from my 64bit emacs instead .  After seeing it includes by default a lot of personal information such as the last few things I typed and my home paths I just deleted the info it auto added as it was not relevant to the bug.

It seems to be a year 2038 bug in the encode - time function, but eww should gracefully handle vs just failing when it happens.

<div>-------- Original message --------</div><div>From: Eli Zaretskii <eliz@gnu.org> </div><div>Date:02/07/2015  3:17 AM  (GMT-05:00) </div><div>To: Matthew Carter <m@ahungry.com> </div><div>Cc: 19798@debbugs.gnu.org </div><div>Subject: Re: bug#19798: 24.4;	eww-mode error in process sentinel 'Invalid date' when receiving a	valid date </div><div>
</div>> From: Matthew Carter <m@ahungry.com>
> Date: Fri, 06 Feb 2015 23:49:18 -0500
> 
> When running eww-mode and visiting a site using a cookie expiration date
> set to "Mon, 06 Mar 2130 20:55:03 GMT" eww-mode will fail to load
> subsequent URLs on the domain (in this case http://ahungry.com) and
> instead simply print the following message in the echo area:
> 
> error in process sentinel: Invalid date: Mon, 06 Mar 2130 20:55:03 GMT

Is your Emacs a 32-bit executable?

More generally, please use "M-x report-emacs-bug RET" to report all
the details about your Emacs and the underlying OS features.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19799: Tangentally related to eww-mode Invalid Date bug just filed
  2015-02-07  5:15 bug#19799: Tangentally related to eww-mode Invalid Date bug just filed Matthew Carter
@ 2015-02-08 19:28 ` Paul Eggert
  2015-02-08 20:25   ` Matthew Carter
  0 siblings, 1 reply; 12+ messages in thread
From: Paul Eggert @ 2015-02-08 19:28 UTC (permalink / raw)
  To: Matthew Carter; +Cc: 19799

> Would it be better to rework #'date-to-time to handle future dates in a
> more graceful manner on 32-bit machines, or to have eww-mode ignore
> triggers that cause it to parse dates it cannot handle?

There is a variant of date-to-time that refuses to throw an error on 
out-of-range dates, namely safe-date-to-time.  But I'm still puzzled as to why 
you're getting this error.  date-to-time is supposed to throw a "Specified time 
is not representable" for out-of-range dates, but for you it's throwing some 
other error.  Can you debug why that is happening?

What happens when you run the following in your *scratch* buffer?

(date-to-time "Mon, 06 Mar 2130 20:55:03 GMT")

On my platform (Fedora 21 x86) if I type C-j after that, the debugger is entered 
with this backtrace:

Debugger entered--Lisp error: (error . "Specified time is not representable")
   signal(error "Specified time is not representable")
   apply(signal (error "Specified time is not representable"))
   (if (equal err overflow-error) (apply (quote signal) err) (condition-case err$
   (let ((overflow-error (quote (error "Specified time is not representable"))))$
   (condition-case err (apply (quote encode-time) (parse-time-string date)) (err$
   date-to-time("Mon, 06 Mar 2130 20:55:03 GMT")
   ...

What happens on your platform?

Also, what is your platform?  What does (emacs-version) return, for starters?






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date
  2015-02-07  4:49 bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date Matthew Carter
  2015-02-07  8:17 ` Eli Zaretskii
  2015-02-07 13:46 ` Matthew Carter
@ 2015-02-08 19:30 ` Paul Eggert
  2015-02-08 20:29   ` Matthew Carter
  2 siblings, 1 reply; 12+ messages in thread
From: Paul Eggert @ 2015-02-08 19:30 UTC (permalink / raw)
  To: Matthew Carter; +Cc: 19798

Can you get a Lisp backtrace as of when the error occurs?





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19799: Tangentally related to eww-mode Invalid Date bug just filed
  2015-02-08 19:28 ` Paul Eggert
@ 2015-02-08 20:25   ` Matthew Carter
  2015-02-09  2:45     ` bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date Paul Eggert
  2015-02-09  2:50     ` bug#19799: Tangentally related to eww-mode Invalid Date bug just filed Paul Eggert
  0 siblings, 2 replies; 12+ messages in thread
From: Matthew Carter @ 2015-02-08 20:25 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 19799

Paul Eggert <eggert@cs.ucla.edu> writes:

>> Would it be better to rework #'date-to-time to handle future dates in a
>> more graceful manner on 32-bit machines, or to have eww-mode ignore
>> triggers that cause it to parse dates it cannot handle?
>
> There is a variant of date-to-time that refuses to throw an error on
> out-of-range dates, namely safe-date-to-time.  But I'm still puzzled
> as to why you're getting this error.  date-to-time is supposed to
> throw a "Specified time is not representable" for out-of-range dates,
> but for you it's throwing some other error.  Can you debug why that is
> happening?
>
> What happens when you run the following in your *scratch* buffer?
>
> (date-to-time "Mon, 06 Mar 2130 20:55:03 GMT")
>
> On my platform (Fedora 21 x86) if I type C-j after that, the debugger
> is entered with this backtrace:
>
> Debugger entered--Lisp error: (error . "Specified time is not representable")
>   signal(error "Specified time is not representable")
>   apply(signal (error "Specified time is not representable"))
>   (if (equal err overflow-error) (apply (quote signal) err) (condition-case err$
>   (let ((overflow-error (quote (error "Specified time is not representable"))))$
>   (condition-case err (apply (quote encode-time) (parse-time-string date)) (err$
>   date-to-time("Mon, 06 Mar 2130 20:55:03 GMT")
>   ...
>
> What happens on your platform?
>
> Also, what is your platform?  What does (emacs-version) return, for starters?
>

This is on an i686 machine - the eval returns:

Debugger entered--Lisp error: (error "Invalid date: Mon, 06 Mar 2130 20:55:03 GMT")
  signal(error ("Invalid date: Mon, 06 Mar 2130 20:55:03 GMT"))
  error("Invalid date: %s" "Mon, 06 Mar 2130 20:55:03 GMT")
  byte-code("\300\301\302\217\207" [nil (byte-code "\301\302\303\304^H!!\"\207" [date apply encode-time parse-time-string time$
  date-to-time("Mon, 06 Mar 2130 20:55:03 GMT")
  eval((date-to-time "Mon, 06 Mar 2130 20:55:03 GMT") nil)
  eval-last-sexp-1(t)
  eval-last-sexp(t)
  eval-print-last-sexp(nil)
  call-interactively(eval-print-last-sexp nil nil)
  command-execute(eval-print-last-sexp)

The version is:

GNU Emacs 24.4.1 (i686-pc-linux-gnu, GTK+ Version 3.14.7) of 2015-01-17 on bisson

Anything up to 2038 will work without issue.  I had read OpenBSD fixed
the 2038 date issue using 'long long int' instead of 'time_t' for dates
in the codebase on 32 bit machines.

I think eww-mode should not fail to load subsequent pages though, even
if a cookie date is bad (bad cookies should not halt further page
requests), so maybe eww-mode just needs to catch the thrown error?

-- 
Matthew Carter (m@ahungry.com)
http://ahungry.com





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date
  2015-02-08 19:30 ` Paul Eggert
@ 2015-02-08 20:29   ` Matthew Carter
  0 siblings, 0 replies; 12+ messages in thread
From: Matthew Carter @ 2015-02-08 20:29 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 19798

Paul Eggert <eggert@cs.ucla.edu> writes:

> Can you get a Lisp backtrace as of when the error occurs?
>
>
>

The *Backtrace* buffer remains empty, but this is what gets printed to
*Messages* when you do the following:

1) M-x eww
2) ahungry.com
3) TAB TAB (you'll now be on Blog link)
4) RET
5) Failure to load next page


*Messages* buffer content:

Contacting host: ahungry.com:80
http://ahungry.com/
http://ahungry.com/blog
Contacting host: ahungry.com:80
byte-code: Invalid date: Wed, 08 Mar 2130 12:48:28 GMT
Back to top level.
Contacting host: ahungry.com:80
error in process sentinel: byte-code: Invalid date: Wed, 08 Mar 2130 12:48:28 GMT
error in process sentinel: Invalid date: Wed, 08 Mar 2130 12:48:28 GMT

-- 
Matthew Carter (m@ahungry.com)
http://ahungry.com





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date
  2015-02-08 20:25   ` Matthew Carter
@ 2015-02-09  2:45     ` Paul Eggert
  2015-02-09  2:50     ` bug#19799: Tangentally related to eww-mode Invalid Date bug just filed Paul Eggert
  1 sibling, 0 replies; 12+ messages in thread
From: Paul Eggert @ 2015-02-09  2:45 UTC (permalink / raw)
  To: Matthew Carter; +Cc: 19798

I reproduced this bug on Fedora 21 i686.  I looked at the current master and 
fixed some relevant issues, in commit fd6f7d1449c8496ab5c019d2aad7ca5e2980713a 
dated today.  I then attempted to reproduce the bug but failed, so it appears 
that the bug is fixed now in the current master (either by the recent fixes, or 
by earlier fixes in the master).  Please give it a try.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19799: Tangentally related to eww-mode Invalid Date bug just filed
  2015-02-08 20:25   ` Matthew Carter
  2015-02-09  2:45     ` bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date Paul Eggert
@ 2015-02-09  2:50     ` Paul Eggert
  2015-02-09  3:14       ` Matthew Carter
  1 sibling, 1 reply; 12+ messages in thread
From: Paul Eggert @ 2015-02-09  2:50 UTC (permalink / raw)
  To: Matthew Carter; +Cc: 19799-done

OK, I've fixed the "Invalid date:" bug in master commit 
fd6f7d1449c8496ab5c019d2aad7ca5e2980713a dated today.  This fixes the problem 
with date-to-time on 32-bit hosts, since it now throws the correct exception 
rather than the incorrect one, so I'm closing this bug report.  I'm leaving 
Bug#19798 open for now, until you can verify that the original eww issue is 
indeed fixed on the master.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19799: Tangentally related to eww-mode Invalid Date bug just filed
  2015-02-09  2:50     ` bug#19799: Tangentally related to eww-mode Invalid Date bug just filed Paul Eggert
@ 2015-02-09  3:14       ` Matthew Carter
  2015-02-09  6:29         ` bug#19798: " Paul Eggert
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew Carter @ 2015-02-09  3:14 UTC (permalink / raw)
  To: 19799; +Cc: eggert

Paul Eggert <eggert@cs.ucla.edu> writes:

> OK, I've fixed the "Invalid date:" bug in master commit
> fd6f7d1449c8496ab5c019d2aad7ca5e2980713a dated today.  This fixes the
> problem with date-to-time on 32-bit hosts, since it now throws the
> correct exception rather than the incorrect one, so I'm closing this
> bug report.  I'm leaving Bug#19798 open for now, until you can verify
> that the original eww issue is indeed fixed on the master.
>
>
>

The issue is fixed, no more failure to load subsequent pages when an
overflowed cookie date is encountered.

Thanks!

-- 
Matthew Carter (m@ahungry.com)
http://ahungry.com





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#19798: bug#19799: Tangentally related to eww-mode Invalid Date bug just filed
  2015-02-09  3:14       ` Matthew Carter
@ 2015-02-09  6:29         ` Paul Eggert
  0 siblings, 0 replies; 12+ messages in thread
From: Paul Eggert @ 2015-02-09  6:29 UTC (permalink / raw)
  To: Matthew Carter; +Cc: 19799, 19798-done

Matthew Carter wrote:

> The issue is fixed, no more failure to load subsequent pages when an
> overflowed cookie date is encountered.

Thanks for checking, and so I'm closing Bug#19798 too.





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-02-09  6:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-07  5:15 bug#19799: Tangentally related to eww-mode Invalid Date bug just filed Matthew Carter
2015-02-08 19:28 ` Paul Eggert
2015-02-08 20:25   ` Matthew Carter
2015-02-09  2:45     ` bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date Paul Eggert
2015-02-09  2:50     ` bug#19799: Tangentally related to eww-mode Invalid Date bug just filed Paul Eggert
2015-02-09  3:14       ` Matthew Carter
2015-02-09  6:29         ` bug#19798: " Paul Eggert
  -- strict thread matches above, loose matches on Subject: below --
2015-02-07  4:49 bug#19798: 24.4; eww-mode error in process sentinel 'Invalid date' when receiving a valid date Matthew Carter
2015-02-07  8:17 ` Eli Zaretskii
2015-02-07 13:46 ` Matthew Carter
2015-02-08 19:30 ` Paul Eggert
2015-02-08 20:29   ` Matthew Carter

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).