From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov 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 19:28:32 +0400 Message-ID: <512A31A0.4040804@yandex.ru> References: <5125ADA9.3070603@cs.ucla.edu> <51283965.2020107@yandex.ru> <837glzkqvc.fsf@gnu.org> <83621ilvk9.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1361719774 20243 80.91.229.3 (24 Feb 2013 15:29:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Feb 2013 15:29:34 +0000 (UTC) Cc: 13743@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 24 16:29:57 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 1U9dWW-00067M-V1 for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Feb 2013 16:29:57 +0100 Original-Received: from localhost ([::1]:58201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9dWC-0001SS-C9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Feb 2013 10:29:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9dW7-0001RL-Iy for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2013 10:29:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9dW4-0007YZ-9e for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2013 10:29:31 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9dW4-0007YV-6y for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2013 10:29:28 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U9dXZ-0006F8-LN for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2013 10:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Feb 2013 15:31: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.136171980823934 (code B ref 13743); Sun, 24 Feb 2013 15:31:01 +0000 Original-Received: (at 13743) by debbugs.gnu.org; 24 Feb 2013 15:30:08 +0000 Original-Received: from localhost ([127.0.0.1]:47685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U9dWh-0006Dy-Cz for submit@debbugs.gnu.org; Sun, 24 Feb 2013 10:30:07 -0500 Original-Received: from mail-la0-f42.google.com ([209.85.215.42]:35101) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U9dWf-0006DS-5b for 13743@debbugs.gnu.org; Sun, 24 Feb 2013 10:30:06 -0500 Original-Received: by mail-la0-f42.google.com with SMTP id fe20so1954614lab.29 for <13743@debbugs.gnu.org>; Sun, 24 Feb 2013 07:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=H5rDz7l2svbRfIiarbGDPSgZRSGnuLn1uGEut89R7Ik=; b=nqKa2YgVAKFJfPrKIzJzdBfGo6cJU5CPXbX94Qsmnj/19jyZgaTeCTBXF6dH2cwpBy pJs4uY78YFOZojjmUbk5WO796GDh2dpE8JpQoKMxDvQTFy0+Qye+CC9TlmFNHFT+AnFG UKYLA5G+Zd/IZVopP+B0drOk4Cpdmt+8YWz45xqI5L0FG7gDxM6aN1fK+IOdxeKoudOj 8WC35RchYscg8mfL5yIm+cbsCTgR/VLf9f/aht7bnh8GwguMipkc842GL2wJ6mKgsUlD HkdCiT0j6BzGMaq+SgnnkGLtoXQNI0X0ABly0dZ2QlA81lI7WWEpeUegRBhWEVYUG29T 4nTA== X-Received: by 10.112.28.101 with SMTP id a5mr3392313lbh.0.1361719710009; Sun, 24 Feb 2013 07:28:30 -0800 (PST) Original-Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPS id fz16sm5054868lab.5.2013.02.24.07.28.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 Feb 2013 07:28:28 -0800 (PST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 In-Reply-To: <83621ilvk9.fsf@gnu.org> 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:71747 Archived-At: On 23.02.2013 22:44, Eli Zaretskii wrote: >>> I can fix this particular problem with this simple patch: >> [...] >>> However, I'm not sure this is the right or the best way. If it is, it >>> will probably be prudent to add some protection against infinite >>> recursion here. >> >> 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. > /* If we're not starting on an interval boundary, we have to > split this interval. */ > if (i->position != s) > { > /* 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); <<<<<<<<<<<<<<<<<<<<<<<<<<< > len -= got; > i = next_interval (i); > } > else >