From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17011: 24.3.50; Random Emacs crash when opening image/pdf files from magit. Date: Wed, 26 Mar 2014 17:19:36 +0200 Message-ID: <83ha6lyol3.fsf@gnu.org> References: <874n314b87.fsf@sealion.lowtem.hokudai.ac.jp> <533268CE.9020908@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1395847210 6556 80.91.229.3 (26 Mar 2014 15:20:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Mar 2014 15:20:10 +0000 (UTC) Cc: hi@yagnesh.org, 17011@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 26 16:20:20 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 1WSpcn-0001LE-UG for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Mar 2014 16:20:18 +0100 Original-Received: from localhost ([::1]:48649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSpcn-0006wf-DL for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Mar 2014 11:20:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSpce-0006RC-PE for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 11:20:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSpcZ-0001we-KX for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 11:20:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSpcZ-0001wD-Gr for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 11:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WSpcY-0007xB-71 for bug-gnu-emacs@gnu.org; Wed, 26 Mar 2014 11:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Mar 2014 15:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17011 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo patch Original-Received: via spool by 17011-submit@debbugs.gnu.org id=B17011.139584718430533 (code B ref 17011); Wed, 26 Mar 2014 15:20:02 +0000 Original-Received: (at 17011) by debbugs.gnu.org; 26 Mar 2014 15:19:44 +0000 Original-Received: from localhost ([127.0.0.1]:51057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WSpcG-0007wN-8k for submit@debbugs.gnu.org; Wed, 26 Mar 2014 11:19:44 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:41683) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WSpcE-0007wE-2v for 17011@debbugs.gnu.org; Wed, 26 Mar 2014 11:19:43 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N3100M00UG4BZ00@mtaout28.012.net.il> for 17011@debbugs.gnu.org; Wed, 26 Mar 2014 17:19:26 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N3100GOTUKE7V60@mtaout28.012.net.il>; Wed, 26 Mar 2014 17:19:26 +0200 (IST) In-reply-to: <533268CE.9020908@cs.ucla.edu> X-012-Sender: halo1@inter.net.il 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:87403 Archived-At: > Date: Tue, 25 Mar 2014 22:42:38 -0700 > From: Paul Eggert > Cc: 17011@debbugs.gnu.org > > Thanks, with that backtrace I reproduced the core dump as follows: > > Build emacs with -DENABLE_CHECKING in CFLAGS. > ./emacs -Q > M-x find-file-literally RET somefile RET > M-x set-var RET case-fold-search RET t RET > M-: (char-equal 270 300) RET > > I installed a patch as emacs-24 bzr 116863, which worked for me; please > give it a try. > > http://bzr.savannah.gnu.org/lh/emacs/emacs-24/revision/116863 That's a backward-incompatible change: it changes behavior for those eight-bit bytes that are now interpreted as Latin letters. I don't think we should make incompatible changes on the release branch (or at all) in this case. I suggest the following compatible change (the diffs are relative to the emacs-24 sources before r116833): --- src/editfns.c~0 2014-01-26 07:13:31 +0200 +++ src/editfns.c 2014-03-26 10:14:31 +0200 @@ -4378,16 +4378,19 @@ Case is ignored if `case-fold-search' is return Qnil; i1 = XFASTINT (c1); - if (NILP (BVAR (current_buffer, enable_multibyte_characters)) - && ! ASCII_CHAR_P (i1)) - { - MAKE_CHAR_MULTIBYTE (i1); - } i2 = XFASTINT (c2); - if (NILP (BVAR (current_buffer, enable_multibyte_characters)) - && ! ASCII_CHAR_P (i2)) + if (NILP (BVAR (current_buffer, enable_multibyte_characters))) { - MAKE_CHAR_MULTIBYTE (i2); + /* It should still be possible to compare multibyte characters + even though the current buffer is unibyte (see bug#17011). + This causes dilemma wrt characters between 128 and 255 -- + they could be either eight-bit raw bytes or Latin-1 + characters. We resolve this dilemma here in favor of + eight-bit bytes, since we are in a unibyte buffer. */ + if (! ASCII_CHAR_P (i1) && i1 < 0x0100) + MAKE_CHAR_MULTIBYTE (i1); + if (! ASCII_CHAR_P (i2) && i2 < 0x0100) + MAKE_CHAR_MULTIBYTE (i2); } return (downcase (i1) == downcase (i2) ? Qt : Qnil); }