Skip to content
Snippets Groups Projects
Commit 511b901a authored by sheaf's avatar sheaf
Browse files

Don't attach finalizers to CommunicationHandles

We are now careful to not attach any Handle finalizers when creating
pipes for inter-process communication on Unix systems. Instead, the
handles are closed manually.

The finalizers were causing problems in situations such as the following:

  - the parent creates a new pipe, e.g. pipe2([7,8]),
  - the parent spawns a child process, and lets FD 8 be inherited by the child,
  - the parent closes FD 8 (as it should),
  - the parent opens FD 8 for some other purpose, e.g. for writing to a file,
  - the finalizer for the Handle wrapping FD 8 runs, closing FD 8, even though
    it is now in use for a completely different purpose.

This commit does not include a test, as the above bug is a bit difficult
to trigger.
parent d74bba24
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment