From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: handa@gnu.org (K. Handa) Newsgroups: gmane.emacs.bugs Subject: bug#18610: 24.4.50; Specific file causing emacs to segfault upon opening Date: Sun, 05 Oct 2014 17:59:45 +0900 Message-ID: <871tqmevsu.fsf@gnu.org> References: <87eguqbk5m.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412499676 29098 80.91.229.3 (5 Oct 2014 09:01:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Oct 2014 09:01:16 +0000 (UTC) Cc: dmantipov@yandex.ru, maden.ldm@gmail.com, 18610@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 05 11:01:09 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xahgi-0003IZ-8w for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Oct 2014 11:01:08 +0200 Original-Received: from localhost ([::1]:46705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xahgh-0002vQ-WD for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Oct 2014 05:01:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xahgf-0002vJ-Eh for bug-gnu-emacs@gnu.org; Sun, 05 Oct 2014 05:01:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xahgd-0006Ga-1n for bug-gnu-emacs@gnu.org; Sun, 05 Oct 2014 05:01:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xahgc-0006GN-VC for bug-gnu-emacs@gnu.org; Sun, 05 Oct 2014 05:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xahgc-0004UX-8E for bug-gnu-emacs@gnu.org; Sun, 05 Oct 2014 05:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: handa@gnu.org (K. Handa) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Oct 2014 09:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18610 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18610-submit@debbugs.gnu.org id=B18610.141249961417195 (code B ref 18610); Sun, 05 Oct 2014 09:01:02 +0000 Original-Received: (at 18610) by debbugs.gnu.org; 5 Oct 2014 09:00:14 +0000 Original-Received: from localhost ([127.0.0.1]:33447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xahfo-0004TG-H3 for submit@debbugs.gnu.org; Sun, 05 Oct 2014 05:00:13 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:45313) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xahfl-0004Sy-CW for 18610@debbugs.gnu.org; Sun, 05 Oct 2014 05:00:10 -0400 Original-Received: from fl1-122-134-99-48.iba.mesh.ad.jp ([122.134.99.48]:51176 helo=shatin) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Xahfk-0001Cj-B7; Sun, 05 Oct 2014 05:00:08 -0400 Original-Received: from handa by shatin with local (Exim 4.82) (envelope-from ) id 1XahfS-00068i-RH; Sun, 05 Oct 2014 17:59:51 +0900 In-Reply-To: <83a95dibtt.fsf@gnu.org> (message from Eli Zaretskii on Fri, 03 Oct 2014 15:20:46 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org 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 Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94153 Archived-At: In article <83a95dibtt.fsf@gnu.org>, Eli Zaretskii writes: > > The whole thing is really subtle: when detect_coding is called, it finds (1) and > > calls to detect_coding_iso_2022, which returns 1. Since this happens before > > detect_coding finds (2), this function assumes that the whole data is in one of > > 7-bit (?) ISO-2022 encoding. Thus, no conversion is performed, and decode_coding_gap > > inserts the data as is; this way we end up with 96 3B byte sequence in buffer text. > Indeed. But I don't think we can simply reject ISO-2022 here, because > the mere presence of bytes in [128..159] is not supposed to reject the > possibility of decoding that text by ISO-2022, see > latin-extra-code-table. > However, detect_coding_iso_2022 returns with the 'found' member of its > second argument having zero value, which I interpret as meaning that > it didn't really find any ISO-2022 sequences. So the simple patch > below fixes this for me. Kenichi, is this patch OK? No. Even if there's no special ISO-2022 escape sequence, we should not reject iso-2022 as a detected coding system. And, even if that detection was incorrect, the decoder should not produce an invalid byte sequence in a buffer/string which leads to Emacs crash. The bug is in detect_coding_iso_2022 which doesn't set CATEGORY_MASK_ISO_7_ELSE in coding->rejected in this case. Because of that, coding->head_ascii is incorrectly set. I've just installed a fix to trunk. Could you please try the latest version? --- Kenichi Handa handa@gnu.org