Closed gaetanzanella closed 1 year ago
Hmm, I'm not observing this crash locally. Can you attach a full backtrace, or even better a crash report?
NIOSSHClient-2023-04-17-164811.ips.zip
You can try to reduce the time before closing:
DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + 0.5) {
print("❌")
_ = childChannel.close(promise: nil)
}
I propose a new version (I think the print
was creating some delay).
Ok great, this crash report is sufficient. I think the issue here is that we don't change that self.state.sentClose
is false before we send the window update. That would likely fix the issue here. It shouldn't be too hard to construct a unit test that triggers this.
I tried a fix. I am not super sure about it:
SSHChildChannel
directly. Should the action be propagated to the state machine and handled by it?Let me know. Thanks for your time!
SwiftNIO SSH commit hash: c56ababb0e22e0cdf5ec8b31698e07f943ea92e7
Context
While writing Xcode tests in one of my project which uses
swift-nio-ssh
, I encountered a crash. I reproduced it using theNIOSSHClient
target.yes \"long text\" | head -n 1000000\n
Steps to reproduce
docker-compose -f ./docker/ssh-docker-compose.yaml up -d
NIOSSHClient
target.Configuration
$ swift --version swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100) Target: arm64-apple-macosx13.0
Operating system: macOS Ventura 13.2
Xcode version: 14.2
$ uname -a Darwin MBP-de-Gaetan-Zanella 22.3.0 Darwin Kernel Version 22.3.0: Thu Jan 5 20:48:54 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6000 arm64