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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72220 in the body.
You can then email your comments to 72220 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#72220; Package emacs. (Sat, 20 Jul 2024 23:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Porter <jporterbugs <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 20 Jul 2024 23:14:02 GMT) Full text and rfc822 format available.

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

Reply sent to Jim Porter <jporterbugs <at> gmail.com>:
You have taken responsibility. (Sat, 27 Jul 2024 21:01:02 GMT) Full text and rfc822 format available.

Notification sent to Jim Porter <jporterbugs <at> gmail.com>:
bug acknowledged by developer. (Sat, 27 Jul 2024 21:01:02 GMT) Full text and rfc822 format available.

Message #10 received at 72220-done <at> debbugs.gnu.org (full text, mbox):

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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72220; Package emacs. (Thu, 01 Aug 2024 08:49:01 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <acorallo <at> gnu.org>
To: 72220 <at> debbugs.gnu.org
Cc: jporterbugs <at> gmail.com
Subject: Re: bug#72220: 31.0.50; [PATCH] Use 'unwind-protect' to ensure that
 Eshell always closes I/O handles
Date: Thu, 01 Aug 2024 04:47:41 -0400
Jim Porter <jporterbugs <at> gmail.com> writes:

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

Hi Jim,

compiling master after 50339b38fde was installed is generating this warning:

eshell/em-dirs.el:430:14: Warning: ‘eshell-protect’ is an obsolete macro (as of 31.1).

Would you ming taking care of it?

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72220; Package emacs. (Thu, 01 Aug 2024 16:36:02 GMT) Full text and rfc822 format available.

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

From: Jim Porter <jporterbugs <at> gmail.com>
To: Andrea Corallo <acorallo <at> gnu.org>, 72220 <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: Thu, 1 Aug 2024 09:33:36 -0700
On 8/1/2024 1:47 AM, Andrea Corallo wrote:
> compiling master after 50339b38fde was installed is generating this warning:
> 
> eshell/em-dirs.el:430:14: Warning: ‘eshell-protect’ is an obsolete macro (as of 31.1).
> 
> Would you ming taking care of it?

Thanks for noticing. Fixed in 1134734e196.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 30 Aug 2024 11:24:06 GMT) Full text and rfc822 format available.

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.