From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/77468 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.gnus.general Subject: Re: Debugger entered--Lisp error: (overflow-error "13419098521433281274") Date: Wed, 02 Mar 2011 21:52:38 +0100 Message-ID: References: <87lj0x4k59.fsf@fastmail.fm> <87lj0x72ce.fsf@member.fsf.org> <87aahdmg51.fsf@lifelogs.com> <87oc5ti7js.fsf@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1299099188 18819 80.91.229.12 (2 Mar 2011 20:53:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Mar 2011 20:53:08 +0000 (UTC) Cc: Ted Zlatanov , ding@gnus.org To: Tassilo Horn Original-X-From: ding-owner+M25791@lists.math.uh.edu Wed Mar 02 21:53:00 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Put2Y-0008EU-RA for ding-account@gmane.org; Wed, 02 Mar 2011 21:52:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Put2M-0008JG-5V; Wed, 02 Mar 2011 14:52:46 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Put2K-0008Iu-2w for ding@lists.math.uh.edu; Wed, 02 Mar 2011 14:52:44 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Put2H-00057K-UB for ding@lists.math.uh.edu; Wed, 02 Mar 2011 14:52:43 -0600 Original-Received: from mail-out.m-online.net ([212.18.0.10]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Put2G-000504-FR for ding@gnus.org; Wed, 02 Mar 2011 21:52:40 +0100 Original-Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 62FCC188B593; Wed, 2 Mar 2011 21:52:39 +0100 (CET) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id AC8671C001AA; Wed, 2 Mar 2011 21:52:39 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id UCn2cWsua65U; Wed, 2 Mar 2011 21:52:39 +0100 (CET) Original-Received: from igel.home (ppp-93-104-159-224.dynamic.mnet-online.de [93.104.159.224]) by mail.mnet-online.de (Postfix) with ESMTP; Wed, 2 Mar 2011 21:52:38 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 501) id B75C0CA2A0; Wed, 2 Mar 2011 21:52:38 +0100 (CET) X-Yow: Sometime in 1993 NANCY SINATRA will lead a BLOODLESS COUP on GUAM!! In-Reply-To: <87oc5ti7js.fsf@member.fsf.org> (Tassilo Horn's message of "Wed, 02 Mar 2011 21:36:23 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.94 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:77468 Archived-At: Tassilo Horn writes: > Ted Zlatanov 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."