beyond-all-reason / beyond-all-reason/RecoilEngine
EngineCrash [master f83afe1] at RenderUnitDestroyed on synthetic test
- Dominant language
- C++
- Stars
- 683
- Forks
- 293
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
Found a case where the engine crashes, probably not very worrying since it just happens on a synthetic test and likely the situation won't happen in a real game.
crash at: `rts/Lua/LuaHandle.cpp:1925 CLuaHandle::RenderUnitDestroyed(CUnit const*)`
Seems to be because of clearing the map just after the unit selfd, likely between when the unit is "destroyed" and the callin runs. I guess the unit is expected to still be there but the test map clearing already deleted it itself.
### Reproducing
- Take [test_crash.lua](https://github.com/saurtron/Beyond-All-Reason/blob/test-crash/luaui/Widgets/Tests/crash/test_crash.lua) and place under BAR.sdd/luaui/Widgets/Tests/crash/
- Start skirmish in neverend mode
- Call `/runtests test_crash`
Should crash during the first run, although the test runs the procedure 5 times just in case.
Contributor guide
Research direction
Start at rts/Lua/LuaHandle.cpp:1925 in CLuaHandle::RenderUnitDestroyed and reproduce the crash with test_crash.lua under BAR.sdd/luaui/Widgets/Tests/crash/. Inspect the timing between unit self-destruction, test-map clearing, and the callback. Done means the synthetic test can run repeatedly without the engine crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, lua
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100