libelektra: JNI: Plugin Test Fails

Steps to Reproduce the Problem

  1. Set the environment variable JAVA_HOME

    export JAVA_HOME=$(/usr/libexec/java_home | tr -d '\n')
    
  2. Clone the repository

    git clone https://github.com/ElektraInitiative/libelektra.git
    
  3. Create build directory

    mkdir -p build
    
  4. 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"
    
  5. Compile Elektra

    ninja
    
  6. Run testmod_jni

    ctest -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

Most upvoted comments

Seems like the java path is set incorrectly, it should point to the jna jar (in the build directory) via the src/plugins/jni/testmod_jni.h file in the build directory.

I think you are right. According to testmod_jni.h.in the plugin uses the variables

  • libelektra_jar and
  • jna

. 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 variable jna was removed in pull request #1238.

Thank you! Seems like open fails and it crashes when calling close later. I tried to fix the segfault, but it won’t fix the actual cause of the error during open.

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.

Could you please do as instructed and set ulimit -c unlimited for core dumps?

I just did that. The core dump is 6.68GB large. What should I do with this file?