USAN in ivas_sba_dec_render_fx
# Basic info Follow-up of #1528 <!--- Add commit SHA used to reproduce--> - Float reference: - Encoder (float): 2e062fa279923ebc9b39600e34d44c36cc145de2 (Tue May 13 11:29:38) - Decoder (float): 2e062fa279923ebc9b39600e34d44c36cc145de2 (Tue May 13 11:29:38) - Fixed point: - Decoder (fixed): 3116b82817ea5888f96ead516ecac0fad6a3ce60 (Wed May 21 07:47:14) # Bug description A USAN error is detected in the BASOP decoder with this stv test case: ```bash pytest "tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OSBA 2OA 2ISM bitrate switching, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out, JBM Prof 5]" --update_ref 1 -n 1 pytest "tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-OSBA 2OA 2ISM bitrate switching, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out, JBM Prof 5]" -n 1 --dut_encoder_path IVAS_cod_ref ``` To build BASOP execs for USAN test: ```shell export UBSAN_OPTIONS="suppressions=scripts/ubsan_basop.supp,report_error_type=1,print_stacktrace=1" python3 scripts/basop_create_ignorelist_for_ubsan.py make clean make -j CLANG=3 IGNORELIST=1 ``` The USAN error stacktrace can also be obtained directly with the supplied bitstreams: [bs.dectrace](/uploads/4ca9137138e951515ff1009f0a348c32/bs.dectrace) [bs.netsimout](/uploads/eefd94f835233d4698ea8f12b188031e/bs.netsimout) ``` IVAS_dec -Tracefile bs.dectrace -VOIP BINAURAL_ROOM_REVERB 48 bs.netsimout out.wav <snip> lib_dec/ivas_sba_dec_fx.c:917:59: runtime error: applying non-zero offset 960 to null pointer #0 0x85cd93 in ivas_sba_dec_render_fx /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/lib_dec/ivas_sba_dec_fx.c:917:59 #1 0x76a73f in ivas_osba_dirac_td_binaural_jbm_fx /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/lib_dec/ivas_osba_dec_fx.c:154:5 #2 0x5ef6df in ivas_jbm_dec_flush_renderer_fx /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/lib_dec/ivas_jbm_dec_fx.c:2809:13 #3 0x84a0ca in ivas_sba_dec_reconfigure_fx /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/lib_dec/ivas_sba_dec_fx.c:243:35 #4 0x4e34f2 in ivas_dec_setup /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/lib_dec/ivas_init_dec.c:280:17 #5 0x4441a7 in IVAS_DEC_Setup /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/lib_dec/lib_dec_fx.c:1258:13 #6 0x44377c in IVAS_DEC_GetSamples /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/lib_dec/lib_dec_fx.c:1049:13 #7 0x447946 in IVAS_DEC_VoIP_GetSamples /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/lib_dec/lib_dec_fx.c:2861:13 #8 0x436f9c in decodeVoIP /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/apps/decoder.c:2343:24 #9 0x42bc2f in main /mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/apps/decoder.c:573:17 #10 0x7fe33a565d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16 #11 0x7fe33a565e3f in __libc_start_main csu/../csu/libc-start.c:392:3 #12 0x4045e4 in _start (/mnt/c/Users/eerikno/OneDrive - Ericsson/code/ivas-basop/ivas-basop/IVAS_dec+0x4045e4) SUMMARY: UndefinedBehaviorSanitizer: nullptr-with-nonzero-offset lib_dec/ivas_sba_dec_fx.c:917:59 in 1011 <snip> ``` # Ways to reproduce Either run the pytest above, or just build the BASOP decoder with USAN options enabled and run <!--Commandline or script--> ```bash IVAS_dec -Tracefile bs.dectrace -VOIP BINAURAL_ROOM_REVERB 48 bs.netsimout out.wav ``` <!--- Below are labels that will be added but are not shown in description. This is a template to help fill them. Add further information to the first row and remove and add labels as necessary.-->
issue