Project

General

Profile

Actions

Bug #1695

open

SIGSEGV from NULL punit->goto_tile

Added by John Robertson 3 months ago. Updated 25 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Server
Target version:
-
Start date:
09/29/2025
Due date:
% Done:

0%

Estimated time:

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

1695.patch (1.23 KB) 1695.patch John Robertson, 09/29/2025 04:03 AM

Related issues 4 (1 open3 closed)

Related to Bug #1741: Server crash due to animal kingdom aiClosedMarko Lindqvist11/16/2025

Actions
Related to Feature #1750: sanitycheck.c: Check that goto_tile is set for ACTIVITY_GOTOClosedMarko Lindqvist11/19/2025

Actions
Related to Bug #1766: handle_unit_change_activity_real() may keep ACTIVITY_GOTO after clearing goto_tileIn ReviewMarko Lindqvist11/23/2025

Actions
Related to Feature #1769: savegame: version-gate log message about ACTIVITY_GOTO vs goto_tile inconsistencyClosedMarko Lindqvist11/24/2025

Actions
Actions #1

Updated by John Robertson 3 months ago

Actions #2

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

Actions #3

Updated by Marko Lindqvist 3 months ago

Do you have a savegame where this can be easily reproduced?

Actions #4

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.)

Actions #5

Updated by John Robertson 2 months ago

If I find this symptom in set I am working with now, I will upload it.

Actions #6

Updated by Marko Lindqvist 29 days ago

  • Related to Bug #1741: Server crash due to animal kingdom ai added
Actions #7

Updated by Marko Lindqvist 29 days ago

#1741 ends to same invasion_funct() crash, and is reproducible from a savegame.

Actions #8

Updated by Marko Lindqvist 27 days ago

  • Related to Feature #1750: sanitycheck.c: Check that goto_tile is set for ACTIVITY_GOTO added
Actions #9

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().

Actions #10

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
Actions #11

Updated by Marko Lindqvist 22 days ago

  • Related to Feature #1769: savegame: version-gate log message about ACTIVITY_GOTO vs goto_tile inconsistency added
Actions

Also available in: Atom PDF