On Sun, Nov 20, 2022 at 06:24:57PM +0100, Ludovic Courtès wrote: > Hi, > > Andrew Whatson skribis: > > > Forcibly closing file descriptors like this shouldn't be necessary if > > the application has properly opened descriptors with the FD_CLOEXEC > > flag. It would be good to get input from some more experienced Guile > > hackers on the potential consequences of this change. > > Libguile opens all its own file descriptors at O_CLOEXEC (one omission > was recently fixed in 0aa1a9976fc3c6af4d1087e59d728cb8fe7d369a) so it > may be possible to remove that FD-closing loop. There’s still the > possibility that application bug unwillingly leaks FDs, but we could > consider it’s none of our business. > > Thoughts? Hm. Socket FDs don't "have" O_CLOEXEC. Arguably, they are at least as "interesting" as file FDs (meaning: source of obscure bugs). Moreover, misbehaving C libraries can be an additional source of bugs we have no control of. The reference I posted upthread makes a compelling case for at least needing an option for this (admittedly ugly) close orgy (perhaps with some additional platform-dependent mitigations, but that's an ugliness in its own, sigh). Cheers -- t