[Freeciv-Dev] [bug #22230] pf_normal_map_move_cost crash
Update of bug #22230 (project freeciv): Status: Ready For Test = Fixed Assigned to:None = pepeto Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/bugs/?22230 ___ Message posté via/par Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22230] pf_normal_map_move_cost crash
Update of bug #22230 (project freeciv): Severity: 3 - Normal = 5 - Blocker ___ Reply to this item at: http://gna.org/bugs/?22230 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22230] pf_normal_map_move_cost crash
Follow-up Comment #1, bug #22230 (project freeciv): Here are two backtraces showing crashes in pf_normal_map_move_cost, generated from core dumps from Freeciv-web running SVN revision 25224. #0 pf_normal_map_iterate_until (ptile=0x0, pfnm=0x25bf2c0) at path_finding.c:684 pfm = 0x25bf2c0 node = optimized out #1 pf_normal_map_move_cost (pfm=0x25bf2c0, ptile=0x0) at path_finding.c:722 pfnm = 0x25bf2c0 #2 0x004e105b in find_nearest_safe_city (punit=punit@entry=0x2561ed0) at aiunit.c:1560 _MY_pf_map_ = 0x25bf2c0 ptile = 0x0 move_cost = optimized out parameter = {start_tile = 0x284a9b8, moves_left_initially = 3, fuel_left_initially = 1, move_rate = 3, fuel = 1, owner = 0x40a5e60, uclass = 0xa3c280 unit_classes+160, unit_flags = {vec = \000\000\000\000\000\000\000}, omniscience = true, get_MC = 0x576c70 normal_move, unknown_MC = 18, get_TB = 0x0, get_EC = 0x0, can_invade_tile = 0x546c70 player_can_invade_tile, get_zoc = 0x5567b0 is_my_zoc, is_pos_dangerous = 0x0, get_moves_left_req = 0x0, get_costs = 0x0, data = 0x0} pfm = 0x25bf2c0 pplayer = 0x40a5e60 pcity = optimized out best_city = 0x0 best = 10 cur = optimized out #3 0x004e142e in dai_military_attack (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x40a5e60, punit=punit@entry=0x2561ed0) at aiunit.c:1765 dest_tile = 0x284a9b8 id = 287 ct = optimized out pcity = 0x0 __FUNCTION__ = dai_military_attack #4 0x004e25e2 in dai_manage_military (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x40a5e60, punit=punit@entry=0x2561ed0) at aiunit.c:2348 id = 287 __FUNCTION__ = dai_manage_military #5 0x004e39af in dai_manage_unit (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x40a5e60, punit=punit@entry=0x2561ed0) at aiunit.c:2546 bodyguard = optimized out is_ferry = optimized out __FUNCTION__ = dai_manage_unit #6 0x004e577c in dai_manage_units (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x40a5e60) at aiunit.c:2677 punit = 0x2561ed0 punit_numbers = 0x7fff34a50df8 punit_index = optimized out #7 0x004d2d47 in dai_do_first_activities (ait=0x8c2980 ai_types, pplayer=pplayer@entry=0x40a5e60) at aihand.c:736 No locals. #8 0x004a3c13 in cai_do_first_activities (pplayer=0x40a5e60) at classicai.c:389 No locals. #9 0x0040bc22 in ai_start_phase () at srv_main.c:816 _plr_ = 0x40a5e60 MY_i = 79 pplayer = 0x40a5e60 #10 begin_phase (is_new_phase=true) at srv_main.c:979 No locals. #11 srv_running () at srv_main.c:2367 save_counter = 1 i = optimized out is_new_turn = true skip_mapimg = false eot_timer = optimized out need_send_pending_events = false #12 srv_main () at srv_main.c:2901 __FUNCTION__ = srv_main #13 0x004055b1 in main (argc=17, argv=0x7fff34a51128) at civserver.c:456 inx = 17 showhelp = optimized out showvers = optimized out option = optimized out __FUNCTION__ = main #0 pf_normal_map_iterate_until (ptile=0x0, pfnm=0x3037ed0) at path_finding.c:684 pfm = 0x3037ed0 node = optimized out #1 pf_normal_map_move_cost (pfm=0x3037ed0, ptile=0x0) at path_finding.c:722 pfnm = 0x3037ed0 #2 0x004ded73 in look_for_charge (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x1daf6f0, punit=punit@entry=0x2d8ee00, aunit=aunit@entry=0x7fff26e55918, acity=acity@entry=0x7fff26e55910) at aiunit.c:709 _MY_pf_map_ = 0x3037ed0 ptile = 0x0 move_cost = optimized out parameter = {start_tile = 0x262cab0, moves_left_initially = 3, fuel_left_initially = 1, move_rate = 3, fuel = 1, owner = 0x1daf6f0, uclass = 0xa3c280 unit_classes+160, unit_flags = {vec = \000\000\000\000\000\000\000}, omniscience = true, get_MC = 0x576c70 normal_move, unknown_MC = 18, get_TB = 0x0, get_EC = 0x0, can_invade_tile = 0x546c70 player_can_invade_tile, get_zoc = 0x5567b0 is_my_zoc, is_pos_dangerous = 0x0, get_moves_left_req = 0x0, get_costs = 0x0, data = 0x5} pfm = 0x3037ed0 pcity = optimized out best_data = 0x0 toughness = 100 def = optimized out best_def = -1 max_move_cost = 143313408 __FUNCTION__ = look_for_charge #3 0x004e2908 in dai_military_findjob (punit=0x2d8ee00, pplayer=0x1daf6f0, ait=0x8c2980 ai_types) at aiunit.c:866 acity = 0x0 aunit = 0x0 punittype = 0xa3e6f0 unit_types+4368 #4 dai_manage_military (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x1daf6f0, punit=punit@entry=0x2d8ee00) at aiunit.c:2333 id = 560 __FUNCTION__ = dai_manage_military #5
[Freeciv-Dev] [bug #22230] pf_normal_map_move_cost crash
Follow-up Comment #2, bug #22230 (project freeciv): I've tried, but can't replicate the specific crash here, but I have been able to get some other pathfinding crashes. All appear to involve ptile being NULL (as do the three attached stacktraces), which can happen (at least) when initialising the (ignored) start node after application of patch #4768. My crashes could be stopped by adjusting pf_*_map_move_cost() to return PF_IMPOSSIBLE_MC if passed a null ptile, but I suspect the bug is somewhere else, and that this only hides it, rather than fixing it. Given the change in tile_index() from patch #4678, it may be wise to add fc_assert(ptile); to the pf_*_map_move_cost() functions if the bug is fixed, as there is no sensible way to trap the error during variable assignment while iterating, and this may provide more useful guidance if similar issues appear in the future. ___ Reply to this item at: http://gna.org/bugs/?22230 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22230] pf_normal_map_move_cost crash
Follow-up Comment #3, bug #22230 (project freeciv): Here's a similar backtrace in the pathfinding code: #0 0x004ce912 in aiferry_find_boat (ait=ait@entry=0x8c2980 ai_types, punit=punit@entry=0x24e3660, cap=cap@entry=1, path=path@entry=0x0) at aiferry.c:555 radius = optimized out _MY_pf_map_ = 0x289ba80 pos = {tile = 0x7c, turn = 38680160, moves_left = 0, fuel_left = 35, total_MC = 0, total_EC = 239839072, dir_to_next_pos = 32592, dir_to_here = 800} best_turns = 10 best_id = 0 param = {start_tile = 0x2bffa38, moves_left_initially = 3, fuel_left_initially = 1, move_rate = 3, fuel = 1, owner = 0x1e43f50, uclass = 0xa3c280 unit_classes+160, unit_flags = {vec = \000\000\000\000\000\000\000}, omniscience = true, get_MC = 0x4cdf80 combined_land_sea_move, unknown_MC = 18, get_TB = 0x5770e0 no_fights_or_unknown, get_EC = 0x4ce0e0 sea_move, can_invade_tile = 0x546ca0 player_can_invade_tile, get_zoc = 0x5567e0 is_my_zoc, is_pos_dangerous = 0x0, get_moves_left_req = 0x0, get_costs = 0x0, data = 0x3af1510} search_map = 0x289ba80 pplayer = optimized out ferryboat = optimized out __FUNCTION__ = aiferry_find_boat #1 0x004e00ae in find_something_to_kill (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x1e43f50, punit=punit@entry=0x24e3660, pdest_tile=pdest_tile@entry=0x7fff82bfe2a8, ppath=ppath@entry=0x7fff82bfe2b0, pferrymap=pferrymap@entry=0x0, pferryboat=pferryboat@entry=0x7fff82bfe2b8, pboattype=pboattype@entry=0x0, pmove_time=pmove_time@entry=0x0) at aiunit.c:1216 attack_value = 30 parameter = {start_tile = 0x2bffa38, moves_left_initially = 3, fuel_left_initially = 1, move_rate = 3, fuel = 1, owner = 0x1e43f50, uclass = 0xa3c280 unit_classes+160, unit_flags = {vec = \000\000\000\000\000\000\000}, omniscience = true, get_MC = 0x5764e0 attack_move, unknown_MC = 18, get_TB = 0x0, get_EC = 0x0, can_invade_tile = 0x546ca0 player_can_invade_tile, get_zoc = 0x5567e0 is_my_zoc, is_pos_dangerous = 0x0, get_moves_left_req = 0x0, get_costs = 0x0, data = 0x0} punit_map = 0x3af1510 ferry_map = optimized out pos = {tile = 0x2e, turn = 61805840, moves_left = 0, fuel_left = 900, total_MC = 3, total_EC = 1, dir_to_next_pos = DIR8_NORTH, dir_to_here = 900} punit_class = 0xa3c280 unit_classes+160 punit_type = 0xa3e960 unit_types+4992 punit_tile = 0x2bffa38 boattype = 0x0 ferryboat = 0x0 pcity = optimized out bcost = 30 handicap = true unhap = false harbor = false go_by_boat = optimized out vulnerability = optimized out benefit = optimized out pdefender = optimized out move_time = optimized out reserves = optimized out attack = optimized out victim_count = optimized out needferry = optimized out bk = 0 want = optimized out best = 0 goto_dest_tile = 0x0 __FUNCTION__ = find_something_to_kill #2 0x004e11de in dai_military_attack (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x1e43f50, punit=punit@entry=0x24e3660) at aiunit.c:1692 start_tile = 0x2bffa38 path = 0x0 ferryboat = 0x0 dest_tile = 0x2bffa38 id = 1247 ct = 10 pcity = 0x0 __FUNCTION__ = dai_military_attack #3 0x004e2612 in dai_manage_military (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x1e43f50, punit=punit@entry=0x24e3660) at aiunit.c:2348 id = 1247 __FUNCTION__ = dai_manage_military #4 0x004e39df in dai_manage_unit (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x1e43f50, punit=punit@entry=0x24e3660) at aiunit.c:2546 bodyguard = optimized out is_ferry = optimized out __FUNCTION__ = dai_manage_unit #5 0x004e57ac in dai_manage_units (ait=ait@entry=0x8c2980 ai_types, pplayer=pplayer@entry=0x1e43f50) at aiunit.c:2677 punit = 0x24e3660 punit_numbers = 0x7fff82bfe578 punit_index = optimized out #6 0x004d2587 in dai_do_first_activities (ait=0x8c2980 ai_types, pplayer=pplayer@entry=0x1e43f50) at aihand.c:736 No locals. #7 0x004a33e3 in cai_do_first_activities (pplayer=0x1e43f50) at classicai.c:389 No locals. #8 0x0040b442 in ai_start_phase () at srv_main.c:816 _plr_ = 0x1e43f50 MY_i = 92 pplayer = 0x1e43f50 #9 begin_phase (is_new_phase=true) at srv_main.c:979 No locals. #10 srv_running () at srv_main.c:2367 save_counter = 1 at aiunit.c:2677 punit = 0x24e3660 punit_numbers = 0x7fff82bfe578 punit_index = optimized out #6 0x004d2587 in dai_do_first_activities (ait=0x8c2980 ai_types, pplayer=pplayer@entry=0x1e43f50)
[Freeciv-Dev] [bug #22230] pf_normal_map_move_cost crash
URL: http://gna.org/bugs/?22230 Summary: pf_normal_map_move_cost crash Project: Freeciv Submitted by: cazfi Submitted on: Sun 22 Jun 2014 01:17:30 AM EEST Category: general Severity: 3 - Normal Priority: 5 - Normal Status: None Assigned to: None Originator Email: Open/Closed: Open Release: Discussion Lock: Any Operating System: None Planned Release: 2.6.0 ___ Details: Though bug #22217 / bug #4 has been fixed, autogames still crash. Backtrace is a bit different from bug #4 so opening new ticket instead of reopening old bug. Program received signal SIGSEGV, Segmentation fault. pf_normal_map_move_cost (pfm=0x24b8450, ptile=0x0) at common/aicore/path_finding.c:722 722 } else if (pf_normal_map_iterate_until(pfnm, ptile)) { (gdb) bt #0 pf_normal_map_move_cost (pfm=0x24b8450, ptile=0x0) at common/aicore/path_finding.c:722 #1 0x0052b323 in find_nearest_safe_city (punit=0x1ae2fb0) at ai/default/aiunit.c:1560 #2 0x0052bac8 in dai_military_attack (ait=0x9ba1c0 ai_types, pplayer=0x0, punit=0x1ae2fb0) at ai/default/aiunit.c:1765 #3 0x0052d082 in dai_manage_military (ait=0x9ba1c0 ai_types, pplayer=0x2796850, punit=0x1ae2fb0) at ai/default/aiunit.c:2348 #4 0x0052eb4e in dai_manage_unit (ait=0x9ba1c0 ai_types, pplayer=0x2796850, punit=0x1ae2fb0) at ai/default/aiunit.c:2546 #5 0x005312ae in dai_manage_units (ait=ait@entry=0x9ba1c0 ai_types, pplayer=pplayer@entry=0x2796850) at ai/default/aiunit.c:2677 #6 0x00518177 in dai_do_first_activities (ait=0x9ba1c0 ai_types, pplayer=pplayer@entry=0x2796850) at ai/default/aihand.c:736 #7 0x004e3993 in cai_do_first_activities (pplayer=0x2796850) at ai/classic/classicai.c:389 #8 0x00435d4f in ai_start_phase () at ../../../src.patched/server/srv_main.c:816 #9 begin_phase (is_new_phase=true) at server/srv_main.c:979 #10 0x0043a1e4 in srv_running () at server/srv_main.c:2369 #11 srv_main () at server/srv_main.c:2903 #12 0x00432559 in main (argc=6, argv=0x7fffe2d8) at server/civserver.c:452 ___ Reply to this item at: http://gna.org/bugs/?22230 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev