From unknown Wed Aug 20 05:15:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61256: master; Function `vc-find-revision-no-save' leaks buffers in case of errors Resent-From: "Farblos" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Feb 2023 16:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61256 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 61256@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167544150617710 (code B ref -1); Fri, 03 Feb 2023 16:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Feb 2023 16:25:06 +0000 Received: from localhost ([127.0.0.1]:39859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNys6-0004ba-GS for submit@debbugs.gnu.org; Fri, 03 Feb 2023 11:25:06 -0500 Received: from lists.gnu.org ([209.51.188.17]:46074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNys3-0004bO-40 for submit@debbugs.gnu.org; Fri, 03 Feb 2023 11:25:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNys2-0007RL-QY for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 11:25:02 -0500 Received: from mr6.vodafonemail.de ([145.253.228.166]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNys0-0005m8-7W for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 11:25:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-21dec; t=1675441487; bh=ZQYknAQ0eWs3zDa7dvy++JscuROnOwKBgOqBypDq6S8=; h=From:To:Message-ID:Date:Subject:Content-type:From; b=l8ZWVA3aAbWvHkOk1Eo8rvSwSa6SoK54g605nPSkFV+ZopUQxrWIuziHLFuz+CL1n FfpJG7IkhjJKNb8izEpjgehhWq/VYJpCVYCxwkeiDwG9LWhdO3WJPJv7L/8ghVsDQL YE2rmg2/d6dYdK2LZHnM9kz+6n1/7+SHjXUG2BkA= Received: from mp102.fra-mediabeam.com (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr6.vodafonemail.de (Postfix) with ESMTPS id 4P7gwb4VJpz1yZ2 for ; Fri, 3 Feb 2023 16:24:47 +0000 (UTC) Received: from mailbackend01 (unknown [10.0.0.2]) by mp102.fra-mediabeam.com (Postfix) with ESMTP id 4P7gwb3Q4hz8t6S for ; Fri, 3 Feb 2023 16:24:47 +0000 (UTC) From: "Farblos" Message-ID: <871512d8f5344d0db2e8d9f28105ce25@vodafonemail.de> Date: Fri, 03 Feb 2023 17:24:45 +0100 X-Priority: 3 MIME-Version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-purgate-type: clean X-purgate: clean X-purgate-size: 768 X-purgate-ID: 155817::1675441487-56BB81CD-9E31EDC4/0/0 Received-SPF: pass client-ip=145.253.228.166; envelope-from=AKFKQU.9DF7RP@vodafonemail.de; helo=mr6.vodafonemail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) I haven't actually a test case for this issue but found it by re-indenting function `vc-find-revision-no-save'=2E When doing so you will notice that the following sexps (indented as in the original code) are actually both UNWINDFORMS: =09=09(setq failed nil) =09 (when (and failed (unless buffer (get-file-buffer filename))) =09 (with-current-buffer (get-file-buffer filename) =09=09(set-buffer-modified-p nil)) =09 (kill-buffer (get-file-buffer filename))) Meaning that the failure-handling `when' will never be eval'ed=2E I gu= ess this is a copy-and-paste error and the (setq failed nil) should be rather placed in the preceeding (with-current-buffer =2E=2E=2E)=2E Probably not a big deal but not hard to fix, either=2E=2E=2E From unknown Wed Aug 20 05:15:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61256: master; Function `vc-find-revision-no-save' leaks buffers in case of errors Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Feb 2023 18:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61256 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Farblos" Cc: 61256@debbugs.gnu.org Received: via spool by 61256-submit@debbugs.gnu.org id=B61256.167562151030361 (code B ref 61256); Sun, 05 Feb 2023 18:26:02 +0000 Received: (at 61256) by debbugs.gnu.org; 5 Feb 2023 18:25:10 +0000 Received: from localhost ([127.0.0.1]:46400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOjhO-0007ta-5L for submit@debbugs.gnu.org; Sun, 05 Feb 2023 13:25:10 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:46305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOjhM-0007su-Ag; Sun, 05 Feb 2023 13:25:09 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id E01F120013; Sun, 5 Feb 2023 18:24:59 +0000 (UTC) From: Juri Linkov In-Reply-To: <871512d8f5344d0db2e8d9f28105ce25@vodafonemail.de> (Farblos's message of "Fri, 03 Feb 2023 17:24:45 +0100") Organization: LINKOV.NET References: <871512d8f5344d0db2e8d9f28105ce25@vodafonemail.de> Date: Sun, 05 Feb 2023 20:24:35 +0200 Message-ID: <86o7q8c6n0.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 61256 29.0.60 thanks > I haven't actually a test case for this issue but found it by > re-indenting function `vc-find-revision-no-save'. When doing so you > will notice that the following sexps (indented as in the original code) > are actually both UNWINDFORMS: > > (setq failed nil) > (when (and failed (unless buffer (get-file-buffer filename))) > (with-current-buffer (get-file-buffer filename) > (set-buffer-modified-p nil)) > (kill-buffer (get-file-buffer filename))) > > Meaning that the failure-handling `when' will never be eval'ed. I guess > this is a copy-and-paste error and the (setq failed nil) should be > rather placed in the preceeding (with-current-buffer ...). > > Probably not a big deal but not hard to fix, either... Good catch, thanks. Now fixed in emacs-29.