From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: Crash calling md5 for a list of buffers Date: Wed, 21 Jan 2004 10:20:41 -0700 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <400EB4E9.5020408@yahoo.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1074705738 16397 80.91.224.253 (21 Jan 2004 17:22:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2004 17:22:18 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 21 18:22:07 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AjM3L-0007KQ-00 for ; Wed, 21 Jan 2004 18:22:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AjM2w-0001AH-ED for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Jan 2004 12:21:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AjM2r-000173-SK for bug-gnu-emacs@prep.ai.mit.edu; Wed, 21 Jan 2004 12:21:37 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AjM2H-0000yB-MP for bug-gnu-emacs@prep.ai.mit.edu; Wed, 21 Jan 2004 12:21:33 -0500 Original-Received: from [132.239.1.54] (helo=mailbox2.ucsd.edu) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AjM29-0000sq-QW for bug-gnu-emacs@prep.ai.mit.edu; Wed, 21 Jan 2004 12:20:53 -0500 Original-Received: from mail.fu-berlin.de (mail.fu-berlin.de [160.45.11.165]) by mailbox2.ucsd.edu (8.12.10/8.12.9) with ESMTP id i0LHKlN4011929 for ; Wed, 21 Jan 2004 09:20:48 -0800 (PST) Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Wed, 21 Jan 2004 18:20:47 +0100 (MET) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Wed, 21 Jan 2004 18:20:47 +0100 (MET) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 78 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: news.uni-berlin.de 1074705645 20283316 170.207.51.80 ([82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-Spamscanner: mailbox2.ucsd.edu (v1.4 Dec 3 2003 15:07:19, 1.4/5.0 2.60) X-MailScanner: PASSED (v1.2.8 94635 i0LHKlN4011929 mailbox2.ucsd.edu) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6675 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6675 Dmitry Antipov wrote: > Kevin Rodgers wrote: > >>> I cannot reproduce that on GNU Emacs 21.3.1 (i386-pc-solaris2.7, X >>> toolkit) of 2003-04-24 on briard. If I go to the emacs-21.3/src >>> directory, start Emacs as `./emacs-21.3.1 -q --no-site-file *.c', >>> then type `M-: (mapcar 'md5 (buffer-list)) RET', I get the following >>> *Backtrace*: >>> >>> Debugger entered--Lisp error: (args-out-of-range 1 459097) >>> find-coding-systems-region-internal(1 459097) >>> find-coding-systems-region(1 459097) >>> select-safe-coding-system(1 459097 undecided-unix) >>> md5(#) >> >> >> Apparently that's because the xdisp.c buffer only has 459096 characters. >> Whether I visit it with find-file or find-file-literally, `M->' followed >> by `C-x =' reports "point=459097 of 459096 (100%) column 0". > > > Try to eval (mapcar '(lambda (b) (md5 b nil nil 'raw-text)) (buffer-list)). > (mapcar 'md5 (buffer-list)) doesn't work for all buffers (really I don't > understand why - probably the coding system determined automagically is > not always valid for Fmd5). OK, then I get the same crash that you reported. The interesting thing is that both the crash and the Lisp error occur while processing xdisp.c. There is something screwy with that file that causes Emacs to think it has 1 more character (459097) than it really does (459096). If I kill that buffer before mapping md5 over buffer-list, neither the crash nor the Lisp error occur. Running emacs with --unibyte didn't prevent the Lisp error or the crash on xdisp.c. I'm confused because that file doesn't contain any odd characters, just printable ASCII chars, newline (^J), tab (^I), and formfeed (^L). There must be something wrong in the code in fns.c:Fmd5() that computes and checks the buffer beginning and end when its run with object set to the xdisp.c buffer, because either the subsequent call to select-safe-coding-system (via Vselect_safe_coding_system_function) or make_buffer_string is passed an end argument that is 1 larger than the buffer size (which precipitates the Lisp error or the crash, respectively). Can anyone see what's wrong here? CHECK_BUFFER (object, 0); bp = XBUFFER (object); if (NILP (start)) b = BUF_BEGV (bp); else { CHECK_NUMBER_COERCE_MARKER (start, 0); b = XINT (start); } if (NILP (end)) e = BUF_ZV (bp); else { CHECK_NUMBER_COERCE_MARKER (end, 1); e = XINT (end); } if (b > e) temp = b, b = e, e = temp; if (!(BUF_BEGV (bp) <= b && e <= BUF_ZV (bp))) args_out_of_range (start, end); -- Kevin Rodgers