Robosturm / Commander_Wars

The aim of this project is to create an Advance Wars Clone with a lot of additions customizations and modding support. For Contact Inforamtion see the wiki page. Take a view on the game.
https://github.com/Robosturm/Commander_Wars/releases
GNU Lesser General Public License v3.0
217 stars 32 forks source link

Game crashing when battle animations are loaded (v33.1) #1712

Closed lonewolf19991 closed 7 months ago

lonewolf19991 commented 11 months ago

Describe the bug When the animations are loaded, the game seems to crash at semi random times, with the following output on the console: Assertion 's' failed at ../src/pulse/stream.c:1705, function pa_stream_writable_size(). Aborting.

I checked to make sure it wasn't a mod issue, I disabled any mods in the game. This version is also directly the binary generated by the Github actions.

To Reproduce Steps to reproduce the behavior:

  1. Create a new match between two COs
  2. Make 2 units engage in combat while the battle animations are enabled
  3. The battle animations will load, but randomly crash the game with the output above
  4. See error

Expected behavior The game should not crash if the animations are being loaded

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Robosturm commented 11 months ago

This is a crash in the pulse linux audio lib. Produced either by qt with linux or by your custom compilation. Sadly the code works on windows. So I can't reproduce it. Muting sounds should solve the crash

lonewolf19991 commented 11 months ago

It's the github generated binary. Where should I look into the source code, to try and fix this, assuming it's an interaction between the source code and pulse audio? My guess is audiomanager.cpp or is there another file handling that part of the game?

Robosturm commented 11 months ago

The file would be this https://github.com/Robosturm/Commander_Wars/blob/master/coreengine/sounds/ondemandsound.cpp The issue is mostlikely in the stop function. My guess is that either qt or the pulse lib don't register the stop destroy calls correctly and still put data on the output qudio stream which got killed already which leads to the crash. And since it depends on if the backend code puts data on the output or not it randomly crashes. The issue is that I'm terminatibg things correctly

lonewolf19991 commented 10 months ago

The v34 compilation here: https://github.com/Robosturm/Commander_Wars/releases/tag/Beta_34_0_Build1 Doesn't crash when the sounds are played anymore, however the thread that handles the audio probably still does, so audio can stop playing at times. I have this suspicion might have to do with memory addresses' handling.