alliedmodders/hl2sdk

BMS EmitGameSound crash

Alienmario opened this issue · 6 comments

EmitGameSound* functions in Black Mesa crash the server.
Same sound plays correctly via playgamesound command.
I'm guessing it could be CSGO code like with trace functions in #70 .

Test code
soundtest.txt

Throttle
Thread 0 (crashed):
0: jit_code_3890720768_1048576 + 0xf64e0
https://crash.limetech.org/qdvzopc5s77y

SM 1.11.0.6562
Metamod 1.10.7-dev

I'll preface this with saying that I haven't had time to do any testing or debugging. However, from a look at the binary, it seems they added a few fields to CSoundParametersInternal. That could cause issues if the game's SoundEmitterSystem is trying to write past the bounds of our allocated struct.

The new fields do seem to be specific to BMS, but they did also add the Flush functionality from CS:GO to completely reload sounds. I pushed an update with both of those things now.

So, how can I test this from a sm plugin?

So, how can I test this from a sm plugin?

The latest SM dev builds (1.11.0.6621 for example) should have this change. They use the latest version of the SDK at the time of building. Try your test case on that.

No luck. Tested on both windows and linux.