Re: StackOverflow in a plugin using JNI

Posted by Albert Cardona on
URL: http://imagej.273.s1.nabble.com/StackOverflow-in-a-plugin-using-JNI-tp3700336p3700337.html

Jeremy,

C code is sneaky, particularly arrays, and even more particularly when
passing them to and from the JVM. I recommend you to use valgrind on
your C program first, and then to check very carefully when are you
freeing the arrays that you pass to and from the JVM, and whether you
are doing so exactly in compliance with the JNI guidelines.

The fact that the C code runs fine in one situation and not in another
is very symptomatic of improper memory deallocation, and of modifying
values beyond the limits of an array.

Hope it helps.

Albert