I'm currently developing a JNI native library in C++ in order to use an original library from a third vendor. I'm trying to perform a very simple operation, just calling a concrete method from the original library from a Java sample application.
The same test in C++ is working fine, so I assume the vendor library is working correctly. But if I perform exactly the same code from within my native library using JNI, it give a crash like this:
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x000000371c880580, pid=17095, tid=1077307712
# JRE version: 6.0_27-b07
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.2-b06 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libc.so.6+0x80580] wchar_t+0x0
I think this is telling me that there was an error in the native library, more concrete in the libc.so library which is part of the GNU C++ compiler used to generate the native library. I don't know what the "wchar_t" wants to mean, since I know that is a primitive type for wide chars. It might be that the error is related to the use of this primitive within the vendor library?
The compilation options that I'm using are the following:
I played around with those ones, without success so far. I debugged the native code and I know the crash is coming when I call a constructor of a C++ class of the vendor library. Is there something I could do about this? BTW, on Windows is working fine, but indeed, the vendor library is a different one. I've got the impression that there's something in the JNI wrapper of the JDK6 that I'm using that makes the vendor library to crash, either that or something wrong with the compilation of my native library.