10-21-2010 06:12 PM
Hello all,
I have developed ssh drivers for LabVIEW that utilize Extraputty.dll, puTTY.exe
The drivers work perfectly when run on a windows XP machine with LabVIEW 8.5. weather run from IDE or compiled to executable
however, we have standardized on 8.2.1 and so I converted the project to 8.2.1 on a windows xp machine, and the drivers crash every time regardless what I do.
after further investigation, I determined that LabVIEW crashes just after returning from the call to connexion in sshOpenSession.vi
I have doublechecked the function prototype and it seems to be correct, also the calling convention is stdcall
I did the following test: add an extra argument to connexion of type unsigned int and assign it the value 195935983 (0xbadbeef) and ran the top level sshTestFixture, and confirmed that 0xbadbeef is the last value popped from the stack as you can see circled in red in the attached jpeg .
I have included the 8.2.1 vesion and the 8.5 version of my ssh drivers.
you will need the following to test my VIs
1. labview 8.5
2. labview 8.2.1
3. a computer running openssh as a target
sshTestFixture.vi is the top level driver tester application
if you want to build an executable, then ensure that putty.exe, ExtraPutty.dll and lua5.1.dll are included in the build and they have to appear 1 directory level below the executable.
the drivers write to the windows registry the first time that they are executed for the following purposes
1. disable puTTY ssh host key addition popup
2. add puTTY.exe directory path as an environment variable
these additions have no adverse effect on your computer, except if you use putty, then it will automatically accept keys without prompting you, however you can look at subVI WriteRegistryKeyValueHCU.vi to find out how to undo it
thanks in advance
cz
10-22-2010 05:28 PM
Hi cziottawa,
Before installing all your drivers, would it be possible to post the LabVIEW crash log, so we can take a look at that first?
Also, could you simplify your code in such a way that the problem is reproducible with one or a small number of VIs?
Thanks!
10-25-2010 01:26 PM
I have stripped down the subVIs:
instructions: use the zipped package called sshDriversDebug82.zip
1. double click sshDriverDebuggingTop Level.vi
2. specify IP address, password, username, click run
Expected result after step 2:
the first time you run the the vi , you will see a messagebox informing the user to reboot the PC
the 2nd time (after rebooting the PC). you will see the ssh host key acceptance dialog box from puTTY, it might be hidden behind the subVI, so you might need to minimize the subVI to get to it
3. click no
Expected result after step 3:
in 8.5: subVI executes without a crash
in 8.2.1 abrupt crash with no crash logs
thansk in advance
Carlos
10-26-2010 08:01 AM
I don't have LabVIEW handy right now, but is the configuration very different between the two machines you are using? In the past, I've had some strange problems with DLL calls when the DLL wasn't located in LabVIEW's path.
If all else fails, I sometimes find it constructive to do some low-level debugging with Process Monitor, available at http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx . It can help establish if there's some file access somewhere that isn't working correctly (that is, if LabVIEW is looking for the DLL in a particular place and not finding it), but it's a bit tricky to use.
10-26-2010 09:02 AM
the configuration of the PCs is not identical. They have different hardware and differnt software packages install. I also built an executable with 8.2.1 and ran it on a 3rd PC with the same result ... crash
I believe that the DLL is in the path of LabVIEW because we get to the SSH key acceptance dialog box from puTTY. it is after we return from the function call, that problems appear (in the form of a crash).
also the DLL itself has to be passed an environment variable, and I get confirmation of that too by seeing the SSH Key acceptiance box from puTTY
thanks
Carlos