#48300: Autoattack: Invalid memory read Open Date: 2023-06-27 02:15 Last Update: 2023-07-21 23:16 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/48300 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48300 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2023-07-21 23:16 Updated by: cazfi * Resolution Update from Accepted to Fixed * Status Update from Open to Closed --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: cazfi Type: Bugs Status: Closed Priority: 5 - Medium MileStone: 3.0.9 Component: Server Severity: 5 - Medium Resolution: Fixed --------------------------------------------------------------------- Ticket details: Valgrind about S3_2 autogame. Autoattack was enabled on that game (like the unit_survive_autoattack() in the backtrace likely reveals) ==1536407== Invalid read of size 4 ==1536407== at 0x231F2A: occupy_move.part.0 (unithand.c:509) ==1536407== by 0x234C0B: occupy_move (unithand.c:497) ==1536407== by 0x234C0B: do_attack (unithand.c:5157) ==1536407== by 0x23D799: unit_perform_action (unithand.c:3859) ==1536407== by 0x1C52CE: action_auto_perf_unit_do (actiontools.c:1064) ==1536407== by 0x17A7C8: unit_survive_autoattack (unittools.c:3443) ==1536407== by 0x17A7C8: unit_move (unittools.c:4254) ==1536407== by 0x23CA81: unit_do_regular_move (unithand.c:5485) ==1536407== by 0x23CA81: unit_perform_action (unithand.c:3909) ==1536407== by 0x23EF4A: unit_do_action (unithand.c:3272) ==1536407== by 0x297BCB: dai_unit_move (aitools.c:1273) ==1536407== by 0x18874A: adv_unit_execute_path (advgoto.c:126) ==1536407== by 0x2B355E: dai_military_rampage (daiunit.c:614) ==1536407== by 0x2B6C8A: dai_military_attack (daiunit.c:1763) ==1536407== by 0x2B86C9: dai_manage_military (daiunit.c:2547) ==1536407== by 0x2BA418: dai_manage_unit (daiunit.c:2710) ==1536407== by 0x2BCEFF: dai_manage_units (daiunit.c:2858) ==1536407== by 0x29192D: dai_do_first_activities (aihand.c:756) ==1536407== by 0x23FBC2: cai_do_first_activities (classicai.c:447) ==1536407== by 0x16033C: ai_start_phase (srv_main.c:1096) ==1536407== by 0x16033C: begin_phase (srv_main.c:1346) ==1536407== by 0x16033C: srv_running (srv_main.c:2888) ==1536407== by 0x16033C: srv_main (srv_main.c:3541) ==1536407== by 0x153F7D: main (civserver.c:388) ==1536407== Address 0xd5ce188 is 72 bytes inside a block of size 336 free'd ==1536407== at 0x484317B: free (vg_replace_malloc.c:872) ==1536407== by 0x3F0A31: unit_virtual_destroy (unit.c:1703) ==1536407== by 0x1780E4: server_remove_unit_full (unittools.c:1928) ==1536407== by 0x17B7CF: wipe_unit_full (unittools.c:2072) ==1536407== by 0x17CA00: wipe_unit (unittools.c:2191) ==1536407== by 0x17CA00: kill_unit (unittools.c:2378) ==1536407== by 0x234530: do_attack (unithand.c:5132) ==1536407== by 0x23D799: unit_perform_action (unithand.c:3859) ==1536407== by 0x1C52CE: action_auto_perf_unit_do (actiontools.c:1064) ==1536407== by 0x17A7C8: unit_survive_autoattack (unittools.c:3443) ==1536407== by 0x17A7C8: unit_move (unittools.c:4254) ==1536407== by 0x23CA81: unit_do_regular_move (unithand.c:5485) ==1536407== by 0x23CA81: unit_perform_action (unithand.c:3909) ==1536407== by 0x1C5197: action_auto_perf_unit_do (actiontools.c:1051) ==1536407== by 0x231F19: occupy_move.part.0 (unithand.c:505) ==1536407== by 0x234C0B: occupy_move (unithand.c:497) ==1536407== by 0x234C0B: do_attack (unithand.c:5157) ==1536407== by 0x23D799: unit_perform_action (unithand.c:3859) ==1536407== by 0x1C52CE: action_auto_perf_unit_do (actiontools.c:1064) ==1536407== by 0x17A7C8: unit_survive_autoattack (unittools.c:3443) ==1536407== by 0x17A7C8: unit_move (unittools.c:4254) ==1536407== by 0x23CA81: unit_do_regular_move (unithand.c:5485) ==1536407== by 0x23CA81: unit_perform_action (unithand.c:3909) ==1536407== by 0x23EF4A: unit_do_action (unithand.c:3272) ==1536407== by 0x297BCB: dai_unit_move (aitools.c:1273) ==1536407== by 0x18874A: adv_unit_execute_path (advgoto.c:126) ==1536407== by 0x2B355E: dai_military_rampage (daiunit.c:614) ==1536407== by 0x2B6C8A: dai_military_attack (daiunit.c:1763) ==1536407== by 0x2B86C9: dai_manage_military (daiunit.c:2547) ==1536407== by 0x2BA418: dai_manage_unit (daiunit.c:2710) ==1536407== by 0x2BCEFF: dai_manage_units (daiunit.c:2858) ==1536407== Block was alloc'd at ==1536407== at 0x48455EF: calloc (vg_replace_malloc.c:1328) ==1536407== by 0x4020A9: fc_real_malloc (mem.c:89) ==1536407== by 0x4020A9: fc_real_calloc (mem.c:138) ==1536407== by 0x3EEFEB: unit_virtual_create (unit.c:1574) ==1536407== by 0x17722A: unit_virtual_prepare (unittools.c:1725) ==1536407== by 0x181365: unit_change_owner (unittools.c:2262) ==1536407== by 0x28188F: diplomat_bribe (diplomats.c:712) ==1536407== by 0x23CF65: unit_perform_action (unithand.c:3629) ==1536407== by 0x23EF4A: unit_do_action (unithand.c:3272) ==1536407== by 0x2C834F: dai_diplomat_bribe_nearby (aidiplomat.c:690) ==1536407== by 0x2C834F: dai_manage_diplomat (aidiplomat.c:739) ==1536407== by 0x2BA271: dai_manage_unit (daiunit.c:2667) ==1536407== by 0x2BCEFF: dai_manage_units (daiunit.c:2858) ==1536407== by 0x29192D: dai_do_first_activities (aihand.c:756) ==1536407== by 0x23FBC2: cai_do_first_activities (classicai.c:447) ==1536407== by 0x16033C: ai_start_phase (srv_main.c:1096) ==1536407== by 0x16033C: begin_phase (srv_main.c:1346) ==1536407== by 0x16033C: srv_running (srv_main.c:2888) ==1536407== by 0x16033C: srv_main (srv_main.c:3541) ==1536407== by 0x153F7D: main (civserver.c:388) -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/48300 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48300