JNI_CreateJavaVM: Buffer overrun if I throw an exception in case of failure
- by Dominik Fretz
Hi,
In a C++ project, I use the JNI invocation API to launch a JVM. I've done a little wrapper arount the JVM so I can use all the needed parts in a OO fashion. So far that works great.
Now, if the JVM does not start (JNI_CreateJavaVM returns a value < 0) I'd like to raise an exception within my C++ code.But if I throw an exception after JNI_CreateJavaVM, I get a buffer overrun. If I raise the exception without the JNI_CreateJavaVM call, it works as expected.
Does anyone have a clue on what the issue could be here? Or how to debug this?
Environment: Windows, Visual Studio 2008
JDK: jrockit27.6jdk16005, but happens with SUN stock one as well
Cheers
Dominik