LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 9 Crashes after VI calls a dll

Hi all,

 

Currently Running;

- Labview 2009 v9.0 (32b)

- Win XP v2002 SP3 (Dual Core, 2GB Ram)

 

initialise.jpg

 

Situation: Trying to implement the following function prototype as can be seen above.

initialize(LStrHandle a_jarFile, uint32_t a_version, uint32_t a_reserved);

 

Anytime I run this VI with valid inputs, Labview just crashes! process is killed, no erros, no windows send report, nothing.

If i was to build the VI into an .exe, then running the .exe with the same valid inputs doesn't crash .exe and i'm able to run it over and over.

 

I tested the dll call using C code and it works with no crashes. (code can be found here http://forums.ni.com/t5/LabVIEW/LabView-LStrHandle-Memory-Allocation/m-p/1617122)

Also I tested the above VI (not the exe) on 4 other machines; 3 winXP and all 3 of them kill the labview process. 1 Win7, and that one didn't crash, it worked as expected with proper return value (zero for succees)

 

Any ideas would be greatly appreciated.

 

0 Kudos
Message 1 of 5
(2,665 Views)

Hi sayo9394,

 

What different inputs have you tried to the dll?  Does anything function correctly? Can you simplify the dll to each function to see which one is causing the error?  What program are you using to write the dll?  Thanks!

 

Kim

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,648 Views)

Hi Kim,

 

Thank you for your reply. The dll is provided by the client and I have no control on breaking it down or simplifying it.

The DLL functions correctly when wrong inputs have been provided. it does it's error checks and spits out an int error code to define the error.

 

Its only when I provide the correct inputs, it kills labview process.

I believe the function call uses the Java Native Interface (JNI) to access code which is written in Scala.

 

Is there any debugging tools where i can send you the trace?

 

Thanks you.

 

Simon 

0 Kudos
Message 3 of 5
(2,623 Views)

Hi again,

 

I couldn't edit the post, so here is some extra info;

 

The function called from the dll locates and loads the JVM, and starts up our main loop, which is responsible for dispatching incoming requests to the hardware being tested.  It does not attempt to communicate with the hardware until a request comes in through the DLL.  It requires that Java be installed somewhere on the PC (which we know is the case from the C test).  It shouldn't require that LabView load anything.

 

 

0 Kudos
Message 4 of 5
(2,617 Views)

So i've managed to get an updated DLL and JAR file with more debugging capabilities. 

 

Running the VI with the "library function node" refering to the new dll, popped an error message saying: "Unable to create Java Virtual Machine

 

Again, this doesn't seem to be an issue when running that same vi and dll as an .exe, or running the same dll with C code compiled in gcc and VC++ 2010 express.

0 Kudos
Message 5 of 5
(2,608 Views)