Skip to content

[CLANG18] MSAN: use-of-uninitialized-value in lib_dec/hq_hr_dec_fx.c:632:5

Basic info

  • Fixed point:
    • Encoder (fixed): n/a
    • Decoder (fixed): 20caaf8d (branch basop-2383-clang18-msan-use-of-uninitialized-value-in-lib_dec-dec_tcx_fx-c-1098-13)

⚠️ Note: This is a follow-up to #2283, and needs to have the patch from !2771 (merged) in place! ⚠️

Bug description

MSAN reports use-of-uninitialized-value in hq_hr_dec_fx.c, line 632:

==4028368==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5589eb2d2b5e in hq_hr_dec_fx /home/ame-tmp2/mul/ivas/basop/issue_2382/ivas-basop/lib_dec/hq_hr_dec_fx.c:632:5
#1 0x5589eb2b5d7b in hq_core_dec_fx /home/ame-tmp2/mul/ivas/basop/issue_2382/ivas-basop/lib_dec/hq_core_dec_fx.c:211:13
#2 0x5589eb20917a in evs_dec_fx /home/ame-tmp2/mul/ivas/basop/issue_2382/ivas-basop/lib_dec/evs_dec_fx.c:340:13
#3 0x5589eafb86c9 in evs_dec_main_fx /home/ame-tmp2/mul/ivas/basop/issue_2382/ivas-basop/lib_dec/lib_dec_fx.c:5609:13
#4 0x5589eafb45f3 in IVAS_DEC_GetSamplesDecoder /home/ame-tmp2/mul/ivas/basop/issue_2382/ivas-basop/lib_dec/lib_dec_fx.c:3889:13
#5 0x5589eaf5e62e in decodeG192 /home/ame-tmp2/mul/ivas/basop/issue_2382/ivas-basop/apps/decoder.c:2290:32
#6 0x5589eaf43fc1 in main /home/ame-tmp2/mul/ivas/basop/issue_2382/ivas-basop/apps/decoder.c:684:17
#7 0x7f2383759d79 in __libc_start_main csu/../csu/libc-start.c:308:16
#8 0x5589eaea7479 in _start (/home/ame-tmp2/mul/ivas/basop/issue_2382/ivas-basop/IVAS_dec+0x3b479) (BuildId: 0d1bef7ce978521cb5b4e892842b205497b175e6)

The culprit seems to be hq_generic_offset, which is not set in all cases inside hq_configure_evs_fx().

Ways to reproduce

Bitstream: stvST48c.wav_Stereo_downmix_to_bit_exact_EVS_at_24400_kbps_48kHz_in_48kHz_out.192

make CLANG=1 -j

IVAS_dec 48 stvST48c.wav_Stereo_downmix_to_bit_exact_EVS_at_24400_kbps_48kHz_in_48kHz_out.192 out.wav
Edited by multrus