Gnus development mailing list
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: Ted Zlatanov <tzz@lifelogs.com>,  ding@gnus.org
Subject: Re: Debugger entered--Lisp error: (overflow-error "13419098521433281274")
Date: Wed, 02 Mar 2011 21:52:38 +0100	[thread overview]
Message-ID: <m28vwx4549.fsf@igel.home> (raw)
In-Reply-To: <87oc5ti7js.fsf@member.fsf.org> (Tassilo Horn's message of "Wed, 02 Mar 2011 21:36:23 +0100")

Tassilo Horn <tassilo@member.fsf.org> writes:

> Ted Zlatanov <tzz@lifelogs.com> writes:
>
> Hi Ted,
>
>> TH> Here's the offending code:
>> TH> 	  (while (re-search-forward "^\\* [0-9]+ FETCH " start t)
>> TH> 	    (setq elems (read (current-buffer)))
>> TH> 	    (push (cons (cadr (memq 'UID elems))
>> TH> 			(cadr (memq 'FLAGS elems)))
>> TH> 		  articles))
>>
>> TH> Of course, it is convenient to `read' the complete list in lines like
>>
>> TH>   * 2971 FETCH (FLAGS (%Recent) UID 12509 MODSEQ (13419098521433281274))
>>
>> TH> but it fails for large numbers.  And if the RFC says those are 64bit
>> TH> unsigned ints, well, then Gnus has to handle those.
>>
>> Gnus has no way to do it when Emacs can't.  The calc package has some
>> facilities for big numbers but yeah, (read) will not DTRT with input
>> like that.  I've asked for it on emacs-devel.
>>
>> To fix it now, I would replace such large numbers with a truncated
>> version, which can be done safely with a regex before the reader sees
>> the input.  But I'll let Lars decide, he knows that code best.
>
> But that huge number is not used by gnus, anyway.  It is `read' but only
> the UID and FLAGS values are saved.  So IMHO, the proper fix is to put a
> condition-case around the `read' that picks the UID and FLAGS with
> string-matching if an overflow-error occurs.

That won't work since you won't be able to read the rest either (since
it is read as a single sexp).  A possible fix would be to insert a space
into the middle of any number sequence that is longer than 9 digits.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



  reply	other threads:[~2011-03-02 20:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 15:28 Tassilo Horn
2011-03-02 17:52 ` Tassilo Horn
2011-03-02 19:00 ` Andreas Schwab
2011-03-02 19:24   ` Tassilo Horn
2011-03-02 20:17     ` Ted Zlatanov
2011-03-02 20:36       ` Tassilo Horn
2011-03-02 20:52         ` Andreas Schwab [this message]
2011-03-02 21:02           ` Tassilo Horn
2011-03-02 20:56         ` Ted Zlatanov
2011-03-03  8:11           ` Tassilo Horn
2011-03-04 14:59             ` Ted Zlatanov
2011-03-05 10:52         ` Lars Magne Ingebrigtsen
2011-03-05 10:55 ` Lars Magne Ingebrigtsen
2011-03-07 17:29   ` Ted Zlatanov
2011-03-15 16:50     ` Lars Magne Ingebrigtsen

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=m28vwx4549.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=ding@gnus.org \
    --cc=tassilo@member.fsf.org \
    --cc=tzz@lifelogs.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.
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 NNTP newsgroup(s).