Segfault in battle
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Sorry to disturb the rc1 party but I found a bug. :-(
When soldiers are fighting a segfault can occur when the battle only consists of one soldier.
To be more specific:
In src/logic/
1256 Soldier& opponent = *battle_
The call might return nullptr when the other soldier is no longer part of the battle (in my cases it was the first_ soldier in battle_ who was missing / pointed to 0x0). The description of the method contains "Can return nullptr, but I have no idea what that means." which is what is happening here.
Since someone was aware of (part of) the issue there might be a check for nullptr missing in soldier.cc. Otherwise there is probably some cancel-battle-code somewhere which is missing the part of removing the other soldier. Does anyone has an idea which of the cases applies?
Sadly I can not provide any more information about what was happening since I wasn't observing the game. However, GDB is still running if that is any use.
Edit: Happens in build-19-rc1
Related branches
- Widelands Developers: Pending requested
-
Diff: 100 lines (+22/-16)1 file modifiedsrc/logic/map_objects/tribes/soldier.cc (+22/-16)
- Widelands Developers: Pending requested
-
Diff: 131 lines (+23/-19)3 files modifiedsrc/logic/map_objects/tribes/battle.cc (+10/-9)
src/logic/map_objects/tribes/battle.h (+4/-4)
src/logic/map_objects/tribes/soldier.cc (+9/-6)
description: | updated |
Changed in widelands: | |
status: | New → In Progress |
Changed in widelands: | |
status: | In Progress → Confirmed |
milestone: | build19-rc2 → build20-rc1 |
Changed in widelands: | |
status: | Confirmed → In Progress |
Changed in widelands: | |
status: | In Progress → Fix Committed |
assignee: | GunChleoc (gunchleoc) → nobody |
A backtrace could help.
Do you have an autosave too?