bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#72220: 31.0.50; [PATCH] Use 'unwind-protect' to ensure that Eshell a


From: Jim Porter
Subject: bug#72220: 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

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).

Attachment: 0001-Improve-correctness-of-eshell-do-eval-in-some-edge-c.patch
Description: Text document

Attachment: 0002-Use-unwind-protect-to-ensure-that-Eshell-always-clos.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]