-
-
Notifications
You must be signed in to change notification settings - Fork 931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception in ChannelSession ReleaseSemaphore #400
Comments
I occasionally had the same when I was calling the following code a lot of times (compiled SSH.Net in Debug mode as well!):
As I figured out, ChannelSession.Close() has been called a second time when the exception occured. In Session.OnChannelCloseReceived (on message handling thread), different handlers will be processed. (In the screenshot I made, the main thread not only disposed the SshCommand where the exception occured, but it already created next SshCommand) I think the fix made by fabricedupre is fine: Channel.Close()/ChannelSession.Close() are being handled at least one time (on first call) correctly.
|
Closed by #1071. Thanks @marcellemke |
Version 2023.0.0 has been published https://www.nuget.org/packages/SSH.NET/2023.0.0 |
Hello,
I am using latest stable release 2016.1.0 on Windows 10 with Visual Studio 2017 within a desktop application.
ReleaseSemaphore sometimes throws a SystemNullReference exception. To circumvent that issue I had to modify the function to:
Digging a little bit, I found that in fact the issue came from Channel SessionSemaphore property. I also had to change it a little bit as below:
Running my app with those changes, I sometimes get the below trace output, but no more exception:
*** session NULL
*** SessionSemaphore NULL
The text was updated successfully, but these errors were encountered: