Skip to content

Address sanitizer error in first-frame-is-SID testcases for SBA

There is an address error in the pytest testcases for SBA where the bitstream is cut to start with an SID frame. This may randomly cause crashes on windows.

How to reproduce:

make clean
make -j CLANG=2
python3 tests/prepare_pytests.py

results in (snippet only):

 ==================================================================================================
	IVAS Codec Baseline
 
	Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,
	Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
	==================================================================================================

	=================================================================
	==702785==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000151919c at pc 0x0000007e44c4 bp 0x7fff326bd150 sp 0x7fff326bd148
	READ of size 2 at 0x00000151919c thread T0
	   #0 0x7e44c3 in ivas_spar_md_dec_process /local/knj/ivas-codec2/lib_dec/ivas_spar_md_dec.c:675:77
	   #1 0x7cdbdf in ivas_spar_dec_MD /local/knj/ivas-codec2/lib_dec/ivas_spar_decoder.c:742:9
	   #2 0x7ccb71 in ivas_spar_dec /local/knj/ivas-codec2/lib_dec/ivas_spar_decoder.c:329:5
	   #3 0x61437b in ivas_dec /local/knj/ivas-codec2/lib_dec/ivas_dec.c:350:28
	   #4 0x51777d in IVAS_DEC_GetSamples /local/knj/ivas-codec2/lib_dec/lib_dec.c:853:24
	   #5 0x50ec72 in decodeG192 /local/knj/ivas-codec2/apps/decoder.c:1727:24
	   #6 0x4fd8ac in main /local/knj/ivas-codec2/apps/decoder.c:641:17
	   #7 0x7f4f31b51d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09)
	   #8 0x41e609 in _start (/local/knj/ivas-codec2/IVAS_dec+0x41e609)

	0x00000151919c is located 4 bytes to the left of global variable 'ivas_spar_br_table_consts' defined in 'lib_com/ivas_rom_com.c:886:28' (0x15191a0) of size 2080
	0x00000151919c is located 220 bytes to the right of global variable 'c_weights' defined in 'lib_com/ivas_rom_com.c:880:13' (0x1518d00) of size 960
	SUMMARY: AddressSanitizer: global-buffer-overflow /local/knj/ivas-codec2/lib_dec/ivas_spar_md_dec.c:675:77 in ivas_spar_md_dec_process
	Shadow bytes around the buggy address:
	 0x00008029b1e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	 0x00008029b1f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	 0x00008029b200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	 0x00008029b210: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 f9
	 0x00008029b220: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
	=>0x00008029b230: f9 f9 f9[f9]00 00 00 00 00 00 00 00 00 00 00 00
	 0x00008029b240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	 0x00008029b250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	 0x00008029b260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	 0x00008029b270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	 0x00008029b280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
	Shadow byte legend (one shadow byte represents 8 application bytes):
	 Addressable:           00
	 Partially addressable: 01 02 03 04 05 06 07 
	 Heap left redzone:       fa
	 Freed heap region:       fd
	 Stack left redzone:      f1
	 Stack mid redzone:       f2
	 Stack right redzone:     f3
	 Stack after return:      f5
	 Stack use after scope:   f8
	 Global redzone:          f9
	 Global init order:       f6
	 Poisoned by user:        f7
	 Container overflow:      fc
	 Array cookie:            ac
	 Intra object redzone:    bb
	 ASan internal:           fe
	 Left alloca redzone:     ca
	 Right alloca redzone:    cb
	 Shadow gap:              cc
	==702785==ABORTING