Bug #1695
openSIGSEGV from NULL punit->goto_tile
0%
Description
[3.3.90.5-dev]
Occasionally, especially in a long game, goto units get stuck in "G" goto mode, but going nowhere. This seems to be some downstream fallout. This fix does not address how the pointer gets set to null, just guards against the use of a NULL pointer.
Files
Updated by John Robertson 3 months ago
In case it ends up helpful, here is the back trace of the stack:
#0 invasion_funct (ait=ait@entry=0x555555b09260 <ai_types>, punit=punit@entry=0x5556123c2bd0, dest=dest@entry=true, radius=radius@entry=0, which=0) at ../../../ai/default/daiunit.c:1037
#1 find_something_to_kill (ait=ait@entry=0x555555b09260 <ai_types>, pplayer=pplayer@entry=0x55560c4871f0,
punit=punit@entry=0x55556137b4c0, pdest_tile=pdest_tile@entry=0x7fffffffd570, ppath=ppath@entry=0x7fffffffd578,
pferrymap=pferrymap@entry=0x0, pferryboat=0x7fffffffd580, pboattype=0x0, pmove_time=0x0) at ../../../ai/default/daiunit.c:1251
#2 dai_military_attack (ait=ait@entry=0x555555b09260 <ai_types>, pplayer=pplayer@entry=0x55560c4871f0,
punit=punit@entry=0x55556137b4c0) at ../../../ai/default/daiunit.c:1797
#3 dai_manage_military (ait=0x555555b09260 <ai_types>, nmap=<optimized out>, pplayer=0x55560c4871f0,
punit=0x55556137b4c0) at ../../../ai/default/daiunit.c:2590
#4 dai_manage_units (ait=ait@entry=0x555555b09260 <ai_types>, pplayer=pplayer@entry=0x55560c4871f0)
at ../../../ai/default/daiunit.c:2917
#5 dai_do_first_activities (ait=0x555555b09260 <ai_types>, pplayer=pplayer@entry=0x55560c4871f0)
at ../../../ai/default/daihand.c:757
#6 cai_do_first_activities (pplayer=0x55560c4871f0) at ../../../ai/classic/classicai.c:450
#7 ai_start_phase () at ../../server/srv_main.c:1144
#8 begin_phase (is_new_phase=<optimized out>) at ../../server/srv_main.c:1398
#9 srv_running () at ../../server/srv_main.c:2948
#10 srv_main () at ../../server/srv_main.c:3604
#11 main (argc=<optimized out>, argv=0x7fffffffdb88) at ../../server/srv_entrypoint.c:362
Updated by Marko Lindqvist 3 months ago
Do you have a savegame where this can be easily reproduced?
Updated by John Robertson 2 months ago
regrets, I have recently deleted it. I will change my habit and start attaching them.
(It probably has around 10K units, that I am playing around with.)
Updated by John Robertson 2 months ago
If I find this symptom in set I am working with now, I will upload it.
Updated by Marko Lindqvist 29 days ago
- Related to Bug #1741: Server crash due to animal kingdom ai added
Updated by Marko Lindqvist 29 days ago
#1741 ends to same invasion_funct() crash, and is reproducible from a savegame.
Updated by Marko Lindqvist 27 days ago
- Related to Feature #1750: sanitycheck.c: Check that goto_tile is set for ACTIVITY_GOTO added
Updated by Marko Lindqvist 25 days ago
Instead of silently (not letting anyone to know about it) ignoring such error situation, and doing not-necessarily-sane arrangements to "fix" the situation, I would handle this by adding fc_assert_ret() to invasion_funct().
Updated by Marko Lindqvist 22 days ago
- Related to Bug #1766: handle_unit_change_activity_real() may keep ACTIVITY_GOTO after clearing goto_tile added
Updated by Marko Lindqvist 22 days ago
- Related to Feature #1769: savegame: version-gate log message about ACTIVITY_GOTO vs goto_tile inconsistency added