fix lost file handle error #129
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SwiftNIO SSH commit hash: 5f40984
Context:
When connecting to the NIOSSHServer sample server using the NIOSSHClient example client, the server crashes due to a lost file handler. See also https://forums.swift.org/t/add-ssh-support-to-nio-project where the fix was suggested by Cory Benfield.
Steps to reproduce:
NIOCore/SystemCallHelpers.swift:61: Precondition failed: unacceptable errno 9 Bad file descriptor in close(descriptor:))
$ swift --version
Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: x86_64-apple-darwin22.2.0
% uname -a
Darwin 31-149-230-59.biz.kpn.net 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:08:47 PST 2022; root:xnu-8792.61.2~4/RELEASE_X86_64 x86_64