GNU bug report logs - #79280
package installation leaks tar-mode data buffers

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Date: Wed, 20 Aug 2025 17:51:02 UTC

Severity: normal

Done: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Emacs Bug Report <bug-gnu-emacs <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: package installation leaks tar-mode data buffers
Date: Wed, 20 Aug 2025 19:50:14 +0200
[Message part 1 (text/plain, inline)]
Apparently, package.el generates at least one leaked buffer for each package installed. From 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?

[package-tar-buffer-leak.diff (application/octet-stream, attachment)]

This bug report was last modified 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.