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: Sun, 24 Feb 2013 17:50:37 +0200 Message-ID: <83ehg5k8xe.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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1361721093 31955 80.91.229.3 (24 Feb 2013 15:51:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Feb 2013 15:51:33 +0000 (UTC) Cc: 13743@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 24 16:51:56 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 1U9drn-0006Kk-B8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Feb 2013 16:51:55 +0100 Original-Received: from localhost ([::1]:60339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9drS-000525-CO for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Feb 2013 10:51:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9drN-00051n-Hr for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2013 10:51:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9drM-0005HR-C2 for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2013 10:51:29 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9drM-0005HM-89 for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2013 10:51:28 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U9dsr-0006mW-Lp for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2013 10:53: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: Sun, 24 Feb 2013 15:53: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.136172115026027 (code B ref 13743); Sun, 24 Feb 2013 15:53:01 +0000 Original-Received: (at 13743) by debbugs.gnu.org; 24 Feb 2013 15:52:30 +0000 Original-Received: from localhost ([127.0.0.1]:47708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U9dsM-0006lj-1o for submit@debbugs.gnu.org; Sun, 24 Feb 2013 10:52:30 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:40601) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U9dsK-0006lc-4i for 13743@debbugs.gnu.org; Sun, 24 Feb 2013 10:52:29 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MIQ00E00EKPXM00@a-mtaout22.012.net.il> for 13743@debbugs.gnu.org; Sun, 24 Feb 2013 17:50:47 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MIQ00EB0EOMXT00@a-mtaout22.012.net.il>; Sun, 24 Feb 2013 17:50:47 +0200 (IST) In-reply-to: <512A31A0.4040804@yandex.ru> 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:71748 Archived-At: > Date: Sun, 24 Feb 2013 19:28:32 +0400 > From: Dmitry Gutov > CC: Stefan Monnier , 13743@debbugs.gnu.org > > >> How 'bout moving the > >> > >> if (BUFFERP (object)) > >> modify_region (object, start, end); > >> > >> earlier in the function. Something like the patch below. > > > > This will (falsely, AFAIU) tell us that the region is about to be > > modified when we return at the point marked below: > > I tried the patches, and both seem to work fine so far. If you could > explain the practical implications of the drawback in Stefan's patch > you're describing here, I'll try to test for that, too. You need to simulate the situation which causes us to return here: > > /* If this interval already has the properties, we can > > skip it. */ > > if (interval_has_all_properties (properties, i)) > > { > > ptrdiff_t got = (LENGTH (i) - (s - i->position)); > > if (got >= len) > > RETURN_UNGCPRO (Qnil); <<<<<<<<<<<<<<<<<<<<<<<<<<< This condition means that we find an interval which already has the property we are trying to add, and that interval's length is at least as large as the distance between START and END. The simplest thing to try reproducing this would be to call add-text-properties with the property that is already somewhere in the buffer and with START and END that belong to the buffer region with this property. I hope this will show you what happens. 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.