From unknown Fri Sep 05 20:56:20 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#79280 <79280@debbugs.gnu.org> To: bug#79280 <79280@debbugs.gnu.org> Subject: Status: package installation leaks tar-mode data buffers Reply-To: bug#79280 <79280@debbugs.gnu.org> Date: Sat, 06 Sep 2025 03:56:20 +0000 retitle 79280 package installation leaks tar-mode data buffers reassign 79280 emacs submitter 79280 Mattias Engdeg=C3=A5rd severity 79280 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 20 13:50:36 2025 Received: (at submit) by debbugs.gnu.org; 20 Aug 2025 17:50:36 +0000 Received: from localhost ([127.0.0.1]:57578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uomxH-0005CO-Od for submit@debbugs.gnu.org; Wed, 20 Aug 2025 13:50:36 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37494) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uomxD-0005C2-Fi for submit@debbugs.gnu.org; Wed, 20 Aug 2025 13:50:34 -0400 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 1uomx4-0003bi-33 for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2025 13:50:22 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uomx2-000238-Dy for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2025 13:50:21 -0400 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-333f92b4072so1151531fa.3 for ; Wed, 20 Aug 2025 10:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755712218; x=1756317018; darn=gnu.org; h=to:cc:date:message-id:subject:mime-version:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=5VlZcUN9oednLNxIc18yBxvo4EEQd87nutOe3/aHIjs=; b=RzkrbwFb6Uxdo49O0mELRNpokGWFe4/dqtcmtgnwaKFLSQHDv/BDO/HWIuPNCojVvI oidcPp7CbrYi3KIQke9Z7f1LzU6TotO6qAVEL1zzDElP0Z1l4M95SrQqCdYYwY3gDTJd Xhin5jYiRjkYdtEDUiD53s7lp0gfoTMt8t3ja6KKcakEDeTSQS6dTEJ3jIPOHULQf3Oe 5trpj7YRQaQuoIAzTw/mjseoDI9dw9iiQ0GTzGxMtfzrKHjWAEh0rIjsTuEE0k0yxYXI moHO91LgVPBysbpIKguYVtHZ5ZDiPL/OrahmhOXY+jeC6laNg2Azfl8VLo7wmJOs5UOz dFew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755712218; x=1756317018; h=to:cc:date:message-id:subject:mime-version:from:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5VlZcUN9oednLNxIc18yBxvo4EEQd87nutOe3/aHIjs=; b=U7uCWFaa+nZdSI5CK+XLadV4QE6gzGsa9M+WpT/ygfVYxSpiDgPootH8hq3tstMYFy 7+0a6DxFVMDoNzDpwgEMcKcV+5p9C8ziUe/uX2pjsttzI9l36eE3D83aTv6LpgvSld+B vU3CbrngxlKQji3ijhc92NEVwVIZbzo9gHyud4c8gbYUVxc8eeTat1nmNyFk4n67bN3w +j9gphBPRVUp+co+MK+8J7Imw56d+An9fYdHYPGB+dQBQge2Zr0rOyooVDBtsFNyDnYU evzZ8AfZCV8+jN/5tY5OmrPqFX4eibvvkCxnabR0aKYBs/O56QhyUgRrvMs1gY8ZqKgs fhVQ== X-Gm-Message-State: AOJu0YzirQDtM9r3i7mDFbelqJKKgM5chAUglrCycKhSHxYO2DsYZMdZ z4KtAyTBFpT5T+Bz4goyO8SwFEHiTeNFL5FLIxg/bL9KzoIZKqsEaZFShgT5HA== X-Gm-Gg: ASbGncv+7M1UCycoKec5E8pENuPnCyXItzPTeuIZqChSXr5AfOJlp8w6iP3rTMVonFH XgtqxLedMDusuiB3fudahJpi3vmACNjTLT7HfQ2CCtX+qohaJEr1u8a4/YsJZ83tXoc8tTMV/H1 hshWkgvhaqzLytC7cBTNS769bXQ8Vy6BFe+NyihdQuUAtVPlGCzHnigJ2VOoqCqCXq60xax8ozp wElUYmY8Xeu3+Mxgx8Rf9nMZfWhMcIek//4g/TRN8dSAyfOlGt3jAn2DjVY5VUJeJBSPvwqLvQU gHQMfUmAhu3Op4kZ3LO3XqKO0CMYwA460TBH/nEjzKWFgZcQ73a0jNwsQyd7g0WeEdmtXFoT8LU rVLAybBAUfN3GH0ACxHa/kT/cCTgxSdJOgsgxb3rO+j2usDwguEOYVdE+X7ngGp3soBIr0o4xEF SzLpAygngcKHh021xnQ+8hr0s= X-Google-Smtp-Source: AGHT+IHqzo3aut7pWmfL/tNZ2/3XUXXA7z6o2taxAiBVG3KbfWDEqg5ExV0JA5AEYcJ41lsdcVfplg== X-Received: by 2002:a2e:bc0c:0:b0:332:5171:3114 with SMTP id 38308e7fff4ca-3353bc82b2amr10757991fa.10.1755712218147; Wed, 20 Aug 2025 10:50:18 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3340a481a13sm28016851fa.34.2025.08.20.10.50.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Aug 2025 10:50:17 -0700 (PDT) From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_855A0848-3461-49A2-9A11-BF8AE2D2B6BA" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: package installation leaks tar-mode data buffers Message-Id: Date: Wed, 20 Aug 2025 19:50:14 +0200 To: Emacs Bug Report X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=mattias.engdegard@gmail.com; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Stefan Monnier 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: -0.0 (/) --Apple-Mail=_855A0848-3461-49A2-9A11-BF8AE2D2B6BA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Apparently, package.el generates at least one leaked buffer for each = package installed. =46rom what I can tell, it's the use of tar-mode in = temporary buffers, as in (with-temp-buffer (tar-mode) ...) that is the problem: tar-mode will generate a helper buffer which is = normally removed when the tar-mode buffer is killed, but temporary = buffers inhibit the kill-buffer-hook so that never happens. Here is a straightforward patch: explicitly return to fundamental-mode = before the temporary buffer is destroyed. An alternative would be to change tar-mode so that it doesn't rely on = kill-buffer-hook to release its helper buffer. A finaliser would do, but = those see so little use that it makes me a bit uneasy. Are there other modes that may have similar problems? --Apple-Mail=_855A0848-3461-49A2-9A11-BF8AE2D2B6BA Content-Disposition: attachment; filename=package-tar-buffer-leak.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="package-tar-buffer-leak.diff" Content-Transfer-Encoding: 7bit diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index fe6bebc67ff..ba9999c20e6 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -995,18 +995,22 @@ package-untar-buffer This uses `tar-untar-buffer' from Tar mode. All files should untar into a directory named DIR; otherwise, signal an error." (tar-mode) - ;; Make sure everything extracts into DIR. - (let ((regexp (concat "\\`" (regexp-quote (expand-file-name dir)) "/")) - (case-fold-search (file-name-case-insensitive-p dir))) - (dolist (tar-data tar-parse-info) - (let ((name (expand-file-name (tar-header-name tar-data)))) - (or (string-match regexp name) - ;; Tarballs created by some utilities don't list - ;; directories with a trailing slash (Bug#13136). - (and (string-equal (expand-file-name dir) name) - (eq (tar-header-link-type tar-data) 5)) - (error "Package does not untar cleanly into directory %s/" dir))))) - (tar-untar-buffer)) + (unwind-protect + (progn + ;; Make sure everything extracts into DIR. + (let ((regexp (concat "\\`" (regexp-quote (expand-file-name dir)) "/")) + (case-fold-search (file-name-case-insensitive-p dir))) + (dolist (tar-data tar-parse-info) + (let ((name (expand-file-name (tar-header-name tar-data)))) + (or (string-match regexp name) + ;; Tarballs created by some utilities don't list + ;; directories with a trailing slash (Bug#13136). + (and (string-equal (expand-file-name dir) name) + (eq (tar-header-link-type tar-data) 5)) + (error "Package does not untar cleanly into directory %s/" + dir))))) + (tar-untar-buffer)) + (fundamental-mode))) ; free auxiliary tar-mode data (defun package--alist-to-plist-args (alist) (mapcar #'macroexp-quote @@ -2455,7 +2459,9 @@ package-install-file (set-visited-file-name file) (set-buffer-modified-p nil) (when (string-match "\\.tar\\'" file) (tar-mode))) - (package-install-from-buffer))) + (unwind-protect + (package-install-from-buffer) + (fundamental-mode)))) ; free auxiliary data ;;;###autoload (defun package-install-selected-packages (&optional noconfirm) --Apple-Mail=_855A0848-3461-49A2-9A11-BF8AE2D2B6BA-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 20 17:06:38 2025 Received: (at submit) by debbugs.gnu.org; 20 Aug 2025 21:06:38 +0000 Received: from localhost ([127.0.0.1]:57845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uoq0z-0006Ir-MB for submit@debbugs.gnu.org; Wed, 20 Aug 2025 17:06:37 -0400 Received: from lists.gnu.org ([2001:470:142::17]:57110) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uoq0w-0006IW-C1 for submit@debbugs.gnu.org; Wed, 20 Aug 2025 17:06:36 -0400 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 1uoq0l-0002wW-Iz for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2025 17:06:24 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uoq0k-0003Mv-3o for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2025 17:06:23 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 709A6441AEB; Wed, 20 Aug 2025 17:06:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1755723978; bh=DO59+3QzJ2SS0d7piPITUcanbFeMgg0veOWKBEA1rO0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=V1+MOWrnYe4QWaaPhv6iLElkrG8wdjY3anEgUeo0aSM91hbnV8YYOb4oZK6bOgRwX 5OllJHMjw7bQ8TRWDgUa/I86EFcvcCkD2UbHIqTu6y3OxaK4l1SEJhIHwPLPzTRG7Q r/66MxjyQjRvvLgWm6mxsRlcV3K6LuJQKdp4Dle1q5+98uzEmgSGFmNp0iSR9CbAuu lnAJN8i9tJY0X/fTy5nDfsULYaRC545gqieI7dWs5p0BtipEOrm+kEvlFov4sxxH9v tSwMjX0ntiN1F2QjYRBjcNwilAyL2S72NCL7XPKWG56H0D8kczgQAw+xFIzLI1XKXu HOvP4f8nt2kRg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B5C22441AE4; Wed, 20 Aug 2025 17:06:18 -0400 (EDT) Received: from asado (dyn.144-85-191-021.dsl.vtx.ch [144.85.191.21]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D70EA120343; Wed, 20 Aug 2025 17:06:17 -0400 (EDT) From: Stefan Monnier To: Mattias =?windows-1252?Q?Engdeg=E5rd?= Subject: Re: package installation leaks tar-mode data buffers In-Reply-To: Message-ID: References: Date: Wed, 20 Aug 2025 17:06:15 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.059 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit Cc: Emacs Bug Report 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.0 (-) > that is the problem: tar-mode will generate a helper buffer which is > normally removed when the tar-mode buffer is killed, but temporary > buffers inhibit the kill-buffer-hook so that never happens. Maybe we should be more careful when we skip `kill-buffer-hook`. Maybe we should run the local part of the hook (and skip the global part)? Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 21 07:52:44 2025 Received: (at submit) by debbugs.gnu.org; 21 Aug 2025 11:52:44 +0000 Received: from localhost ([127.0.0.1]:59336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1up3qV-0002Lp-IK for submit@debbugs.gnu.org; Thu, 21 Aug 2025 07:52:44 -0400 Received: from lists.gnu.org ([2001:470:142::17]:59874) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1up3qO-0002LL-LQ for submit@debbugs.gnu.org; Thu, 21 Aug 2025 07:52:37 -0400 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 1up3qI-0003j0-3R for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2025 07:52:30 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1up3qD-00025i-Mu for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2025 07:52:29 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-55e041f6da0so691845e87.3 for ; Thu, 21 Aug 2025 04:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755777142; x=1756381942; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=8T8WrZ+ldOEoWsNPN64NdVwTg3jCEe1wKXGJsNAUVyQ=; b=fmcNuBGuJByxtSEtHQu8LTwTHxP9GG56iUNlQZL0ODeVMZ2XOFUKHE5DdUFzbx70pE I5sCCrIyrNHWIib5cZGFtb63DHua87RYWxypeHkK+kZ/bdJCILbc2jjGfs2ZYDBNdtUe pOFHfrj+OVKTLFyxFvp7Bs2INMncHO0KIukIGp0Txkpnkr1AvUuGVPX7P5/+9x0pFNsU owa1a9S/sUDHV2N+LXokR9OmJER7TynaERkhi1UQMP7DRGmI4GpH1uCfgTu8VOlQ1ceH jRakebyTDShjOH4d6G4Zi2QDihCZ6IVAnNiR+N9n7sE1+7GWER6jaDhbEoW39GwBkVal 44kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755777142; x=1756381942; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8T8WrZ+ldOEoWsNPN64NdVwTg3jCEe1wKXGJsNAUVyQ=; b=UoRbpIz667Vq1kKHo/EV1mMnkZUOSiNjRiwn6f9ZyFb88lVNkFbOuse0fE4oqglQKi fNP0iRO83N90zoCoA9fT8x2JEJu+9Io6AWwdheFuKtVJ35Hl8CRXKIPZOA0/WmZIudQe IUxKLOBHNdOtR/J4iniSDVyFjfE/nfPjK5g++H9TU2znbai6qRG4Qr2l/09TZDcEtGmq sBUlnTlKTGRr8vYbUrK+uj89SvkwAgKwnJUlmeecIub6oAl3/Hgd4ckfEoDPsNQWnYUW cTEQheGKJeeISuQO4hAxRDzGMNLo4k633SUOfC2CHJfu4worSNZv738R9BCRnqcn+0gc GEMg== X-Gm-Message-State: AOJu0YzTDzChxOUhueZIkurYuabmSwd2pV2Es/qkxgiIfOqbbQB1a129 sGoHGe0xweebz9lyNcmx2rcq7M57i3jAPagV9cjMFxxQxpwTiq1nBUCY X-Gm-Gg: ASbGncuKk6bnSdabC3DCAuwyHmg+6LWD74kfeK+VTvEKoWM9qaFlXMwuAhsSnwdni1Z M1MSNr2mtVhInc4+nSnK0TFO2J3qmUjuUvpsuiZaS0ytNM8tDcg27NYlzL400QIJq+Min4iaLvh U06dB8epC3CpvwxaAJwNtHlnfw0rcHn9WQg8T+bE8n3ygo3pC4jdT3IR+cpObVw6DE5xnjDv0o8 mtWiHyJf2klpL2vaLuZWnaO5WHaAteHJCwXRDjnQ34M0x8L3aY5XNoF96nHanayKTnpd8ewNiGk +sXGb4h8spywtqVvBgmqp+E4ewhHRohlf698MOYdYzYc0fZatNODgmptbjLe4zN2js++79HHkFK e6manz5qj/vfNGyqxekmCCWfcSRwrTXd07kctnaDeQrtNKCExkpsf8NiJrzptdrJf4qN8Ljs39l bgMp+LCHP9UcOprsmsY4IYzqc= X-Google-Smtp-Source: AGHT+IH6JnMech09mPp/S1xkkXdOExgiW+anW9EvUAoig3YBjIkxARO8Haor3+GnJMxjaQ3FFLAZFQ== X-Received: by 2002:a05:6512:10d4:b0:55b:57e8:16c4 with SMTP id 2adb3069b0e04-55e0d566d6bmr877454e87.30.1755777141476; Thu, 21 Aug 2025 04:52:21 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-55cef368d34sm3000279e87.58.2025.08.21.04.52.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Aug 2025 04:52:20 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: package installation leaks tar-mode data buffers From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Thu, 21 Aug 2025 13:52:20 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <7E5F381B-7951-4FF3-B193-36CA074A02F0@gmail.com> References: To: Stefan Monnier X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Emacs Bug Report 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: -0.0 (/) 20 aug. 2025 kl. 23.06 skrev Stefan Monnier : > Maybe we should be more careful when we skip `kill-buffer-hook`. > Maybe we should run the local part of the hook (and skip the global = part)? Yes, I considered that but was worried about not having a hard way to = kill a buffer without misguided kill-buffer-hook functions getting in = the way. We'd be adding an override to the override, then an override to = the override to the override, and so on. A more principled solution might be to make buffers GC-able like any = other object, at least optionally. Exactly how to do this can be = discussed but maybe just being able to remove a buffer from = Vbuffer_alist would do. (We have one buffer like that, = Vprin1_to_string.) Of course, we'd have to teach the GC to destroy = buffers. Fkill_buffer is depressingly long and complicated and should be = broken up in smaller parts. For now I'll just push the patch as a stopgap measure, but am definitely = open to better solutions. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 21 10:03:12 2025 Received: (at 79280) by debbugs.gnu.org; 21 Aug 2025 14:03:12 +0000 Received: from localhost ([127.0.0.1]:60708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1up5sm-0000eA-5M for submit@debbugs.gnu.org; Thu, 21 Aug 2025 10:03:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60298) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1up5sj-0000dv-OJ for 79280@debbugs.gnu.org; Thu, 21 Aug 2025 10:03:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1up5sc-0003Be-CS; Thu, 21 Aug 2025 10:03:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=2NB2JIUrr0v+iszx14/GdKIvZQ9WjrRjEgzZ/p2+AL4=; b=VaL/EnvZoZ5lQpdynttW zEvidsJwDFE/LWy7Y5GFLEz5Q/YWRIfhCnIaPGihGtoXeua1bP/kw+Go1AdlM3QHm6QUm9ultiqLU kNWjGr8HSa6OiOsOrgcfmDnKkDStQDRu5KEecgps3pO6GzoC+rnEpDW3s7ypgOyhZujiaodO/R6jg 0xPT6JcyrxiktXMw5IzJ6R+WNGMl8pLtzPzYYWps4GtGlZSN23aYHFctngfubjQLU9mms+BvkCsAl mxGriyd53brd6wgNUER/mXK34p4k8QkOKX7JE5Q+1zFjCOJiLYpatKZBYsCt8r/5DM6dnMdk2vwmW b+2AuMxSLvXpcA==; Date: Thu, 21 Aug 2025 17:02:58 +0300 Message-Id: <86349keprh.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <7E5F381B-7951-4FF3-B193-36CA074A02F0@gmail.com> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Thu, 21 Aug 2025 13:52:20 +0200) Subject: Re: bug#79280: package installation leaks tar-mode data buffers References: <7E5F381B-7951-4FF3-B193-36CA074A02F0@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79280 Cc: 79280@debbugs.gnu.org, monnier@iro.umontreal.ca 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: -3.3 (---) > Cc: 79280@debbugs.gnu.org > From: Mattias EngdegÄrd > Date: Thu, 21 Aug 2025 13:52:20 +0200 > > A more principled solution might be to make buffers GC-able like any other object, at least optionally. Exactly how to do this can be discussed but maybe just being able to remove a buffer from Vbuffer_alist would do. (We have one buffer like that, Vprin1_to_string.) Of course, we'd have to teach the GC to destroy buffers. Fkill_buffer is depressingly long and complicated and should be broken up in smaller parts. There's no way Emacs could know whether a buffer is still needed. Users that want to get rid of buffers that were not accessed for too long can use the midnight.el features to do that. So I don't think we need to add any automation here. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 21 15:16:12 2025 Received: (at 79280) by debbugs.gnu.org; 21 Aug 2025 19:16:12 +0000 Received: from localhost ([127.0.0.1]:33047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1upAlg-00077l-F7 for submit@debbugs.gnu.org; Thu, 21 Aug 2025 15:16:12 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7994) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1upAlb-000773-BT for 79280@debbugs.gnu.org; Thu, 21 Aug 2025 15:16:11 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D4559440C88; Thu, 21 Aug 2025 15:16:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1755803760; bh=kMlhJhBJE45qDJbn/hCPkQhGzhtPFRG9WUfOILlnkU4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=lwLG8q49WC3/czz3iQVryNG2HD6nUmde7tMlKa6+ctAEGVFPREvnm5VfLTqNXC8Pg 2PTjHVyGox4WaC6NT5BcJFKj/sQvnHVKxbR0z3lMixZH0LWnGmYpIiwElBSQZCdrhC QfvpROu/B6Q0dGPUOGeQD1713e61EkdRPF/AcxbUGS28PeUn7dYMIzEd2MTFQq5LwQ JGZnR8i2YAH3gOdH4jEZanqKrBsf2OFwWG2ch9fhT+e9nB3yrsw5/qLEbxZ36jR1Ga yETzR4wYaKICrQdD2oL1settqRzjOXLFexjh4/BeqYiOhAUXUfC/Nbd6Wacormlxon 2+oMoqbnstxBA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BCF77440C74; Thu, 21 Aug 2025 15:16:00 -0400 (EDT) Received: from asado (dyn.144-85-253-250.dsl.vtx.ch [144.85.253.250]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7EFEC1203AB; Thu, 21 Aug 2025 15:15:59 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#79280: package installation leaks tar-mode data buffers In-Reply-To: <86349keprh.fsf@gnu.org> Message-ID: References: <7E5F381B-7951-4FF3-B193-36CA074A02F0@gmail.com> <86349keprh.fsf@gnu.org> Date: Thu, 21 Aug 2025 15:15:57 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.058 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79280 Cc: 79280@debbugs.gnu.org, Mattias =?windows-1252?Q?Engdeg=E5rd?= 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: -3.3 (---) >> A more principled solution might be to make buffers GC-able like any other >> object, at least optionally. Exactly how to do this can be discussed but >> maybe just being able to remove a buffer from Vbuffer_alist would do. (We >> have one buffer like that, Vprin1_to_string.) Of course, we'd have to >> teach the GC to destroy buffers. Fkill_buffer is depressingly long and >> complicated and should be broken up in smaller parts. > > There's no way Emacs could know whether a buffer is still needed. > Users that want to get rid of buffers that were not accessed for too > long can use the midnight.el features to do that. So I don't think we > need to add any automation here. I don't think Mattias is suggesting to GC normal buffers, but rather to allow the creation&use of anonymous buffers (and then to make `tar-mode` use such an anonymous buffer for its auxiliary buffer). It's been suggested/mentioned several times in the past, but it's not clear how that would work. Maybe we could allow `buffer-name` to be `t` for buffers which have no name yet are still live, and then collect (and find solutions for) all the problems this introduces. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 22 11:30:01 2025 Received: (at 79280-done) by debbugs.gnu.org; 22 Aug 2025 15:30:01 +0000 Received: from localhost ([127.0.0.1]:37186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1upTiK-0007Zk-Qi for submit@debbugs.gnu.org; Fri, 22 Aug 2025 11:30:01 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:59878) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1upTiH-0007ZN-0R for 79280-done@debbugs.gnu.org; Fri, 22 Aug 2025 11:29:58 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-55ce528a0f5so2436916e87.3 for <79280-done@debbugs.gnu.org>; Fri, 22 Aug 2025 08:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755876589; x=1756481389; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=Weh+sxgTRwXvlJbM/b+dhjjxjcoWW9qQ+BV3sEKUmBM=; b=IsST3281mazdwk3tASHEa1dDBk8aLPtzKxCCxMGseHHm1+2VIZx8bBFu4Zu2t2vlqM FhrEDi/xqVHDBtmZhK5ce49MTkF7Hfzczgx+5jALMXaG6T7qTvV7P4K2lZZzYgHPHu9q yHgbmHhaxjAFT2HwW4/WRPDjfvp3EZjwPUzxKpGTfYvkX9qt76KIa3IQwIW4ZeB/zWi6 nAwrjRVVioiaVi8Qhjz9X89gK/Ay+/ekcHvXMn9b70vhy9b3f9ept5toYY2l83Uj2OPa N6J43ksKFQ3ymkteGc2iQ2RyDc8/TiFIvsUc1wAzWDKrryYRYeFvSQUpYPzFCZmBKiR5 M5kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755876589; x=1756481389; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Weh+sxgTRwXvlJbM/b+dhjjxjcoWW9qQ+BV3sEKUmBM=; b=czP7KcX9nTjfJLzXkXlaRPC1Q6nkx9L4UefZMd3/aI3LsoXnFGvfB1TomRAO0SwhKX HdTKek1ZPELPbNhse5TATYZrL3HnJ7UkKRfCKjgCERhLWRJNfL+dijEPcpg+F8R9zqBK TRFTz3oiKa+2qPu2BkHe6SUotVQMVqgb/nks+8kHA0X583Eru4GY5GvV8EXxkVFeSwvw O70rcqG5XL+SrWiEmcU5CLfLDj7lI9u9cRKQ4brQwoZFko+M4tCShtCd8xHv4vitIDz7 2MxIlWTC0BQ/DLf/TMVHGI820HW/CCPWRLZ3UTXXGLcIbfC645k0Rqycv6eGxCWUwrVL S11Q== X-Forwarded-Encrypted: i=1; AJvYcCWt3lpCVMpFHgOXp1INGEaHUhzoVQl8F32c7laaeIZ7CogABervBSlBcfvnpMQeWeFBL5mWng8bXl6t@debbugs.gnu.org X-Gm-Message-State: AOJu0YzUIgZ+Qc5dsHkvRTGs/AG9qUCtUw+Mch5DftjXrzsTUbkRWy77 vD+A7ehio7YP87c347arDeINuu0ypUgx4aJDGu50td/gASEdxs7JPXkhs5UZlQ== X-Gm-Gg: ASbGncugpyy13VJ4oPBI7MYM3UhjDmZw7z+waBaoTSAMUpFqJXWf1qtNog6eTvlkRVn 3TBzJIuDH182BNM6xiTYNrDwQOPh8dvcfE7C3TCNeYeJ6GDAHRvasX36eN0qFvY9NX4EtGQ+yBf vK6yo6JVncjc0wicMrMzIKbJ/o8i/8WhzPAa+DwlsPUUCVmtca3CZ7M4FJcUE08j5U37gsa5lQY j97528nuJCq7EU4pUINY91tBSK8Iknv/2DwZswwxN27UgJGMs9Omg8aZJbXTViUO9JDEuUUyZLH GRdQdI70KwqD1HI0p71V9ldbKhoY7sMYKFAeyZHKs3zxs9yLH4vj/i9VU5LyBRU1GrDOrt1WG+l 3F6ZTEpNBLz3xd59qqFcDBQgH2zcGGx2C9tfoSmu/wIUoCCKgcsfll2r0DjncLScDtKwZith5Pj lRp8rMEWhe9ze1INLoXX5x4EU= X-Google-Smtp-Source: AGHT+IFLfqqb64KejI9tCUOJdBgsRhADmKjSUwKNOHKOgaDfcIwGs3969hhYDRsO0JZFSUd6WErT3A== X-Received: by 2002:a05:6512:2909:b0:55e:a69:f4a2 with SMTP id 2adb3069b0e04-55f0c6ae089mr1164044e87.14.1755876588116; Fri, 22 Aug 2025 08:29:48 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-55f35c8bce3sm20271e87.95.2025.08.22.08.29.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Aug 2025 08:29:47 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#79280: package installation leaks tar-mode data buffers From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Fri, 22 Aug 2025 17:29:47 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <6FB36B54-DA99-44CC-8B29-6BEAAF59E334@gmail.com> References: <7E5F381B-7951-4FF3-B193-36CA074A02F0@gmail.com> <86349keprh.fsf@gnu.org> To: Stefan Monnier X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79280-done Cc: Eli Zaretskii , 79280-done@debbugs.gnu.org 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.0 (-) 21 aug. 2025 kl. 21.15 skrev Stefan Monnier : > It's been suggested/mentioned several times in the past, but it's not > clear how that would work. Maybe we could allow `buffer-name` to be = `t` > for buffers which have no name yet are still live, and then collect = (and > find solutions for) all the problems this introduces. Right. The idea would be to have unlisted buffers, which may or may not = have a name but wouldn't be in Vbuffer_alist. We may need to impose = other restrictions such as not being used in a window, to reduce the = number of things that can go wrong. But the GC proving an absence of = references to a buffer is a pretty solid ground for removal. This should be completely feasible but is not very high up on my list of = things to do. Meanwhile, hacks like the one made for package.el will = have to do. Anyway, no reason for this bug to dwell any longer at the platform. = Closing! From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 23 22:47:41 2025 Received: (at 79280) by debbugs.gnu.org; 24 Aug 2025 02:47:41 +0000 Received: from localhost ([127.0.0.1]:42579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uq0lh-0001Ea-2e for submit@debbugs.gnu.org; Sat, 23 Aug 2025 22:47:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44604) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uq0ld-0001EL-87 for 79280@debbugs.gnu.org; Sat, 23 Aug 2025 22:47:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uq0lX-0002EF-KI; Sat, 23 Aug 2025 22:47:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=CV9H0wI4VL+kYpdzQ3a9E827iwyvc7PfsIkBOAKPXwo=; b=lqPzaKKvP+bu Fp3qHJRTsnclnJOvzhFMK418oiYTWvpeVhsFVcg64Yfb8omobstSJWqHAoD0tq1T7lOiWFG+29FoS 59GiVXvSHhQwhp2A+gx5eM/OLoY4iyrjVpwY/oGJgadFlkDUsTVu4q2G2Yw0y0hpf+0+dq0T9kuFG XXeNmzXt3lcG1YPQL2EcCz82R3Tz0LJcQS5qwUMVlseUya+ohrZWnvxcsX2j0lyS62w9oqfb4wKrg DkVFwtgQu+C5nHM/HIzL9jLsCsqF6ijQM61r6T8s7noxiNW+n7LFEZNGj+JzeytVeAsvsn4GjHN4q EvQd6zWIgHHij9cBKLwaug==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1uq0lX-0004aU-34; Sat, 23 Aug 2025 22:47:31 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman To: Mattias =?iso-8859-1?Q?Engdeg=C3=A5rd?= In-Reply-To: <6FB36B54-DA99-44CC-8B29-6BEAAF59E334@gmail.com> (message from Mattias =?iso-8859-1?Q?Engdeg=C3=A5rd?= on Fri, 22 Aug 2025 17:29:47 +0200) Subject: Re: bug#79280: package installation leaks tar-mode data buffers References: <7E5F381B-7951-4FF3-B193-36CA074A02F0@gmail.com> <86349keprh.fsf@gnu.org> <6FB36B54-DA99-44CC-8B29-6BEAAF59E334@gmail.com> Message-Id: Date: Sat, 23 Aug 2025 22:47:31 -0400 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79280 Cc: 79280@debbugs.gnu.org, mattias.engdegard@gmail.com 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: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] To have buffers that can be GC'd if not really in use could be useful. But I think it will be much more convenient to code which uses that feature if they have names to refer to them by. Such a buffer could be in the buffer list as usual, but some flag in the buffer would say that the buffer list should not protect it from GC. It would be protected if anything else pointed to it, except a marker pointing in it I suppose At the end of GC, if a buffer is not marked to be preserved, GC could kill it in the usual way. It could look at all the buffers in the buffer list to find those it wants to kill. Because the buffer does have a name, displaying it or selecting it would be easy. You could do that with the usual functions and commands. Doing so would protect it from GC, for the time. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)