[libbluray-devel] BDJ menus on MacOS

glenn pygr at sonic.net
Sat Feb 8 20:14:37 CET 2020


Using the debugger in Xcode isn’t as transparent as expected. Stepping into 

result = JNI_CreateJavaVM_fp(jvm, (void**) env, &args);

stalls execution. On the other hand, when bdj_test is run from the command line using the exact same libbluray.dylib, execution proceeds further.

In that case, libbluray.dylib gets to

cls = (*env)->FindClass(env,"java/awt/BDFontMetrics") (in register_native.c, _register_methods() 

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()

 cls = (*env)->FindClass(env, "org/videolan/Logger");

and 

cls = (*env)->FindClass(env, "org/videolan/Libbluray");

which return without issue.

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.


> On Jan 27, 2020, at 1:54 PM, glenn <pygr at sonic.net> wrote:
> 
> Perhaps I’m making progress. 
> 
> 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 https://code.videolan.org/videolan/libbluray/blob/master/src/libbluray/bdj/bdj.c: <https://code.videolan.org/videolan/libbluray/blob/master/src/libbluray/bdj/bdj.c:> 
> 
>> result = JNI_CreateJavaVM_fp(jvm, (void**) env, &args);
> 
> The parameters in the call look like they have reasonable non null values. 
> 
> Executing that line puts
> 
>> ->  0x1100002b4: movl   (%rsi), %eax
>>     0x1100002b6: leaq   0xf8(%rbp), %rsi
>>     0x1100002bd: vmovdqu %ymm0, (%rsi)
>>     0x1100002c1: vmovdqu %ymm7, 0x20(%rsi)
>>     0x1100002c6: vmovdqu %ymm8, 0x40(%rsi)
>>     0x1100002cb: vmovdqu %ymm15, 0x60(%rsi)
> 
> 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.
> 
> I get the feeling that somehow the interface to Java is misconfigured in my setup.
> 
> Glenn

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20200208/8327bbd4/attachment.html>


More information about the libbluray-devel mailing list