Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Commented Issue: duplicate SSH_MSG_CHANNEL_CLOSE for same channel lets dropbear terminate connection [1227]

$
0
0
<p>When transferring files with SCP from a device running dropbear 0.53.1 I noticed connection aborts on the PC runninng SSH.NET with error messages from dropbear.</p>
<p>&nbsp;</p>
<p>On the PC I get &quot;An established connection was aborted by the software in your host machine.&quot; while dropbear on the device logs &quot;authpriv.info dropbear[4775]: Exit (system): Close for unknown channel 0&quot;</p>
<p>(Dropbear terminates the whole connection in an unclean way when it detects this error.)</p>
<p>&nbsp;</p>
<p>The problem depends on timing because it seems to disappear when I run dropbear with system call trace or (lots of) debug output.</p>
<p>&nbsp;</p>
<p>With debudding on the PC we found out that SSH.NET sometimes sends SSH_MSG_CHANNEL_CLOSE twice.</p>
<p>&nbsp;</p>
<p>SshNet.Logging Verbose: 1 : ReceiveMessage from server: &#39;ChannelCloseMessage&#39;: &#39;SSH_MSG_CHANNEL_CLOSE : #2&#39;.</p>
<p>SshNet.Logging Verbose: 1 : SendMessage to server &#39;ChannelCloseMessage&#39;: &#39;SSH_MSG_CHANNEL_CLOSE : #0&#39;.</p>
<p>SshNet.Logging Verbose: 1 : SendMessage to server &#39;ChannelCloseMessage&#39;: &#39;SSH_MSG_CHANNEL_CLOSE : #0&#39;.</p>
<p>Eine Ausnahme (erste Chance) des Typs &quot;Renci.SshNet.Common.SshConnectionException&quot; ist in Renci.SshNet.dll aufgetreten.</p>
<p>15:29:31.3242:scp_ErrorOccurred: An established connection was aborted by the software in your host machine.</p>
<p>&nbsp;</p>
<p>In Channel.cs there is a call to</p>
<p>this.SendMessage(new ChannelCloseMessage(this.RemoteChannelNumber));</p>
<p>both in Close() and in OnClose()</p>
<p>&nbsp;</p>
<p>In the problematic case Close() is called first, then OnClose(). </p>
<p>&nbsp;</p>
<p>We were able to fix the problem by preventing the Channel object from sending the message twice. We modify a variable when sending ChannelCloseMessage for the first time and skip the second call if the variable does not have its initial value.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Bodo</p>

Comments: ** Comment from web user: olegkap **

Hi,

Can you try latest version? I believe I fixed some racing condition for similar case so I hope it will fix this issue for you too.

Thanks,
Oleg


Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>