From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Crash in titdic-convert with DOS line ends Date: Tue, 05 Feb 2008 13:19:18 +0900 Message-ID: References: <47A3D99B.5020700@gnu.org> <47A59FD7.5010004@gmail.com> <47A64A34.5020308@gnu.org> <47A75237.8020801@gmail.com> <47A7A032.4050608@gnu.org> <47A7BC76.4010703@gnu.org> 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 1202185243 30218 80.91.229.12 (5 Feb 2008 04:20:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Feb 2008 04:20:43 +0000 (UTC) Cc: schwab@suse.de, emacs-devel@gnu.org To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 05 05:21:05 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JMFIn-0005gY-CI for ged-emacs-devel@m.gmane.org; Tue, 05 Feb 2008 05:20:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMFIL-0002Rq-1j for ged-emacs-devel@m.gmane.org; Mon, 04 Feb 2008 23:20:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMFIG-0002R8-LB for emacs-devel@gnu.org; Mon, 04 Feb 2008 23:20:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMFIE-0002QT-VZ for emacs-devel@gnu.org; Mon, 04 Feb 2008 23:20:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMFIE-0002QP-Nb for emacs-devel@gnu.org; Mon, 04 Feb 2008 23:20:22 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JMFI6-00087j-JQ; Mon, 04 Feb 2008 23:20:19 -0500 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id m154JMNW004578; Tue, 5 Feb 2008 13:19:22 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id m154JL2D022634; Tue, 5 Feb 2008 13:19:22 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp2.aist.go.jp with ESMTP id m154JIoa019191; Tue, 5 Feb 2008 13:19:18 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.68) (envelope-from ) id 1JMFHC-0006AC-OC; Tue, 05 Feb 2008 13:19:18 +0900 In-reply-to: <47A7BC76.4010703@gnu.org> (message from Jason Rumney on Tue, 05 Feb 2008 01:31:34 +0000) 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-kernel: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:88228 Archived-At: In article <47A7BC76.4010703@gnu.org>, Jason Rumney writes: > Now that I am debugging this, ETZY.tit does not crash Emacs, while > 4Corner.tit does. It appears to be a problem with any DOS line ends in a > Big5 file that is inserted into a unibyte buffer, but some other > condition needs to be present to trigger the crash. But the following > shows that there is definitely a problem with DOS line ends in unibyte > buffers > ;; Evaluate the following 2 forms in *scratch*. The first converts a > .tit file to DOS line ends, the second reads > ;; it into a unibyte buffer as raw-text in the same way that > titdic-convert does. > (with-temp-buffer > (let ((coding-system-for-read 'cn-big5) > (coding-system-for-write 'cn-big5-dos)) > (insert-file-contents (expand-file-name "CXTERM-DIC/4Corner.tit" > (file-name-directory (locate-library "leim-list")))) > (write-file "/tmp/test.tit"))) > (set-buffer-multibyte nil) > (let ((coding-system-for-read 'raw-text)) > (insert-file-contents "/tmp/test.tit")) > ;; If Emacs does not crash, note the ^M on the ends of some lines. > When Emacs crashes, it always happens in decode_eol (several levels deep > from insert-file-contents), on this line: > if (*p == '\r' && p[1] == '\n') Thank you for tracking down the problem to this point. I've just installed a fix. --- Kenichi Handa handa@ni.aist.go.jp