From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#870: Repeatable instance of bug#870 Date: Wed, 07 Jan 2009 10:07:02 +0900 Message-ID: References: <4961E7F7.2000509@gnu.org> Reply-To: Kenichi Handa , 870@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1231291422 3518 80.91.229.12 (7 Jan 2009 01:23:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2009 01:23:42 +0000 (UTC) Cc: lekktu@gmail.com, 870@emacsbugs.donarmstrong.com, emacs-devel@gnu.org To: Jason Rumney Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 07 02:24:53 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LKNAB-0004Dm-7h for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Jan 2009 02:24:51 +0100 Original-Received: from localhost ([127.0.0.1]:44436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKN8v-0006yR-6a for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Jan 2009 20:23:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKN8r-0006y7-CL for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 20:23:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKN8o-0006xo-SP for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 20:23:28 -0500 Original-Received: from [199.232.76.173] (port=45167 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKN8o-0006xh-Kj for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 20:23:26 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:44735) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LKN8o-00078J-4d for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2009 20:23:26 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n071NOJT009171; Tue, 6 Jan 2009 17:23:24 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n071F4sm006944; Tue, 6 Jan 2009 17:15:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kenichi Handa Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com Resent-Date: Wed, 07 Jan 2009 01:15:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 870 X-Emacs-PR-Package: emacs,w32 X-Emacs-PR-Keywords: Original-Received: via spool by 870-submit@emacsbugs.donarmstrong.com id=B870.12312904285563 (code B ref 870); Wed, 07 Jan 2009 01:15:04 +0000 Original-Received: (at 870) by emacsbugs.donarmstrong.com; 7 Jan 2009 01:07:08 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx1.aist.go.jp (mx1.aist.go.jp [150.29.246.133]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n07174a2005557 for <870@emacsbugs.donarmstrong.com>; Tue, 6 Jan 2009 17:07:05 -0800 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n07173rP009216; Wed, 7 Jan 2009 10:07:03 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n07172SV027946; Wed, 7 Jan 2009 10:07:02 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp1.aist.go.jp with ESMTP id n071721c011262; Wed, 7 Jan 2009 10:07:02 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1LKMsw-0005wG-G6; Wed, 07 Jan 2009 10:07:02 +0900 In-reply-to: <4961E7F7.2000509@gnu.org> (message from Jason Rumney on Mon, 05 Jan 2009 18:59:03 +0800) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 06 Jan 2009 20:23:28 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:23853 Archived-At: In article <4961E7F7.2000509@gnu.org>, Jason Rumney writes: > Juanma Barranquero wrote: > > emacs -Q --eval "(desktop-save-mode 1)" ChangeLog.870 > > > I can also reproduce the bug with C-x RET r utf-8-dos after visiting the > file normally. I can reproduce it by that recipe. > It appears that there is a bug in all the decode_coding_* functions when > a CR lies on a CHARBUF_SIZE (0x4000) boundary with a matching LF on the > other side of the boundary. > They all do something like: > if (eol_crlf && c1 == '\r') > ONE_MORE_BYTE (byte_after_cr); > but ONE_MORE_BYTE will abort the decode if it reaches the end of the > buffer, leaving the CR in limbo between having been read and being added > to the buffer. Then on decoding the subsequent block, the initial LF > does not trip the normal CRLF decoding, so it is put into the buffer. ??? decode_coding_* gets bytes from coding->source and produces characters in CHARBUF. So, I think the above analysis is not correct. As normal visiting of ChangeLog.870 doesn't have the problem but revisiting it causes the problem, I think the bug is in Finsert_file_contents; perhaps in the handling of REPLACE. I'll have a look at it. --- Kenichi Handa handa@m17n.org