Bug #1693
openSIGSEGV in begin_phase from autoattack loss.
0%
Description
[3.3.90.5-dev]
During the begin_phase, an autoattack from movement can delete a unit that is later accessed after being freed.
- Added 'alive' checks after the unit delete to guard against use of deleted pointer.
- Corrected the return value of adv_follow_path() to return FALSE when the unit had been deleted, instead of returning TRUE, which encouraged use of deleted pointer.
- Moved the processing for unit_attack_civilian_casualties(), which dereferences the unit pointer ahead of kill_unit() call that deletes the unit.
Files
Updated by John Robertson 3 months ago
- File 1693.v2.patch 1693.v2.patch added
Found the same issue in the end_phase.
Updated by Marko Lindqvist 7 days ago
- Target version deleted (
3.2.2)
Sounds like a bugs in adv_unit_execute_path() and unit_survive_autoattack() if you can't rely on their return value to be what it's supposed to be. Fix the issue in its root instead of adding hacky solution to the caller side.
You move around code block and its comment stating "Now that dead defender is certainly no longer listed as unit supported by the city..." ignoring the very comment. In it's new location before collect ransom handling the comment is no longer true, and the code is buggy.
Can you attach a savegame where your original issue can be reproduced?
Updated by John Robertson 6 days ago
- File 1693.v2.patch 1693.v2.patch added
Changed to fc_asserts to catch condition and ask for submission of saved games.
Updated by John Robertson 6 days ago
- File 1693.v3.patch 1693.v3.patch added
apologies for the confusion, retry on patch.