Subject: SSHClient causes a crash when connecting to an invalid server
Date: 2018-07-03 16:58:58
From: David Angell
Source: sshclient-causes-crash-connecting-invalid-server

My company just upgraded the UltimateTerminal component from version 6.3.60124 to 6.8.4155 and I have discovered a major issue.  When using the SSHClient, if you try to connect to a server that either does not exist or does not support SSH, my program now crashes and shuts down.  In the old version, an exception was raised that indicated either a timeout or that the target machine actively refused it, which I could simply catch and handle.  But the new version just bombs out with no warning.  I have seen the same problem with your pre-compiled samples (specifically the SshClient.exe sample), so it's not just my code.  I am running Windows 10 with version 4.7.1 of the .NET Framework installed (but my program targets version 4.0).  I have tried the samples on a Windows 8 machine and have the same issue.  As I mentioned, I have seen this in your sample programs, but as a very simple test, here is a piece of sample code I was using to create the problem.

    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
                Using m_Client = New SshClient
                    If (m_Client.IsConnected) Then
                        MsgBox("Not Connected")
                    End If
                End Using
            Catch ex As Exception
            End Try
        End Sub
    End Class

For the IP Address to connect to, enter an invalid address or an address that does not support SSH.  When using the old version, an exception is raised on the Connect call and is shown to the user.  But with the current version, the program just shuts down without catching any exceptions.  The ConnectAsync method also exhibits the same behavior.  You do get a standard Windows "Program has stopped working" message, but that's it.  And an error is written to the Windows event log, like so:

    Faulting application name: SshClient.exe, version:, time stamp: 0x592123ad
    Faulting module name: unknown, version:, time stamp: 0x00000000
    Exception code: 0xc00000fd
    Fault offset: 0x00007ffd84cbb601
    Faulting process id: 0x384
    Faulting application start time: 0x01d412dc2a4a183b
    Faulting application path: D:\Users\dla\Desktop\CompiledSamples\SshClient.exe
    Faulting module path: unknown
    Report Id: 4152b46f-498d-4f64-8395-433a381b07d7
    Faulting package full name:
    Faulting package-relative application ID:


Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand
If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor
who sold you the license and ask for your money back.

Back to ComponentPro Q&A Forum Index