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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#72220: closed (31.0.50; [PATCH] Use 'unwind-protect' to
 ensure that Eshell always closes I/O handles)
Date: Sat, 27 Jul 2024 21:01:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 27 Jul 2024 13:59:25 -0700
with message-id <b71595c1-834a-f4ad-204c-ead17eff1fd4 <at> gmail.com>
and subject line Re: bug#72220: 31.0.50; [PATCH] Use 'unwind-protect' to ensure that Eshell always closes I/O handles
has caused the debbugs.gnu.org bug report #72220,
regarding 31.0.50; [PATCH] Use 'unwind-protect' to ensure that Eshell always closes I/O handles
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
72220: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72220
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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)]
[Message part 6 (message/rfc822, inline)]
From: Jim Porter <jporterbugs <at> gmail.com>
To: 72220-done <at> debbugs.gnu.org
Subject: Re: bug#72220: 31.0.50; [PATCH] Use 'unwind-protect' to ensure that
 Eshell always closes I/O handles
Date: Sat, 27 Jul 2024 13:59:25 -0700
On 7/20/2024 4:13 PM, Jim Porter wrote:
> 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).

I've now merged this to the master branch as 50339b38fde. Closing this bug.


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.