SFTP Library crashing Cscript.exe

This forum is not monitored by the SmartFTP staff. If you have a license please contact technical support by email.
Post Reply
Tredell
Posts: 8
Joined: Thu Jun 25, 2009 10:11 pm

SFTP Library crashing Cscript.exe

Post by Tredell » Tue Aug 11, 2009 10:04 pm

Hi,

I'm having a strange problem where the SFTP library crashes cscript.exe on obj.Connect(). This only occurs when I read the license key from a file (LoadLicenseKeyFile). If I use the LoadLicenseKeyData method from the example:

[indent]If obj.LoadLicenseKeyData(strKey) Then
WScript.Echo "Success"
Else
WScript.Echo "Failed"
End If[/indent]

It always drops to the failed condition and the log file displays (I believe it only continuesbecause the DLL has not expired yet):

[indent]20090811 14:54:56.922 Thread(6860) Log file opened. LogLevel=7
20090811 14:54:56.926 Thread(6860) CLicenseKey::LoadData()
20090811 14:54:56.926 Thread(6860) CLicenseKey::LoadDataText()
20090811 14:54:56.926 Thread(6860) CLicenseKey::LoadDataXML()
20090811 14:54:56.954 Thread(6860) Log file closed.[/indent]

The LoadLicenseKeyFile method does, however, successfully validates eventhough it causes the crash of Cscript.exe.

Tredell
Posts: 8
Joined: Thu Jun 25, 2009 10:11 pm

Re: SFTP Library crashing Cscript.exe

Post by Tredell » Tue Aug 11, 2009 10:17 pm

I just found the thread below which says to disable Compressions. I uncommented the line oSFTP.Compressions = arCompressions and it seems to work now.

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: SFTP Library crashing Cscript.exe

Post by mb » Tue Aug 11, 2009 10:31 pm

Does it crash with every SFTP server you are trying to connect to?

Is the crash with the oSFTP.Compression = arCompressions call or further down in the .Connect() call?

Regards,
Mat

Tredell
Posts: 8
Joined: Thu Jun 25, 2009 10:11 pm

Re: SFTP Library crashing Cscript.exe

Post by Tredell » Mon Aug 17, 2009 3:39 pm

Hi Mat,

I only tried connecting to a Cygwin SSH server. I'm not sure if the same behaviour would occur if I attempted to connect to a differnt SSH server.

The crash would occur on the obj.Connect() call. Uncommenting that line, oSFTP.Compression = arCompressions, stopped the crash from occuring.

Let me know if you need anymore information.

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: SFTP Library crashing Cscript.exe

Post by mb » Mon Aug 17, 2009 4:25 pm

Thank you for your reply. Can you try to see if it crashes when connecting to another SFTP server?

Did you also try to connect to the same server with the SmartFTP client?

Regards,
Mat

Tredell
Posts: 8
Joined: Thu Jun 25, 2009 10:11 pm

Re: SFTP Library crashing Cscript.exe

Post by Tredell » Mon Aug 17, 2009 6:27 pm

Hi Mat,

Connecting with the SmartFTP client does not cause a crash. I dont have another SFTP server that I can connect to. My company uses Cygwin so that's what I was testing on. If you know of another SFTP server to try i'd be more than happy to test it out.

Tredell
Posts: 8
Joined: Thu Jun 25, 2009 10:11 pm

Re: SFTP Library crashing Cscript.exe

Post by Tredell » Wed Aug 19, 2009 4:40 pm

It looks like I made a mistake. The script keeps producing a Failed Connection error (25) and cannot successfully connect to the SSH server. If I use the simple.wsf script it works, but doesnt work with mine. I've ran it through the debugger and all the settings seem to be correct so I'm not sure why it's failing.

This is all that shows up in the log file:

[20090819 17:29:12] SmartFTP FTP Library v1.5.21.0
[20090819 17:29:12] SSH-2.0-OpenSSH_5.2
[20090819 17:29:12] 2

Is there anyway to get more debugging information?

Tredell
Posts: 8
Joined: Thu Jun 25, 2009 10:11 pm

Re: SFTP Library crashing Cscript.exe

Post by Tredell » Wed Aug 19, 2009 5:39 pm

Ok.. I figured everything out. It was my lack of knowledge of what the MUI file was used for. I didn't realize the file had to be in a en-US subdirectory and had the file on the same level as the DLL. I've tested this and it was the cause of the crash on obj.Connect(). So now my script works whether I have the compression line commented or uncommented.


Sorry for the inconvenience,
Tredell

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: SFTP Library crashing Cscript.exe

Post by mb » Wed Aug 19, 2009 5:51 pm

No problem. Thanks for the feedback. I will see if we can add an additional check in case the en-us\* files are not where they should be.

Post Reply