Miscompilation with Xcode 11
Compiling libbluray 1.1.2 on macOS 10.15 (Catalina) with Xcode 11 (system compiler) leads to segmentation faults in any code using the library:
Process 76246 launched: '/tmp/a.out' (x86_64)
Process 76246 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00007fff6a103476 libdyld.dylib`stack_not_16_byte_aligned_error
libdyld.dylib`stack_not_16_byte_aligned_error:
-> 0x7fff6a103476 <+0>: movdqa %xmm0, (%rsp)
0x7fff6a10347b <+5>: int3
0x7fff6a10347c <+6>: nop
0x7fff6a10347d <+7>: nop
Target 0: (a.out) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
* frame #0: 0x00007fff6a103476 libdyld.dylib`stack_not_16_byte_aligned_error
frame #1: 0x00007ffeefbffb00
frame #2: 0x00007fff6a112405 libdyld.dylib`start + 1
Compiling the library with -fno-stack-check
works around this issue (in Xcode 11, -fstack-check
is the default behaviour).