bug-bash
[Top][All Lists]
Advanced

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

Leak in BASH "named" file descriptors?


From: Mathieu Patenaude
Subject: Leak in BASH "named" file descriptors?
Date: Wed, 27 Jan 2016 13:18:11 -0500

Hi,

When using "named" file descriptors inside a function, the file descriptors are not automatically un-linked when the function returns, but when using regular "numbered" file descriptors they are automatically "destroyed".

Not sure if it's "by" design or why it would be, but attached is a small script to demonstrate the observation.  I've tested on all versions available to me at the moment: 4.1.2(1),4.2.26(1),  4.2.37(1), 4.3.11(1) with the same results.

I understand that explicitly closing a file descriptor is a best practice, but I'm questioning the fact that the behavior is different for numbered vs named FD.

Thanks!

Math.

Attachment: bash-fh-test.sh
Description: Bourne shell script


reply via email to

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