Of course if you have a handle where you don't know if another thread is using it and you want to close it and you want to protect against an asynchronous exception from stopping you from closing one of these 3 mystery file descriptors you can wrap that particular hClose in an uninterruptableMask.

On Wed, Nov 12, 2014 at 10:46 PM, Brandon Allbery <allbery.b@gmail.com> wrote:
On Wed, Nov 12, 2014 at 10:47 PM, Eric Mertens <emertens@gmail.com> wrote:
It's not vulnerable to the same issue because hClose can't block (as far as I know) because it can't be in use at the time that clean up is running.

This sounds unsafe to me. System file descriptors are per process, and there are at least three such that *must* be per process (stdin, stdout, stderr). And, while closing those isn't especially common, it can be and is done sometimes. Can you guarantee that the corresponding handle's not in use?

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net



--
Eric Mertens