radium226 / dlib-java

Java wrapper for the DLib library
GNU General Public License v3.0
12 stars 14 forks source link

Fatal error when running the java-jar #5

Open voglinio opened 4 years ago

voglinio commented 4 years ago

Hello and thank you for your attempt to solve a tricky problem: porting dlib to Java. I 've followed your instructions and with a little tweaks from here and there I managed to compile everything into jar files. I am working on an Ubuntu 18.04 machine using the following:

Java

java version "11.0.4" 2019-07-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)

GCC

gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SWIG

SWIG Version 3.0.12
Copyright (c) 1995-1998
University of Utah and the Regents of the University of California
Copyright (c) 1998-2005
University of Chicago
Copyright (c) 2005-2006
Arizona Board of Regents (University of Arizona)

OpenCV libopencv_java401.so opencv-401.jar

Dlib libdlib.so.19.16.0 The strange message that I see and I would like your help about is the following:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x00007f6ad3b7373b, pid=53488, tid=53489
#
# JRE version: Java(TM) SE Runtime Environment (11.0.4+10) (build 11.0.4+10-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.4+10-LTS, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libdlib.so.19.16.0+0x17773b]  dlib::logger_helper_stuff::helper::helper()+0x9b
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/voglis/dlib-java/core.53488)
#
# An error report file with more information is saved as:
# /home/voglis/dlib-java/hs_err_pid53488.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
./dlib-java: line 211: 53488 Aborted                 (core dumped) LD_LIBRARY_PATH="/tmp/opencv/usr/lib:/tmp/opencv/usr/lib/opencv4:/tmp/opencv/usr/share/java/opencv4:/tmp/dlib/usr/lib" java -jar "dlib/target/dlib-1.0-SNAPSHOT.jar" "$( find . -name "lena.jpg" -print | head -n1 )"

The issue points here dlib::logger_helper_stuff::helper::helper() and before digging further I would like to have your opinion. There is also an error log file written, from which I attach the most interesting part:

Current thread (0x00007f00a8011800):  JavaThread "main" [_thread_in_native, id=42212, stack(0x00007f00b01b6000,0x00007f00b02b7000)]

Stack: [0x00007f00b01b6000,0x00007f00b02b7000],  sp=0x00007f00b02b4290,  free space=1016k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libdlib.so.19.16.0+0x17773b]  dlib::logger_helper_stuff::helper::helper()+0x9b

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.lang.ClassLoader$NativeLibrary.load0(Ljava/lang/String;Z)Z+0 java.base@11.0.4
j  java.lang.ClassLoader$NativeLibrary.load()Z+53 java.base@11.0.4
j  java.lang.ClassLoader$NativeLibrary.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)Z+216 java.base@11.0.4
j  java.lang.ClassLoader.loadLibrary0(Ljava/lang/Class;Ljava/io/File;)Z+46 java.base@11.0.4
j  java.lang.ClassLoader.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)V+312 java.base@11.0.4
j  java.lang.Runtime.loadLibrary0(Ljava/lang/Class;Ljava/lang/String;)V+54 java.base@11.0.4
j  java.lang.System.loadLibrary(Ljava/lang/String;)V+7 java.base@11.0.4
j  com.github.radium226.commons.Libraries.lambda$static$0(Ljava/lang/String;)V+1
j  com.github.radium226.commons.Libraries$$Lambda$1.loadLibrary(Ljava/lang/String;)V+1
j  com.github.radium226.commons.Libraries.loadLibrary(Ljava/lang/String;)V+37
j  com.github.radium226.dlib.DLib.loadLibraries()V+46
j  com.github.radium226.dlib.examples.Showcase.main([Ljava/lang/String;)V+0
v  ~StubRoutines::call_stub

siginfo: si_signo: 4 (SIGILL), si_code: 2 (ILL_ILLOPN), si_addr: 0x00007f002eca573b

Thank you in advance

Costas

voglinio commented 4 years ago

I suspect that is a an instruction set incompatibility...