Skip to content

videotoolbox: unaligned access warning from ubsan


(lldb) bt
* thread #17, name = 'vlc-input', stop reason = Misaligned pointer use
  * frame #0: 0x00000001015d0a80 libclang_rt.asan_osx_dynamic.dylib`__ubsan_on_report
    frame #1: 0x00000001015d0a5c libclang_rt.asan_osx_dynamic.dylib`__ubsan::UndefinedBehaviorReport::UndefinedBehaviorReport(char const*, __ubsan::Location&, __sanitizer::InternalScopedString&) + 176
    frame #2: 0x00000001015cc5a4 libclang_rt.asan_osx_dynamic.dylib`__ubsan::Diag::~Diag() + 244
    frame #3: 0x00000001015cdba8 libclang_rt.asan_osx_dynamic.dylib`handleTypeMismatchImpl(__ubsan::TypeMismatchData*, unsigned long, __ubsan::ReportOptions) + 876
    frame #4: 0x00000001015cd830 libclang_rt.asan_osx_dynamic.dylib`__ubsan_handle_type_mismatch_v1 + 40
    frame #5: 0x00000001226acdd0 libvideotoolbox_plugin.dylib`pic_pacer_Init(pic_pacer=0x000060b0002316a4) at pacer.c:42:32 [opt]
    frame #6: 0x000000012268e2d4 libvideotoolbox_plugin.dylib`OpenDecoder [inlined] CreateVideoContext(p_dec=0x000061b00017fb80) at decoder.c:1294:5 [opt]
    frame #7: 0x000000012268e054 libvideotoolbox_plugin.dylib`OpenDecoder(p_this=0x000061b00017fb80) at decoder.c:1374:13 [opt]
    frame #8: 0x0000000100db4cfc libvlccore.dylib`generic_start(func=<unavailable>, forced=<unavailable>, ap=<unavailable>) at modules.c:261:11 [opt]
    frame #9: 0x0000000100db4810 libvlccore.dylib`vlc_module_load(log=<unavailable>, capability=<unavailable>, name="any", strict=<unavailable>, probe=<unavailable>) at modules.c:230:15 [opt]
    frame #10: 0x0000000100db4aac libvlccore.dylib`module_need(obj=0x000061b00017fb80, cap=<unavailable>, name=<unavailable>, strict=<unavailable>) at modules.c:272:24 [opt]
    frame #11: 0x0000000100e3bc8c libvlccore.dylib`LoadDecoder [inlined] module_need_var(obj=0x000061b00017fb80, cap=<unavailable>, varname=<unavailable>) at vlc_modules.h:109:19 [opt]
    frame #12: 0x0000000100e3bc40 libvlccore.dylib`LoadDecoder(p_dec=0x000061b00017fb80, b_packetizer=<unavailable>, fmt_in=<unavailable>) at decoder.c:394:27 [opt]
    frame #13: 0x0000000100e37ea4 libvlccore.dylib`CreateDecoder(p_parent=<unavailable>, cfg=0x00000001711ad440) at decoder.c:2046:9 [opt]
    frame #14: 0x0000000100e290c8 libvlccore.dylib`decoder_New(p_parent=0x000061e000015080, cfg=0x00000001711ad440) at decoder.c:2207:36 [opt]
    frame #15: 0x0000000100e29034 libvlccore.dylib`vlc_input_decoder_New(parent=<unavailable>, cfg=<unavailable>) at decoder.c:2266:12 [opt] [artificial]
    frame #16: 0x0000000100e6ff44 libvlccore.dylib`EsOutCreateDecoder(p_sys=0x0000614000015640, p_es=<unavailable>) at es_out.c:2314:15 [opt]
    frame #17: 0x0000000100e75480 libvlccore.dylib`EsOutSelectEs(p_sys=0x0000614000015640, es=<unavailable>, b_force=<unavailable>, vout_order=<unavailable>) at es_out.c:2460:5 [opt]
    frame #18: 0x0000000100e6d5d4 libvlccore.dylib`EsOutSelect(p_sys=<unavailable>, es=<unavailable>, b_force=<unavailable>) at es_out.c:2700:13 [opt]
    frame #19: 0x0000000100e69344 libvlccore.dylib`EsOutVaPrivControlLocked(p_sys=<unavailable>, source=<unavailable>, query=<unavailable>, args=<unavailable>) at es_out.c:3688:13 [opt]
    frame #20: 0x0000000100e62df8 libvlccore.dylib`EsOutPrivControl(out=<unavailable>, source=0x0000000000000000, query=65536, args="\U00000002") at es_out.c:3997:15 [opt]
    frame #21: 0x0000000100ea5d28 libvlccore.dylib`es_out_in_PrivControl [inlined] es_out_in_vaPrivControl(out=0x00006140000157d0, in=0x0000000000000000, i_query=65536, args=<unavailable>) at es_out_timeshift.c:478:12 [opt]
    frame #22: 0x0000000100ea5cd4 libvlccore.dylib`es_out_in_PrivControl(p_out=<unavailable>, in=<unavailable>, i_query=<unavailable>) at es_out_timeshift.c:489:16 [opt]
    frame #23: 0x0000000100ea5304 libvlccore.dylib`CmdExecutePrivControl(p_sys=<unavailable>, p_cmd=<unavailable>) at es_out_timeshift.c:0 [opt]
    frame #24: 0x0000000100e9f260 libvlccore.dylib`PrivControl at es_out_timeshift.c:769:16 [opt]
    frame #25: 0x0000000100e9eb00 libvlccore.dylib`PrivControl(p_tsout=<unavailable>, in=<unavailable>, i_query=<unavailable>, args=<unavailable>) at es_out_timeshift.c:828:13 [opt]
    frame #26: 0x0000000100ed1ab8 libvlccore.dylib`es_out_PrivControl [inlined] es_out_vaPrivControl(out=0x000060b000230018, query=65536, args=<unavailable>) at es_out.h:125:12 [opt]
    frame #27: 0x0000000100ed1a64 libvlccore.dylib`es_out_PrivControl(out=<unavailable>, query=<unavailable>) at es_out.h:133:18 [opt]
    frame #28: 0x0000000100eb9898 libvlccore.dylib`Init [inlined] es_out_SetMode(out=<unavailable>, i_mode=2) at es_out.h:141:17 [opt]
    frame #29: 0x0000000100eb988c libvlccore.dylib`Init [inlined] InitPrograms(p_input=<unavailable>) at input.c:1262:5 [opt]
    frame #30: 0x0000000100eb8e8c libvlccore.dylib`Init(p_input=0x000061e000015080) at input.c:1354:9 [opt]
    frame #31: 0x0000000100eaefa4 libvlccore.dylib`Run(data=0x000061e000015080) at input.c:418:10 [opt]
    frame #32: 0x000000010159185c libclang_rt.asan_osx_dynamic.dylib`asan_thread_start(void*) + 68
    frame #33: 0x0000000183c7ef94 libsystem_pthread.dylib`_pthread_start + 136
(lldb) up
frame #1: 0x00000001015d0a5c libclang_rt.asan_osx_dynamic.dylib`__ubsan::UndefinedBehaviorReport::UndefinedBehaviorReport(char const*, __ubsan::Location&, __sanitizer::InternalScopedString&) + 176
libclang_rt.asan_osx_dynamic.dylib`__ubsan::UndefinedBehaviorReport::UndefinedBehaviorReport:
->  0x1015d0a5c <+176>: mov    x0, x19
    0x1015d0a60 <+180>: ldp    x29, x30, [sp, #0x30]
    0x1015d0a64 <+184>: ldp    x20, x19, [sp, #0x20]
    0x1015d0a68 <+188>: ldp    x22, x21, [sp, #0x10]
(lldb) 
frame #2: 0x00000001015cc5a4 libclang_rt.asan_osx_dynamic.dylib`__ubsan::Diag::~Diag() + 244
libclang_rt.asan_osx_dynamic.dylib`__ubsan::Diag::~Diag:
->  0x1015cc5a4 <+244>: ldr    x8, [sp, #0x78]
    0x1015cc5a8 <+248>: cbnz   x8, 0x1015cc5e4 ; <+308>
    0x1015cc5ac <+252>: ldr    x8, [sp, #0x70]
    0x1015cc5b0 <+256>: cbz    x8, 0x1015cc5bc ; <+268>
(lldb) 
frame #3: 0x00000001015cdba8 libclang_rt.asan_osx_dynamic.dylib`handleTypeMismatchImpl(__ubsan::TypeMismatchData*, unsigned long, __ubsan::ReportOptions) + 876
libclang_rt.asan_osx_dynamic.dylib`handleTypeMismatchImpl:
->  0x1015cdba8 <+876>: cbnz   x19, 0x1015cda84 ; <+584>
    0x1015cdbac <+880>: b      0x1015cdadc    ; <+672>
    0x1015cdbb0 <+884>: adrp   x0, 24
    0x1015cdbb4 <+888>: add    x0, x0, #0x494 ; "/AppleInternal/Library/BuildRoots/bd680bd8-563b-11ef-bf16-8a553ba56670/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/compiler-rt/lib/ubsan/ubsan_diag.h"
(lldb) 
frame #4: 0x00000001015cd830 libclang_rt.asan_osx_dynamic.dylib`__ubsan_handle_type_mismatch_v1 + 40
libclang_rt.asan_osx_dynamic.dylib`__ubsan_handle_type_mismatch_v1:
->  0x1015cd830 <+40>: ldp    x29, x30, [sp, #0x20]
    0x1015cd834 <+44>: add    sp, sp, #0x30
    0x1015cd838 <+48>: retab  

libclang_rt.asan_osx_dynamic.dylib`handleTypeMismatchImpl:
    0x1015cd83c <+0>:  pacibsp 
(lldb) 
warning: libvideotoolbox_plugin.dylib was compiled with optimization - stepping may behave oddly; variables may not be available.
frame #5: 0x00000001226acdd0 libvideotoolbox_plugin.dylib`pic_pacer_Init(pic_pacer=0x000060b0002316a4) at pacer.c:42:32 [opt]
   39  	
   40  	void pic_pacer_Init(struct pic_pacer *pic_pacer)
   41  	{
-> 42  	   vlc_mutex_init(&pic_pacer->lock);
   43  	   vlc_cond_init(&pic_pacer->wait);
   44  	   pic_pacer->nb_fields_out = 0;
   45  	   pic_pacer->allocated_fields_max = 6 /* pics */ * 2;
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information