libelektra: JNI: Plugin Test Fails
Steps to Reproduce the Problem
-
Set the environment variable
JAVA_HOMEexport JAVA_HOME=$(/usr/libexec/java_home | tr -d '\n') -
Clone the repository
git clone https://github.com/ElektraInitiative/libelektra.git -
Create build directory
mkdir -p build -
Create the build system using the following command
cd build cmake .. \ -GNinja \ -DENABLE_ASAN=OFF \ -DENABLE_LOGGER=OFF \ -DENABLE_DEBUG=ON \ -DENABLE_TESTING=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DBUILD_PDF=OFF \ -DPDFLATEX_COMPILER=`which latexmk` \ -DPDFLATEX_COMPILER_OPTIONS='-pdf;-f;-quiet' \ -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 \ -DTOOLS=ALL \ -DBINDINGS="ALL;-swig_python2;-swig_ruby" \ -DPLUGINS="ALL" -
Compile Elektra
ninja -
Run
testmod_jnictest -V -R testmod_jni
Expected Result
Everything works fine and the test finishes successfully.
Actual Result
The test fails displaying the output below.
test 61
Start 61: testmod_jni
61: Test command: Elektra/build/bin/testmod_jni "Elektra/src/plugins/jni"
61: Test timeout computed to be: 1500
61: JNI TESTS
61: ==================
61:
61: There are 1 warnings
61: buffer is: warnings/#00
61: number: 11
61: description: open of plugin returned unsuccessfully (reason contains plugin, see other warnings for details)
61: ingroup: kdb
61: module:
61: file: ../src/libs/elektra/plugin.c
61: line: 297
61: reason: jni
61: reason:
61: reason:
61: ../src/plugins/jni/testmod_jni.c:31: error in test_helloWorld: warnings in kdbOpen for plugin jni
61: number: 102
61: description: : jni/java error
61: ingroup: : plugin
61: module: : jni
61: at: ../src/plugins/jni/jni.c:236
61: reason: : Cannot find class elektra/plugin/Return
61: mountpoint: :
61: configfile: :
61: ../src/plugins/jni/testmod_jni.c:31: error in test_helloWorld: error in kdbOpen for plugin jni
61: ../src/plugins/jni/testmod_jni.c:31: fatal in test_helloWorld: could not open jni plugin
1/1 Test #61: testmod_jni ......................***Failed 0.09 sec
0% tests passed, 1 tests failed out of 1
Label Time Summary:
memleak = 0.09 sec (1 test)
Total Test time (real) = 0.10 sec
The following tests FAILED:
61 - testmod_jni (Failed)
Errors while running CTest
System Information
- Elektra Version: master
- OS: macOS 10.12
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (17 by maintainers)
Commits related to this issue
- jni: avoid segfault when open fails see #1466 — committed to ElektraInitiative/libelektra by deleted user 7 years ago
- jni: avoid segfault in get see #1466 — committed to ElektraInitiative/libelektra by deleted user 7 years ago
- Revert "jni: avoid segfault when open fails" This reverts commit fa1fa6d9ca9a63fa175f1c70b05c9ef57966acac. see #1466 — committed to ElektraInitiative/libelektra by deleted user 7 years ago
- jni: disable broken test see #1466 — committed to ElektraInitiative/libelektra by deleted user 7 years ago
- jni: avoid warning see #1466 — committed to ElektraInitiative/libelektra by deleted user 7 years ago
I think you are right. According to
testmod_jni.h.inthe plugin uses the variableslibelektra_jarandjna. The first is set incorrectly to the absolute path of
build/src/bindings/jna/libelektra.jar, the latter is not set at all. As far as I can tell the variablejnawas removed in pull request #1238.Thank you! Seems like
openfails and it crashes when callingcloselater. I tried to fix the segfault, but it won’t fix the actual cause of the error duringopen.If you want, you can rerun it and post the error. But it is unlikely to give success soon, and we agreed that this plugin is not important. So better to not waste time on it.
I just did that. The core dump is 6.68GB large. What should I do with this file?