Installation is OK check_installation. outputs all OK.
When I try to run JPL examples, FamilyMT fails.
I need to make this example run successfully, because the same error occurs also in my diploma thesis Java Program using JPL.
FamilyMT console run output:
JPL demo: FamilyMT
spawning client# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x00007f578d1074b2, pid=3007, tid=0x00007f576caf6700
# JRE version: OpenJDK Runtime Environment (8.0_191-b12) (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
# Java VM: OpenJDK 64-Bit Server VM (25.191-b12 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libswipl.so+0xb34b2] PL_thread_attach_engine+0xe2
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
# An error report file with more information is saved as:
# If you would like to submit a bug report, please visit:
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
Aborted (core dumped)
Please I desperatedly need your help!! My thesis is almost complete and I want to make it work on Linux, so to upload it to a Linux Server.
I understand that it fails when it tries to create a new Thread. Can you tell me why it aborts?
I can reproduce the problem. I still have little clue what causes it. JPL is a very complicated beast to debug which is made even worse as gdb doesn’t understand much of Java VMs. I did test on the old stable version (7.6.4), where this test works fine (after copying the missing family.pl).
You need LD_PRELOAD if you want to load foreign extensions into the Prolog image. If you do not know, try without. If loading a library you need results in a linker error and abort of the process you need it. It should point at libswipl.so
Good I found this! I worked with SWI-JPL in versions 7.6.x with success.
With Jan and others, we have many improvements to the JPL Java interface (jpl.jar) that were included in the SWI 8.x.x version. So I just managed to have time to upgrade my SWI system to it; and I encounter this exact problem: libswipl.so crashes.
Have checked with the new version in the git repo and it is fixed, thanks Jan.
@stisko, just be aware that if you use 7.6.4 (which does not have this issue) you will be using an old JPL Java interface (jar file jpl.jar) before the several updates done and released with 8.x.x. So, some of the API will not work as stated in JPL doc; for example the old implementation of the next solution iterator was not as standard in Java. Just so that you are aware.
I got the git version, compiled everything and I don’t get the crash anymore. Thanks a lot Jan for doing that fix so quickly!