Skip to content

Instantly share code, notes, and snippets.

@lambdaprime
Last active May 27, 2019 23:17
Show Gist options
  • Save lambdaprime/e9c709cc6c5fafebdd16b2468a2cbb72 to your computer and use it in GitHub Desktop.
Save lambdaprime/e9c709cc6c5fafebdd16b2468a2cbb72 to your computer and use it in GitHub Desktop.
Bug in libopencv_java320

Following lines did not work for me:

Mat img = new Mat();
Dictionary dictionary = Aruco.getPredefinedDictionary(Aruco.DICT_7X7_50);
Aruco.drawMarker(dictionary, 1, 200, img);

The process crashed with:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f2f7a02bed8, pid=2665, tid=2675
#
# JRE version: OpenJDK Runtime Environment (11.0+28) (build 11+28)
# Java VM: OpenJDK 64-Bit Server VM (11+28, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libopencv_java320.so+0xabed8]
#
# 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/lambdaprime/workspace/ImageKitKat/core.2665)
#
# 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.
#

---------------  S U M M A R Y ------------

Command Line: -Dfile.encoding=UTF-8 XXX

Host: Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz, 8 cores, 7G, Ubuntu 18.04.1 LTS
Time: Sat May 11 18:08:14 2019 PDT elapsed time: 11 seconds (0d 0h 0m 11s)

---------------  T H R E A D  ---------------

Current thread (0x00007f2fa4012000):  JavaThread "main" [_thread_in_native, id=2675, stack(0x00007f2faa9cc000,0x00007f2faaacd000)]

Stack: [0x00007f2faa9cc000,0x00007f2faaacd000],  sp=0x00007f2faaacb7f0,  free space=1021k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libopencv_java320.so+0xabed8]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.opencv.aruco.Aruco.drawMarker_1(JIIJ)V+0 opencv@320
j  org.opencv.aruco.Aruco.drawMarker(Lorg/opencv/aruco/Dictionary;IILorg/opencv/core/Mat;)V+10 opencv@320
j  XXX.main([Ljava/lang/String;)V+27 ImageKitKat
v  ~StubRoutines::call_stub

siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x00007f2f795db000

Register to memory mapping:

RAX=0x0000000000003bbf is an unknown value
RBX=0x00007f2fa48930c0 points into unknown readable memory
RCX=0x00007f2f795cc108: <offset 0x0000000000239108> in /usr/lib/x86_64-linux-gnu/libopencv_aruco.so.3.2 at 0x00007f2f79393000
RDX=0x0000000000003bbe is an unknown value
RSP=0x00007f2faaacb7f0 is pointing into the stack for thread: 0x00007f2fa4012000
RBP=0x00007f2fa4893180 points into unknown readable memory
RSI=0x00007f2f7a02ec55: Java_org_opencv_aruco_Aruco_drawMarker_11+0x00000000000000c5 in /usr/lib/jni/libopencv_java320.so at 0x00007f2f79f80000
RDI=0x00007f2fa4893180 points into unknown readable memory
R8 =0x00007f2faaacb2b0 is pointing into the stack for thread: 0x00007f2fa4012000
R9 =0x00007f2faaacb1c0 is pointing into the stack for thread: 0x00007f2fa4012000
R10=0x00007f2f472ea1b0: <offset 0x00000000002171b0> in /lib/x86_64-linux-gnu/libgcc_s.so.1 at 0x00007f2f470d3000
R11=0x00007f2f7a02ec14: Java_org_opencv_aruco_Aruco_drawMarker_11+0x0000000000000084 in /usr/lib/jni/libopencv_java320.so at 0x00007f2f79f80000
R12=0x0000000000000064 is an unknown value
R13=0x00007f2fa4012340 points into unknown readable memory
R14=0x00007f2faaacb930 is pointing into the stack for thread: 0x00007f2fa4012000
R15=0x00007f2fa4012000 is a thread

The problem was solved once I upgraded to Opencv 4.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment