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#13743: 24.2.93; Segmentation fault when trying to [s]teal a file opened elsewhere Date: Mon, 25 Feb 2013 18:37:50 +0200 Message-ID: <83y5ecic2p.fsf@gnu.org> References: <5125ADA9.3070603@cs.ucla.edu> <51283965.2020107@yandex.ru> <837glzkqvc.fsf@gnu.org> <83621ilvk9.fsf@gnu.org> <512A31A0.4040804@yandex.ru> <83ehg5k8xe.fsf@gnu.org> <512AFC18.4090504@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1361810331 15904 80.91.229.3 (25 Feb 2013 16:38:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Feb 2013 16:38:51 +0000 (UTC) Cc: dgutov@yandex.ru, 13743@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 25 17:39:13 2013 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 1UA152-0000kW-3V for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Feb 2013 17:39:08 +0100 Original-Received: from localhost ([::1]:50977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA14h-0004FP-9S for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Feb 2013 11:38:47 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA14O-0004A3-RI for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:38:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA14I-0008WG-DP for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:38:28 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA14I-0008W4-8a for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:38:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UA15t-0004ne-O2 for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:40:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Feb 2013 16:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13743 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13743-submit@debbugs.gnu.org id=B13743.136181038318421 (code B ref 13743); Mon, 25 Feb 2013 16:40:01 +0000 Original-Received: (at 13743) by debbugs.gnu.org; 25 Feb 2013 16:39:43 +0000 Original-Received: from localhost ([127.0.0.1]:49826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA15Z-0004n3-UC for submit@debbugs.gnu.org; Mon, 25 Feb 2013 11:39:42 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:60425) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA15X-0004mv-1x for 13743@debbugs.gnu.org; Mon, 25 Feb 2013 11:39:40 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MIS00100BI95200@a-mtaout21.012.net.il> for 13743@debbugs.gnu.org; Mon, 25 Feb 2013 18:37:57 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MIS000A7BJ9UJC0@a-mtaout21.012.net.il>; Mon, 25 Feb 2013 18:37:57 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:71788 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , 13743@debbugs.gnu.org > Date: Mon, 25 Feb 2013 10:25:15 -0500 > > >> The manifestation of the problem will be that modify_region will be > >> called in this case, although we don't actually modify anything. You > >> will probably see the "modified" indicator on the mode line, something > >> that shouldn't have happened. > > That is indeed what happens. > > OTOH, the existing behavior in this area is rather messy anyway: > > Not only that, but it's not clear why "that shouldn't have happened". Because we announce that the buffer was changed when in fact it wasn't. That's a lie. (It also causes redisplay to work harder as a side effect.) > It's good to optimize away the whole add-text-properties when it ends up > doing nothing, but it's just an optimization. Well, avoiding lies is always an optimization, isn't it? Life can (and does) go on even without that optimization. But seriously, how can you claim this not to be a bug? Here, try this simplified recipe: emacs -Q C-x b foo RET M-: (insert-char ?a 60) RET M-: (add-text-properties 2 10 '(face error)) RET => t The buffer is marked modified. M-~ The buffer is marked unmodified. M-: (add-text-properties 2 10 '(face error)) RET => nil The buffer is marked modified again, although nothing's changed, and the value returned is nil. You can repeat the last 2 steps forever, the buffer always becomes modified. I don't see how this could be anything but a bug. Not a catastrophe, I agree, but a bug nonetheless. > And I don't think it's an important one here, since (as Dmitry points > out) the likely most common case (of having `start' be right at the > beginning of an interval object) didn't work anyway It does work now. More importantly, it fixed the original crash. > and furthermore most calls to add-text-properties are likely to be > protected by inhibit-modification-hooks. I don't think inhibit-modification-hooks stops the file-locking prompt from being shown, does it?