nativelibs4java / BridJ

BridJ: blazing fast Java / C / C++ interop
https://code.google.com/archive/p/bridj/
Other
289 stars 77 forks source link

bridj register fails with -Xcheck:jni - FATAL ERROR in native method: Static field ID passed to JNI #83

Open kevemueller opened 8 years ago

kevemueller commented 8 years ago

while looking for reasons of why the call to C code fails, I set -Xcheck:jni on the JVM. With this set, BridJ.register dies very early:

FATAL ERROR in native method: Static field ID passed to JNI
at org.bridj.JNI.bindJavaMethodsToCFunctions(Native Method)
at org.bridj.NativeEntities.addDefinitions(NativeEntities.java:149)
at org.bridj.CRuntime.register(CRuntime.java:468)
- locked <0x00000007ac30e868> (a org.bridj.cpp.CPPRuntime)
at org.bridj.CRuntime.register(CRuntime.java:345)
at org.bridj.BridJ.register(BridJ.java:355)
at org.bridj.BridJ.register(BridJ.java:192)
- locked <0x00000007abdf1998> (a java.lang.Class for org.bridj.BridJ)        

BridJ should not conflict with -Xcheck:jni

CypraxPuch commented 8 years ago

do you have some progress in this?

Schwaller commented 6 years ago

This is really annoying if you have a project which mixes JNI and BridJ. Please find a solution to this!