ValveSoftware / steam-audio

Steam Audio
https://valvesoftware.github.io/steam-audio/
Apache License 2.0
2.2k stars 152 forks source link

Segfault in phonon_test #351

Closed jkammerland closed 1 month ago

jkammerland commented 1 month ago

Steps To Reproduce Fedora 40 Linux

Steps to reproduce the behavior:

  1. Build with no optional deps
  2. Run "gdb phonon_test"

Program received signal SIGSEGV, Segmentation fault. ipl::ArrayMath::addConstant (size=129, in=0x7ffff62c5244, constant=constant@entry=9.99999972e-10, out=0x7ffff62c5244) at XX/YY/steam-audio/core/src/core/array_math.cpp:273 273 float4::store(&out[i], float4::add(float4::load(&in[i]), simdConstant));

Or just the test itself

HRTFDatabase.test.cpp:24: FAILED: due to a fatal error condition: SIGSEGV - Segmentation violation signal

=============================================================================== test cases: 40 | 39 passed | 1 failed assertions: 231 | 230 passed | 1 failed

wolframw commented 1 month ago

Interestingly, the crash does not happen when using the unaligned variants of load and store (float4::loadu and float4::storeu), even though the memory seems to be correctly aligned.

lakulish commented 1 month ago

@wolframw That is indeed the issue: we end up issuing aligned load instructions for unaligned memory addresses. I'm working on a fix.

jkammerland commented 1 month ago

Thanks for looking into this and fixing 😊

Great library btw