GNU bug report logs - #72220
31.0.50; [PATCH] Use 'unwind-protect' to ensure that Eshell always closes I/O handles

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Sat, 20 Jul 2024 23:14:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Jim Porter <jporterbugs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; [PATCH] Use 'unwind-protect' to ensure that Eshell always
 closes I/O handles
Date: Sat, 20 Jul 2024 16:13:17 -0700
[Message part 1 (text/plain, inline)]
Eshell has long had difficult-to-diagnose issues with I/O handles 
closing when they shouldn't, or not closing when they should. This is 
because the handles are refcounted entirely manually, and the actual 
code is very easy to get wrong: the location in the source code that 
increments the refcount is often distant from where it's decremented.

I've fixed many of these issues over the last couple years and added 
tests covering them, but it's time to solve this for once and for all. 
By using 'unwind-protect', we can always ensure that the handles are 
cleaned up at the right time without having to have a perfect 
understanding of every disparate part of Eshell's command evaluation.

Luckily, thanks to the previous work here, we have a thorough suite of 
regression tests, which made developing this patch a lot easier. This 
also fixes some remaining issues with I/O handles (see the new 
regression test).
[0001-Improve-correctness-of-eshell-do-eval-in-some-edge-c.patch (text/plain, attachment)]
[0002-Use-unwind-protect-to-ensure-that-Eshell-always-clos.patch (text/plain, attachment)]

This bug report was last modified 344 days ago.

Previous Next


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