This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients gregory.p.smith, iritkatriel, neologix, pitrou, serhiy.storchaka, sstewartgallus, vstinner
Date 2020-12-07.03:11:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1607310672.27.0.355468213304.issue21627@roundup.psfhosted.org>
In-reply-to
Content
The Linux kernel code is not sufficiently easy to follow to understand if it has this issue or if it pre-creates the dirent structures for all fds at opendir time for /proc/self/fd or if it is iterating through the list of fds in sorted order so an older closed fd will not interfere with its internal iteration.

Regardless, I've yet to knowingly witness a problem from this come up in practice.  knowingly and yet being key words. :)

But I like the general theme of your patch to set CLOEXEC on all of the fd's rather than explicitly call close(fd) in the directory reading loop.
History
Date User Action Args
2020-12-07 03:11:12gregory.p.smithsetrecipients: + gregory.p.smith, pitrou, vstinner, neologix, serhiy.storchaka, sstewartgallus, iritkatriel
2020-12-07 03:11:12gregory.p.smithsetmessageid: <1607310672.27.0.355468213304.issue21627@roundup.psfhosted.org>
2020-12-07 03:11:12gregory.p.smithlinkissue21627 messages
2020-12-07 03:11:11gregory.p.smithcreate