From unknown Wed Jun 18 23:04:26 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#1256 <1256@debbugs.gnu.org> To: bug#1256 <1256@debbugs.gnu.org> Subject: Status: Race condition in vc-diff Reply-To: bug#1256 <1256@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:04:26 +0000 retitle 1256 Race condition in vc-diff reassign 1256 emacs submitter 1256 Bob Rogers severity 1256 normal thanks From rogers-emacs@rgrjr.dyndns.org Sat Oct 25 15:34:43 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.4 required=4.0 tests=AWL,BAYES_00, MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 25 Oct 2008 22:34:43 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9PMYdJJ014838 for ; Sat, 25 Oct 2008 15:34:41 -0700 Received: from mx10.gnu.org ([199.232.76.166]:52951) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Ktrfl-0000OK-Nl for emacs-pretest-bug@gnu.org; Sat, 25 Oct 2008 18:31:53 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KtriN-0004KQ-F8 for emacs-pretest-bug@gnu.org; Sat, 25 Oct 2008 18:34:36 -0400 Received: from modulargenetics.com ([65.211.19.210]:3602 helo=alexandria.modulargenetics.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KtriN-0003ja-3M for emacs-pretest-bug@gnu.org; Sat, 25 Oct 2008 18:34:35 -0400 Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net [66.30.196.77]) by alexandria.modulargenetics.com (Postfix on SuSE Linux) with ESMTP id C558A602DF for ; Sat, 25 Oct 2008 18:33:02 -0400 (EDT) Received: (qmail 22592 invoked by uid 89); 25 Oct 2008 22:33:02 -0000 Received: from unknown (HELO rgr.rgrjr.dyndns.org) (192.168.57.1) by home with SMTP; 25 Oct 2008 22:33:02 -0000 Received: by rgr.rgrjr.dyndns.org (Postfix, from userid 500) id 0E2034B927; Sat, 25 Oct 2008 18:33:01 -0400 (EDT) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="zNVfw2TYO5" Content-Transfer-Encoding: 7bit Message-ID: <18691.40605.633869.254120@rgrjr.rgrjr.dyndns.org> Date: Sat, 25 Oct 2008 18:33:01 -0400 From: Bob Rogers To: emacs-pretest-bug@gnu.org Subject: Race condition in vc-diff X-Mailer: VM 7.19 under Emacs 23.0.60.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) --zNVfw2TYO5 Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit This problem seems to affect only the trunk, and not 22.3. (I last built emacs on 21-Oct.) To reproduce this, you need a working copy with a VCS that has a fast backend "diff to base" command; something that doesn't have to contact a server is probably a requirement (I used SVN with the WC on a local disk). You also need a version-controlled file with a trivial change with respect to the base version; touching a single line is sufficient. If you visit this file and do "C-x v =" in a single-window frame that is more than about 30 lines tall, and if the backend diff command is fast enough, the diff window will remain half the size of the screen, rather than being shrunk to fit the buffer. This is because vc-exec-after finds that the buffer process has already finished, and runs vc-diff-finish before the diff buffer has been made visible. In that case, vc-diff-finish assumes that the user has already buried it. I am not a big fan of this shrink-wrapping, but I do think vc-diff ought to behave consistently (and it has worked this way for quite a while now). The attached patch is sufficient to fix it. -- Bob Rogers http://rgrjr.dyndns.org/ --zNVfw2TYO5 Content-Type: text/plain Content-Description: Content-Disposition: inline; filename="vc-diff-exec-after-1.patch" Content-Transfer-Encoding: 7bit --- lisp/vc.el.~1.706.~ 2008-10-06 21:02:25.000000000 -0400 +++ lisp/vc.el 2008-10-25 17:49:35.000000000 -0400 @@ -1507,10 +1507,12 @@ ;; bindings are nicer for read only buffers. pcl-cvs does the ;; same thing. (setq buffer-read-only t) - (vc-exec-after `(vc-diff-finish ,(current-buffer) ',(when verbose - messages))) ;; Display the buffer, but at the end because it can change point. (pop-to-buffer (current-buffer)) + ;; Do this after pop-to-buffer, because it needs to see the proper window + ;; state if it runs immediately. -- rgr, 25-Oct-08. + (vc-exec-after `(vc-diff-finish ,(current-buffer) ',(when verbose + messages))) ;; In the async case, we return t even if there are no differences ;; because we don't know that yet. t))) --zNVfw2TYO5-- From monnier@iro.umontreal.ca Sat Oct 25 19:31:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-9.0 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 26 Oct 2008 02:31:25 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9Q2VMEd009613 for ; Sat, 25 Oct 2008 19:31:23 -0700 Received: from mx10.gnu.org ([199.232.76.166]:33615) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KtvMp-0001hR-SA for emacs-pretest-bug@gnu.org; Sat, 25 Oct 2008 22:28:36 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KtvPU-0003oV-2I for emacs-pretest-bug@gnu.org; Sat, 25 Oct 2008 22:31:20 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:7021) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KtvPT-0003oN-Qr for emacs-pretest-bug@gnu.org; Sat, 25 Oct 2008 22:31:19 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAH9zA0lFxLrB/2dsb2JhbACBdr4qg0+BDQ X-IronPort-AV: E=Sophos;i="4.33,486,1220241600"; d="scan'208";a="28865959" Received: from 69-196-186-193.dsl.teksavvy.com (HELO pastel.home) ([69.196.186.193]) by ironport2-out.teksavvy.com with ESMTP; 25 Oct 2008 22:31:19 -0400 Received: by pastel.home (Postfix, from userid 20848) id E637F8E6C; Sat, 25 Oct 2008 22:31:18 -0400 (EDT) From: Stefan Monnier To: Bob Rogers Cc: 1256@debbugs.gnu.org, emacs-pretest-bug@gnu.org Subject: Re: bug#1256: Race condition in vc-diff Message-ID: References: <18691.40605.633869.254120@rgrjr.rgrjr.dyndns.org> Date: Sat, 25 Oct 2008 22:31:18 -0400 In-Reply-To: <18691.40605.633869.254120@rgrjr.rgrjr.dyndns.org> (Bob Rogers's message of "Sat, 25 Oct 2008 18:33:01 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. > If you visit this file and do "C-x v =" in a single-window frame that > is more than about 30 lines tall, and if the backend diff command is > fast enough, the diff window will remain half the size of the screen, > rather than being shrunk to fit the buffer. This is because > vc-exec-after finds that the buffer process has already finished, and > runs vc-diff-finish before the diff buffer has been made visible. In > that case, vc-diff-finish assumes that the user has already buried it. > I am not a big fan of this shrink-wrapping, but I do think vc-diff > ought to behave consistently (and it has worked this way for quite a > while now). The attached patch is sufficient to fix it. As the comment indicates, this patch is not quite good enough because pop-to-buffer may change point. We probably will need to manipulate point explicitly to work around the problem. BTW you can make the "race-condition" deterministic by making the diff command synchronous (as is the case with the RCS backend, for example, where your problem should just *always* happen). Stefan From rogers-emacs@rgrjr.dyndns.org Sat Oct 25 20:45:44 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.2 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1256) by emacsbugs.donarmstrong.com; 26 Oct 2008 03:45:44 +0000 Received: from alexandria.modulargenetics.com (modulargenetics.com [65.211.19.210]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9Q3jf61028060 for <1256@emacsbugs.donarmstrong.com>; Sat, 25 Oct 2008 20:45:42 -0700 Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net [66.30.196.77]) by alexandria.modulargenetics.com (Postfix on SuSE Linux) with ESMTP id A5CF3640D2 for <1256@emacsbugs.donarmstrong.com>; Sat, 25 Oct 2008 23:45:40 -0400 (EDT) Received: (qmail 26078 invoked by uid 89); 26 Oct 2008 03:45:40 -0000 Received: from unknown (HELO rgr.rgrjr.dyndns.org) (192.168.57.1) by home with SMTP; 26 Oct 2008 03:45:40 -0000 Received: by rgr.rgrjr.dyndns.org (Postfix, from userid 500) id 056FC4B993; Sat, 25 Oct 2008 23:45:39 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18691.59363.668687.48867@rgrjr.rgrjr.dyndns.org> Date: Sat, 25 Oct 2008 23:45:39 -0400 From: Bob Rogers To: Stefan Monnier CC: 1256@debbugs.gnu.org Subject: Re: bug#1256: Race condition in vc-diff In-Reply-To: References: <18691.40605.633869.254120@rgrjr.rgrjr.dyndns.org> X-Mailer: VM 7.19 under Emacs 23.0.60.1 From: Stefan Monnier Date: Sat, 25 Oct 2008 22:31:18 -0400 > If you visit this file and do "C-x v =" in a single-window frame that > is more than about 30 lines tall, and if the backend diff command is > fast enough, the diff window will remain half the size of the screen, > rather than being shrunk to fit the buffer. This is because > vc-exec-after finds that the buffer process has already finished, and > runs vc-diff-finish before the diff buffer has been made visible. In > that case, vc-diff-finish assumes that the user has already buried it. > I am not a big fan of this shrink-wrapping, but I do think vc-diff > ought to behave consistently (and it has worked this way for quite a > while now). The attached patch is sufficient to fix it. As the comment indicates, this patch is not quite good enough because pop-to-buffer may change point. We probably will need to manipulate point explicitly to work around the problem. Problem? vc-diff-finish sets point in the diff buffer, so if it runs immediately, it seems to me that it ought to override what pop-to-buffer does. But perhaps I don't understand what point-changing behavior you mean. BTW you can make the "race-condition" deterministic by making the diff command synchronous (as is the case with the RCS backend, for example, where your problem should just *always* happen). Stefan It never occurred to me to try that. However, the same argument would seem to apply for (setq vc-disable-async-diff t), but that only makes the bug appear intermittently for me, even with the identical test case. -- Bob From lekktu@gmail.com Tue Mar 17 02:22:15 2009 Received: (at control) by emacsbugs.donarmstrong.com; 17 Mar 2009 09:22:15 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: ** X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=2.3 required=4.0 tests=MISSING_SUBJECT,NOSUBJECT, VALID_BTS_CONTROL autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-ew0-f176.google.com (mail-ew0-f176.google.com [209.85.219.176]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2H9MCD0005523 for ; Tue, 17 Mar 2009 02:22:14 -0700 Received: by ewy24 with SMTP id 24so3991757ewy.1 for ; Tue, 17 Mar 2009 02:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=8kg3xZo7LkfeWm8/N+Bb5gCTHDvSowOAk/GT0NUKjNc=; b=sS/XKophFfzDqrpZxSKYexjpSHOEBgWFBIntADHTWgLQ7xAkX2LJay0VW5/a9alnYU JqK5mkqwrC9L2Iu+b+OHuLWMs4dh1ivw0p3TpVFe4KfkhmlI8VYyhAH9+vGdgV/V/aj8 ZjrZbQHD9z3NgdBNX9dcvrhXE1JDzicWFM4Uo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=epHiHh4jTH8hNQ3Z9W+sdmPMWG5K8t56w3EIXDv+nyc7uMUO0OebD87ssmj47nN/8V gEn2T5weZyGT7QqOtX3mDXQokeXZQjhWmeLaUkSzN5IXPiPJhZ8VSTSKiUUROU4m5YrP Wm9HxlDTvoTR98dZx15fhqd+5ewRn1t26NJDo= MIME-Version: 1.0 Received: by 10.210.139.15 with SMTP id m15mr4357553ebd.9.1237281726835; Tue, 17 Mar 2009 02:22:06 -0700 (PDT) Date: Tue, 17 Mar 2009 10:22:06 +0100 Message-ID: Subject: From: Juanma Barranquero To: control@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit reassign 337 emacs,vc reassign 768 emacs,vc reassign 927 emacs,vc reassign 996 emacs,vc reassign 1098 emacs,vc reassign 1163 emacs,vc reassign 1256 emacs,vc reassign 1257 emacs,vc reassign 1408 emacs,vc reassign 1429 emacs,vc reassign 1589 emacs,vc reassign 1647 emacs,w32,vc reassign 1741 emacs,vc reassign 2093 emacs,vc reassign 2110 emacs,vc reassign 2117 emacs,vc reassign 2157 emacs,vc reassign 2338 emacs,vc reassign 2553 emacs,vc reassign 2598 emacs,vc reassign 2604 emacs,vc reassign 2612 emacs,vc reassign 2641 emacs,vc reassign 2652 emacs,vc reassign 2675 emacs,vc reassign 2676 emacs,vc reassign 2678 emacs,vc quit From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 09 21:44:12 2011 Received: (at 1256) by debbugs.gnu.org; 10 Jul 2011 01:44:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qfj48-0000ij-CE for submit@debbugs.gnu.org; Sat, 09 Jul 2011 21:44:12 -0400 Received: from vm-emlprdomr-05.its.yale.edu ([130.132.50.146]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qfj46-0000iP-66 for 1256@debbugs.gnu.org; Sat, 09 Jul 2011 21:44:10 -0400 Received: from furball (adsl-99-92-48-67.dsl.wlfrct.sbcglobal.net [99.92.48.67]) (authenticated bits=0) by vm-emlprdomr-05.its.yale.edu (8.14.4/8.14.4) with ESMTP id p6A1i3g2005937 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 9 Jul 2011 21:44:04 -0400 From: Chong Yidong To: Bob Rogers Subject: Re: Race condition in vc-diff Date: Sat, 09 Jul 2011 21:44:02 -0400 Message-ID: <87oc127vvh.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.146 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 1256 Cc: 1256@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > If you visit this file and do "C-x v =" in a single-window frame > that is more than about 30 lines tall, and if the backend diff command > is fast enough, the diff window will remain half the size of the > screen, rather than being shrunk to fit the buffer. This is because > vc-exec-after finds that the buffer process has already finished, and > runs vc-diff-finish before the diff buffer has been made visible. In > that case, vc-diff-finish assumes that the user has already buried it. > > I am not a big fan of this shrink-wrapping, but I do think vc-diff > ought to behave consistently (and it has worked this way for quite a > while now). The attached patch is sufficient to fix it. I committed the patch to trunk. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 09 21:44:25 2011 Received: (at control) by debbugs.gnu.org; 10 Jul 2011 01:44:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qfj4L-0000j9-Ix for submit@debbugs.gnu.org; Sat, 09 Jul 2011 21:44:25 -0400 Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qfj4K-0000iy-9P for control@debbugs.gnu.org; Sat, 09 Jul 2011 21:44:24 -0400 Received: from furball (adsl-99-92-48-67.dsl.wlfrct.sbcglobal.net [99.92.48.67]) (authenticated bits=0) by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id p6A1iII7001224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Sat, 9 Jul 2011 21:44:18 -0400 From: Chong Yidong To: control@debbugs.gnu.org Subject: close 1256 Date: Sat, 09 Jul 2011 21:44:17 -0400 Message-ID: <87aacm9afi.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) close 1256 thanks From unknown Wed Jun 18 23:04:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 07 Aug 2011 11:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator