serivesmejia / EOCV-Sim

FTC Library EasyOpenCV simulator for testing vision pipelines in a computer
MIT License
12 stars 8 forks source link

Fails to load native library on Linux x64 #2

Closed Windwoes closed 3 years ago

Windwoes commented 3 years ago
00:00  INFO: [EOCVSim] Initializing EOCV Sim v1.0.0

00:00  INFO: [SysUtil] Copying native lib "linux64_opencv_java440.so"
00:00  INFO: [SysUtil] Copy of linux64_opencv_java440 cancelled since file already exists

00:00  INFO: [SysUtil] Loading native lib "linux64_opencv_java440.so"
00:00 ERROR: [SysUtil] Failure loading lib "linux64_opencv_java440", retrying with different architecture... (0 attempts)
00:00  INFO: [SysUtil] Copying native lib "linux32_opencv_java440.so"

00:00  INFO: [SysUtil] Loading native lib "linux32_opencv_java440.so"
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/linux64_opencv_java440.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
java.lang.UnsatisfiedLinkError: /tmp/linux64_opencv_java440.so: /tmp/linux64_opencv_java440.so: invalid ELF header (Possible cause: endianness mismatch)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at com.github.serivesmejia.eocvsim.util.SysUtil.loadLib(SysUtil.java:90)
    at com.github.serivesmejia.eocvsim.util.SysUtil.loadCvNativeLib(SysUtil.java:55)
    at com.github.serivesmejia.eocvsim.EOCVSim.init(EOCVSim.java:43)
    at com.github.serivesmejia.eocvsim.Main.main(Main.java:8)
serivesmejia commented 3 years ago

Can you try downloading it manually from here and replacing the one in src/resources/libs with the new one you downloaded ? Maybe it's getting corrupted in the download (or copying?) process.

Also, which distribution are you using ?

EDIT: It seems like you already tried to run it before (because of the "cancelled since it already exist" message), did it failed too on that first attempt ?

serivesmejia commented 3 years ago

Oh, and also, delete the copied linux64_opencv_java440.so file in the /tmp dir

(Tested again on a Ubuntu 18.04 machine with a fresh clone, deleted the copied library at /tmp, no problems appeared)

Windwoes commented 3 years ago

Sorry I've been busy, will get back to you soon

serivesmejia commented 3 years ago

Sorry I've been busy, will get back to you soon

Ok, np ;)

serivesmejia commented 3 years ago

I was able to reproduce the issue with a fresh install of Xubuntu 20.04, I'll look forward to fix that issue and try to recompile the .so lib.

serivesmejia commented 3 years ago

Hi! Sorry, I’ve been busy in the last days, could you try cloning the repo again, remove the copied library at /tmp/linux64_opencv_java440.so file and run the simulator?

Windwoes commented 3 years ago

Just tried it. Fails to load the native library with:

java.lang.UnsatisfiedLinkError: /tmp/linux64_opencv_java440.so: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/linux64_opencv_java440.so)
Windwoes commented 3 years ago

Looks like the current native lib you're using requires Ubuntu 20.04, and I was on 18.04.