URL:
  <http://gna.org/bugs/?22284>

                 Summary: Segfault in std::string::compare after move/attack
while animation updating
                 Project: Battle for Wesnoth
            Submitted by: kevin11
            Submitted on: Sun 06 Jul 2014 04:10:58 PM UTC
                Category: Bug
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group:  None of the others
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.13.0-dev
        Operating System: Ubuntu 12.04

    _______________________________________________________

Details:

I'm not sure how to exactly reproduce it, but it will have a big chance to
raise during a RCA vs RCA MP game.

This is the backtrace after "move":

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5195686 in std::string::compare(std::string const&) const ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0  0x00007ffff5195686 in std::string::compare(std::string const&) const ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x0000000000428c1f in std::operator< <char, std::char_traits<char>,
std::allocator<char> > (__lhs=..., __rhs=...)
    at /usr/include/c++/4.6/bits/basic_string.h:2512
#2  0x0000000000426827 in std::less<std::string>::operator() (this=0x48e37a0,

    __x=..., __y=...) at /usr/include/c++/4.6/bits/stl_function.h:236
#3  0x0000000000d9ef4e in std::_Rb_tree<std::string, std::pair<std::string
const, config::attribute_value>, std::_Select1st<std::pair<std::string const,
config::attribute_value> >, std::less<std::string>,
std::allocator<std::pair<std::string const, config::attribute_value> >
>::_M_lower_bound (this=0x48e37a0, 
    __x=0x7fff00000001, __y=0x48e37a8, __k=...)
    at /usr/include/c++/4.6/bits/stl_tree.h:1106
#4  0x0000000000d9bbc5 in std::_Rb_tree<std::string, std::pair<std::string
const, config::attribute_value>, std::_Select1st<std::pair<std::string const,
config::attribute_value> >, std::less<std::string>,
std::allocator<std::pair<std::string const, config::attribute_value> > >::find
(this=0x48e37a0, __k=...)
    at /usr/include/c++/4.6/bits/stl_tree.h:1549
#5  0x0000000000d985a1 in std::map<std::string, config::attribute_value,
std::less<std::string>, std::allocator<std::pair<std::string const,
config::attribute_value> > >::find (this=0x48e37a0, __x=...)
    at /usr/include/c++/4.6/bits/stl_map.h:757
#6  0x0000000000d89bf4 in config::operator[] (this=0x48e37a0, key=...)
---Type <return> to continue, or q <return> to quit---
    at src/config.cpp:836
#7  0x0000000000773d56 in vconfig::expand (this=0x480c2c0, key=...)
    at src/variable.cpp:272
#8  0x0000000000771a21 in vconfig::get_parsed_config (this=0x480c2c0)
    at src/variable.cpp:118
#9  0x00000000007363f0 in basic_unit_filter_impl::internal_matches_filter (
    this=0x480ce00, u=..., loc=...) at src/unit_filter.cpp:502
#10 0x0000000000734f89 in basic_unit_filter_impl::matches (this=0x480ce00, 
    u=..., loc=...) at src/unit_filter.cpp:323
#11 0x000000000067cc77 in unit_filter::matches (this=0x48ebbf0, u=...,
loc=...)
    at src/unit_filter.hpp:65
#12 0x00000000007350d7 in basic_unit_filter_impl::matches (this=0x480c840, 
    u=..., loc=...) at src/unit_filter.cpp:339
#13 0x000000000067cc77 in unit_filter::matches (this=0x48bb160, u=...,
loc=...)
    at src/unit_filter.hpp:65
#14 0x000000000070ab31 in unit_animation::matches (this=0x3e86e70, disp=..., 
    loc=..., second_loc=..., my_unit=0x505ef40, event=..., value=0, 
    hit=unit_animation::INVALID, attack=0x0, second_attack=0x0, value2=0)
    at src/unit_animation.cpp:407
#15 0x00000000007304ba in unit_animation_component::choose_animation (
    this=0x48e2710, disp=..., loc=..., event=..., second_loc=..., value=0, 
    hit=unit_animation::INVALID, attack=0x0, second_attack=0x0, swing_num=0)
    at src/unit_animation_component.cpp:33
---Type <return> to continue, or q <return> to quit---
#16 0x0000000000730c6c in unit_animation_component::set_idling
(this=0x48e2710)
    at src/unit_animation_component.cpp:80
#17 0x00000000007313cb in unit_animation_component::refresh (this=0x48e2710)
    at src/unit_animation_component.cpp:146
#18 0x0000000000e5ac46 in display::invalidate_animations (this=0x3e863b0)
    at src/display.cpp:2998
#19 0x0000000000e55716 in display::draw (this=0x3e863b0, update=true, 
    force=false) at src/display.cpp:2385
#20 0x0000000000e544bd in display::scroll_to_xy (this=0x3e863b0, 
    screenxpos=397, screenypos=-219, scroll_type=display::ONSCREEN, 
    force=false) at src/display.cpp:2103
#21 0x0000000000e54dd3 in display::scroll_to_tiles (this=0x3e863b0, begin=...,

    end=..., scroll_type=display::ONSCREEN, check_fogged=true, 
    only_if_possible=true, add_spacing=0, force=false) at
src/display.cpp:2256
#22 0x0000000000bd27e9 in display::scroll_to_tiles (this=0x3e863b0, locs=...,

    scroll_type=display::ONSCREEN, check_fogged=true, only_if_possible=true, 
    add_spacing=0, force=false) at src/display.hpp:569
#23 0x0000000000bcbd5a in unit_display::unit_mover::start (
    this=0x7fffffff0850, u=...) at src/unit_display.cpp:274
#24 0x00000000007f744a in actions::(anonymous
namespace)::unit_mover::try_actual_movement (this=0x7fffffff0c90, show=true)
at src/actions/move.cpp:945
#25 0x00000000007f8d69 in actions::move_unit_internal (undo_stack=0x0, 
    show_move=true, interrupted=0x0, mover=...) at src/actions/move.cpp:1186
---Type <return> to continue, or q <return> to quit---
#26 0x00000000007f98ac in actions::move_unit_and_record (steps=..., 
    undo_stack=0x0, continued_move=true, show_move=true, interrupted=0x0, 
    move_spectator=0x9777770) at src/actions/move.cpp:1266
#27 0x0000000000be7ccb in ai::move_result::do_execute (this=0x9777750)
    at src/ai/actions.cpp:473
#28 0x0000000000be59c2 in ai::action_result::execute (this=0x9777750)
    at src/ai/actions.cpp:95
#29 0x0000000000bea2d2 in ai::actions::execute_move_action (side=2, 
    execute=true, from=..., to=..., remove_movement=true,
unreach_is_ok=false)
    at src/ai/actions.cpp:1008
#30 0x0000000000c057f4 in ai::readwrite_context_impl::execute_move_action (
    this=0x7fda4f0, from=..., to=..., remove_movement=true, 
    unreach_is_ok=false) at src/ai/contexts.cpp:133
#31 0x0000000000819481 in ai::readwrite_context_proxy::execute_move_action (
    this=0x7fdbdf8, from=..., to=..., remove_movement=true, 
    unreach_is_ok=false) at src/ai/composite/../default/../contexts.hpp:1072
#32 0x0000000000904cd3 in
ai::testing_ai_default::testing_move_to_targets_phase::execute
(this=0x7fdbd50) at src/ai/testing/ca_testing_move_to_targets.cpp:178
#33 0x0000000000922559 in
ai::testing_ai_default::candidate_action_evaluation_loop::do_play_stage
(this=0x7fda380) at src/ai/testing/stage_rca.cpp:155
#34 0x000000000083bed5 in ai::stage::play_stage (this=0x7fda3a8)
    at src/ai/composite/stage.cpp:58


This is the backtrace after "attack":

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5196f28 in std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::basic_string(std::string const&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0  0x00007ffff5196f28 in std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::basic_string(std::string const&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x0000000000d9c09e in std::pair<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const,
config::attribute_value>::pair (
    this=0x7ffffffeed70, __a=..., __b=...)
    at /usr/include/c++/4.6/bits/stl_pair.h:104
#2  0x0000000000d98936 in std::map<std::string, config::attribute_value,
std::less<std::string>, std::allocator<std::pair<std::string const,
config::attribute_value> > >::operator[] (this=0x7ffffffef320, __k=...)
    at /usr/include/c++/4.6/bits/stl_map.h:453
#3  0x0000000000d89d4f in config::operator[] (this=0x7ffffffef320, key=...)
    at src/config.cpp:852
#4  0x0000000000771a3a in vconfig::get_parsed_config (this=0x47cac50)
    at src/variable.cpp:118
#5  0x00000000007363f0 in basic_unit_filter_impl::internal_matches_filter (
    this=0x47a7010, u=..., loc=...) at src/unit_filter.cpp:502
#6  0x0000000000734f89 in basic_unit_filter_impl::matches (this=0x47a7010, 
    u=..., loc=...) at src/unit_filter.cpp:323
#7  0x000000000067cc77 in unit_filter::matches (this=0x48e6270, u=...,
loc=...)
    at src/unit_filter.hpp:65
#8  0x00000000007350d7 in basic_unit_filter_impl::matches (this=0x47a6cb0, 
    u=..., loc=...) at src/unit_filter.cpp:339
---Type <return> to continue, or q <return> to quit---
#9  0x000000000067cc77 in unit_filter::matches (this=0x48a7760, u=...,
loc=...)
    at src/unit_filter.hpp:65
#10 0x000000000067cca5 in unit_filter::operator() (this=0x48a7760, u=..., 
    loc=...) at src/unit_filter.hpp:73
#11 0x000000000070ad9b in unit_animation::matches (this=0x504c810, disp=..., 
    loc=..., second_loc=..., my_unit=0x50a8e40, event=..., value=6, 
    hit=unit_animation::HIT, attack=0x48d4150, second_attack=0x7e4f250, 
    value2=1) at src/unit_animation.cpp:414
#12 0x00000000007304ba in unit_animation_component::choose_animation (
    this=0x48d4d40, disp=..., loc=..., event=..., second_loc=..., value=6, 
    hit=unit_animation::HIT, attack=0x48d4150, second_attack=0x7e4f250, 
    swing_num=1) at src/unit_animation_component.cpp:33
#13 0x000000000071d4f9 in unit_animator::add_animation (this=0x7ffffffefe70, 
    animated_unit=0x50a8e40, event=..., src=..., dst=..., value=6, 
    with_bars=true, text=..., text_color=4278255360, 
    hit_type=unit_animation::HIT, attack=0x48d4150, second_attack=0x7e4f250, 
    value2=1) at src/unit_animation.cpp:1281
#14 0x0000000000bce1f8 in unit_display::unit_attack (disp=0x47caf00, board=
    ..., a=..., b=..., damage=6, attack=..., secondary_attack=0x7e4f250, 
    swing=1, hit_text=..., drain_amount=0, att_text=...)
    at src/unit_display.cpp:615
#15 0x00000000007e6613 in (anonymous namespace)::attack::perform_hit (
    this=0x7fffffff0b30, attacker_turn=true, stats=...)
---Type <return> to continue, or q <return> to quit---
    at src/actions/attack.cpp:1001
#16 0x00000000007e8c3f in (anonymous namespace)::attack::perform (
    this=0x7fffffff0b30) at src/actions/attack.cpp:1292
#17 0x00000000007e922f in attack_unit (attacker=..., defender=..., 
    attack_with=2, defend_with=1, update_display=true)
    at src/actions/attack.cpp:1363
#18 0x00000000007e9f48 in attack_unit_and_advance (attacker=..., defender=...,

    attack_with=2, defend_with=1, update_display=true, ai_advancement=...)
    at src/actions/attack.cpp:1489
#19 0x0000000000be6d72 in ai::attack_result::do_execute (this=0x6b98170)
    at src/ai/actions.cpp:293
#20 0x0000000000be59c2 in ai::action_result::execute (this=0x6b98170)
    at src/ai/actions.cpp:95
#21 0x00000000008e26f4 in ai::testing_ai_default::combat_phase::execute (
    this=0x7f1f1f0) at src/ai/testing/ca.cpp:631
#22 0x0000000000922559 in
ai::testing_ai_default::candidate_action_evaluation_loop::do_play_stage
(this=0x7f1dce0) at src/ai/testing/stage_rca.cpp:155
#23 0x000000000083bed5 in ai::stage::play_stage (this=0x7f1dd08)
    at src/ai/composite/stage.cpp:58




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?22284>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to