New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segfault when mounting plugins #3881
Comments
@tucek How were you able to mount plugins? Did the commands in the README.md work for you? |
I get this too. According to the backtrace from libelektra/src/plugins/jni/jni.c Line 79 in 618e6f6
I have no idea how this could cause a segfault and the more I have to deal with the |
Ok, then we should write in the release notes that it is currently not possible to actually mount plugins written in Java, pointing to this issue. (@mpranj, can you add this please?)
This would have been an important information when I asked about testing JNI 14 days ago. (#3825 (review))
Can you post the backtrace here please?
We don't know what the cause is yet but yes, it could be that the segfaults stem from several initialization of the jni plugin (and as such also the JVM) during mounting. |
@markus2330 |
The unit tests and |
I look at it again, and it seems I had an error in my command line. The Here is the backtrace:
If I use this command line instead:
($PWD since, I used a local install; replace $PWD with /usr or /usr/local if installed system-wide) I get a different segfault (not immediately, the process runs for about 1 sec before the segfault). But the backtrace for this segfault is somewhere within libjvm.so and only contains The only other noteworthy detail is that libelektra/src/plugins/jni/jni.c Lines 312 to 320 in 618e6f6
This is true in general, but the JNI plugin seems so broken I honestly doubt anybody is actually using it. |
The JNI plugin currently has "discouraged" but my idea was to improve the status quo and to get it to a working status again. Seems like the expectations were not communicated clearly. |
Is something like this fine for the release notes: Note that it is currently not possible to mount plugins written in Java (see #3881). |
It might have to do something with the JNA dependencies. For testing the jni plugin, we are using a fat jar including all required dependencies (like JNA). while
using the fat jar including all dependencies (which is currently not installed, but build only for us in the testmod_jni)
@kodebach do you have any clue about the |
Probably JNI needs to be linked with |
please have a quick look at the changes in #3884 - did I fail to link JNI with ${CMAKE_THREAD_LIBS_INIT} or is it just not solving the problem? |
So something similar (target_link_libraries ${CMAKE_THREAD_LIBS_INIT}) also needs to be done in src/tools/kdb/CMakeLists.txt |
- if jni plugin is included, kdb is built with ${CMAKE_THREAD_LIBS_INIT} (for shared builds) - libelektra-${KDB_VERSION}-all.jar fat jar is now installed when jna bindings are included
please see changes in #3884 |
- if jni plugin is included, kdb is built with ${CMAKE_THREAD_LIBS_INIT} (for shared builds) - libelektra-${KDB_VERSION}-all.jar fat jar is now installed when jna bindings are included
- if jni plugin is included, kdb is built with ${CMAKE_THREAD_LIBS_INIT} (for shared builds) - libelektra-${KDB_VERSION}-all.jar fat jar is now installed when jna bindings are included
- if jni plugin is included, kdb is built with ${CMAKE_THREAD_LIBS_INIT} (for shared builds) - libelektra-${KDB_VERSION}-all.jar fat jar is now installed when jna bindings are included
Is this still an issue? I think this issue can be closed due to mounting java plugins via the process plugin. |
Thank you, yes this is fixed now! 🎆 |
Steps to Reproduce the Problem
I tried to do what is described in the README.md of the JNI plugin, e.g.:
Expected Result
That I can mount JNI plugins and use them.
Actual Result
Segfaults without usable backtrace.
System Information
The text was updated successfully, but these errors were encountered: