Skip to content

USAN: nan value out of range for type short in stereo to mono decoding

Basic info

Bug description

Clang usan sanitizer test in pipeline found an error:

lib_com/tools.c:429:20: runtime error: -nan is outside the range of representable values of type 'short'
SUMMARY: UndefinedBehaviorSanitizer: float-cast-overflow lib_com/tools.c:429:20 in 

Error happens in frame 4546 at ivas_jbm_dec.c:1540 when copying the synthesis output which consists of mostly nan values. The usan error is probably just a symptom of the actual problem - having most of the synthesis be nan basically results in a garbage signal, here it is apparently zero in the output: Screenshot_2024-02-19_at_14.43.16

Link to test pipeline: https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/jobs/218855

Ways to reproduce

Using the scripts:

dly_profile.dat

python3 scripts/IvasBuildAndRunChecks.py --checks CLANG3 -m stereo_b32_64_fb_rs -p /path/to/my/local/ci_linux_ltv_local.json --usan_supp_file scripts/ubsan.supp -J dly_profile.dat

or directly:

make clean
make -j CLANG=3
./IVAS_cod -stereo -max_band fb scripts/switchPaths/sw_fb1.bin 48 ltv48_STEREO.wav bit
networkSimulator_g192 dly_profile.dat bit bit_err tracefile_sim 1 
./IVAS_dec -VOIP mono 48 bit_err out.wav
Edited by Jan Kiene