<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Using the debugger in Xcode isn’t as transparent as expected. Stepping into <div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><span class="" style="background-color: rgb(255, 255, 255);">result = JNI_CreateJavaVM_fp(jvm, (</span><span class="" style="background-color: rgb(255, 255, 255);"><b class="">void</b></span><span class="" style="background-color: rgb(255, 255, 255);">**) env, &args);</span></div></blockquote><div class=""><br class=""></div><div class="">stalls execution. On the other hand, when bdj_test is run from the command line using the exact same libbluray.dylib, execution proceeds further.<div class=""><br class=""></div><div class=""><div class="">In that case, libbluray.dylib gets to </div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class="">cls = (*env)->FindClass(env,"java/awt/BDFontMetrics")<font face="Menlo" style="font-size: 11px;" class=""> </font>(in register_native.c, _register_methods() </div></div></blockquote><div class=""><br class=""></div>in register_native.c, _register_methods(), at which point execution can’t go further. What’s interesting is that that hang is preceded by execution of two other calls to FindClass()<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> cls = (*env)->FindClass(env, "org/videolan/Logger");</span></div></div></blockquote><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">and </span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">cls = (*env)->FindClass(env, "org/videolan/Libbluray");</span></div></div></blockquote><div class=""><div class=""><div><br class=""></div><div>which return without issue.</div><div><br class=""></div><div>Taking libbluray-awt-j2se-1.1.2.jar and libbluray-j2se-1.1.2.jar from inside VLC.app and copying them to /usr/local/share/java doesn’t improve matters for libbluray.dylib. VLC and libluray.dylib both make use of those same two jar files and both use adoptopenjdk-8, but VLC succeeds at reading Blu-Ray menus, and libbluray on a Mac doesn’t.</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 27, 2020, at 1:54 PM, glenn <<a href="mailto:pygr@sonic.net" class="">pygr@sonic.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Perhaps I’m making progress. <div class=""><br class=""></div><div class="">I’ve ported over the source to Xcode so its debugger can be used (I couldn’t figure out how to codesign gdb so it could be used). The libbluray source files now build OK into a dylib with Xcode. Using the built in debugger, the code can be single stepped until it gets a SIGSEGV at the line corresponding to line 955 of <a href="https://code.videolan.org/videolan/libbluray/blob/master/src/libbluray/bdj/bdj.c:" class="">https://code.videolan.org/videolan/libbluray/blob/master/src/libbluray/bdj/bdj.c:</a> <div class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class=""><blockquote type="cite" class=""><font class=""><span style="background-color: rgb(255, 255, 255);" class="">result = JNI_CreateJavaVM_fp(jvm, (</span><span style="background-color: rgb(255, 255, 255);" class=""><b class="">void</b></span><span style="background-color: rgb(255, 255, 255);" class="">**) env, &args);</span></font></blockquote><br class=""></div><div class="">The parameters in the call look like they have reasonable non null values. </div><div class=""><br class=""></div><div class="">Executing that line puts</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""></div></div><blockquote type="cite" class=""><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><font class="">->  0x1100002b4: movl   (%rsi), %eax</font></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><font class="">    0x1100002b6: leaq   0xf8(%rbp), %rsi</font></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><font class="">    0x1100002bd: vmovdqu %ymm0, (%rsi)</font></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><font class="">    0x1100002c1: vmovdqu %ymm7, 0x20(%rsi)</font></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><font class="">    0x1100002c6: vmovdqu %ymm8, 0x40(%rsi)</font></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><font class="">    0x1100002cb: vmovdqu %ymm15, 0x60(%rsi)</font></div></div></blockquote><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">in the editor window, indicating thread 1, 0x1100002b4. That hex number doesn’t seem to be reasonable for anything in the program’s or system’s address space. If I’m reading things right, the value stored in %rsi is 0 and the value stored in %rbp is 0x000000010611a190.</div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">I get the feeling that somehow the interface to Java is misconfigured in my setup.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">Glenn</div></div></div></blockquote></div><br class=""></div></div></div></body></html>