MSAN: use-of-uninitialized-value in SBA rate switching with FER decoding
Basic info
- Commit SHA: main
- Platform: all (need linux for sanitiser)
Bug description
MSAN (CLANG1) reports this error when decoding rate switching SBA with FER to any output.
Frames processed: 2367 ==2758847==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x8e18ed in ivas_spar_chk_zero_coefs reporoot/lib_dec/ivas_spar_md_dec.c:1016:22
#1 0x8d1040 in ivas_dec_mono_sba_handling reporoot/lib_dec/ivas_spar_md_dec.c:770:30
#2 0x8ca580 in ivas_spar_md_dec_process reporoot/lib_dec/ivas_spar_md_dec.c:867:5
#3 0x8a5db9 in ivas_spar_dec_MD reporoot/lib_dec/ivas_spar_decoder.c:808:9
#4 0x8a481d in ivas_spar_dec reporoot/lib_dec/ivas_spar_decoder.c:389:5
#5 0x6050a0 in ivas_dec reporoot/lib_dec/ivas_dec.c:409:28
#6 0x4fb1d1 in IVAS_DEC_GetSamples reporoot/lib_dec/lib_dec.c:856:24
#7 0x4eb772 in decodeG192 reporoot/apps/decoder.c:2085:24
#8 0x4d9c1a in main reporoot/apps/decoder.c:743:17
#9 0x7f3d92647082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#10 0x45657d in _start (reporoot/build-msan/IVAS_dec+0x45657d)
SUMMARY: MemorySanitizer: use-of-uninitialized-value reporoot/lib_dec/ivas_spar_md_dec.c:1016:22 in ivas_spar_chk_zero_coefs
Ways to reproduce
Problem was detected in the sanitiser job here https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/jobs/136442
I could locally replicate the issue with following steps
cmake . -Bbuild-msan -DCMAKE_C_COMPILER=clang -DCLANG=msan
cmake --build build-msan -- -j40
cd build-msan
./IVAS_cod -sba 3 -max_band FB ../scripts/switchPaths/sw_13k2_512k.bin 48 ltv48_HOA3.wav debugsba.bts
./IVAS_dec -FEC 5 MONO 48 debugsba.bts out.wav
As usual, ltv48_HOA3.wav needs to be obtained from the ivas-pc-testfiles repo.