Skip to content

Don't unintentionally close stdin on non-Windows.#74

Open
MMOSimca wants to merge 1 commit into
Marilyth:SelfHostfrom
MMOSimca:dont_close_stdin
Open

Don't unintentionally close stdin on non-Windows.#74
MMOSimca wants to merge 1 commit into
Marilyth:SelfHostfrom
MMOSimca:dont_close_stdin

Conversation

@MMOSimca
Copy link
Copy Markdown

The SafeHandle that is used to implement IDisposable was copied from the .NET docs and isn't needed. It leads to unintentionally closing stdin (file descriptor zero) on non-Windows platforms, which causes to hard to diagnose issues in other code.

See dotnet/runtime#64305.

The SafeHandle that is used to implement IDisposable was copied from the .NET docs and isn't needed. It leads to unintentionally closing stdin (file descriptor zero) on non-Windows platforms, which causes to hard to diagnose issues in other code.
@MMOSimca
Copy link
Copy Markdown
Author

MMOSimca commented Mar 12, 2022

Hi @Marilyth!

I recently encountered a difficult-to-nail-down issue relating to using sockets on Linux and found that this specific line of code was my problem. Trying to track down any other code I can find with the same problem to let people know what's wrong. I don't know if this was causing you any issues (it would have been whenever this BaseTracker class was disposed), but even if it wasn't, there should be no negative effects from this change.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant