bugBattle for Wesnoth - Bugs: bug #21765, segfault in animation code

 
 
Show feedback again

bug #21765: segfault in animation code

Submitted by:  Eli Dupree <elvish_pillager>
Submitted on:  Thu 06 Mar 2014 11:03:49 PM UTC  
 
Category: BugSeverity: 3 - Normal
Priority: 5 - NormalItem Group: WML
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Open
Release: 1.11.11+devOperating System: Debian Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 10 Jul 2014 04:45:55 PM UTC, comment #2:

I tested this in 1.13.0, it works now.

I believe I fixed it in this branch and the subsequent commits, at the same time that the "double kill" bug was fixed:

https://github.com/wesnoth/wesnoth/commit/35180b82d1aee943855172d81fe011fd5d19b728

I don't think it's possible to backport the change to 1.12.0 though. The problem seems to have been intrinsic to the design of the animation engine, in 1.11.x series, it holds raw pointers to units but never owns them, and if they are deleted by the unit map or by lua then you crash unavoidably. The fix was to simply refactor everything to use reference counted pointers.

I suggest that we close this unless someone thinks there is actually a way to fix it on 1.12 branch.

Chris Beck <involution>
Project Member
Fri 07 Mar 2014 11:54:18 PM UTC, comment #1:

Trying this on wesnoth 1.12 (beta)/1.13.0 gives Mandatory WML child error and can't load to test.

David Mikos <coffee>
Project Member
Thu 06 Mar 2014 11:03:49 PM UTC, original submission:

Load the attached save and end turn; it should segfault. If it doesn't, end turn a few more times. I've tested this in both 1.10.7 and 1.11.11+dev.

This may be related to an absurd hack I use (using wesnoth.put_unit() to change animations during a lua_function= filter in a unit ability), but my understanding is that a segfault is always a Wesnoth bug even with bad input.

(gdb) bt
#0 0x0000000001511370 in std::vector<animated<unit_frame, void_value<unit_frame> >::frame, std::allocator<animated<unit_frame, void_value<unit_frame> >::frame> >::end() const ()
#1 0x000000000150f76c in std::vector<animated<unit_frame, void_value<unit_frame> >::frame, std::allocator<animated<unit_frame, void_value<unit_frame> >::frame> >::empty() const ()
#2 0x000000000150de73 in animated<unit_frame, void_value<unit_frame> >::animation_finished_potential() const ()
#3 0x000000000199faeb in unit_animation::animation_finished_potential() const
()
#4 0x00000000019a40f9 in unit_animator::wait_for_end() const ()
#5 0x00000000019b3a46 in unit_display::unit_healing(unit&, std::vector<unit*, std::allocator<unit*> > const&, int, std::string const&) ()
#6 0x00000000012f9bdd in (anonymous namespace)::animate_heals(std::list<(anonymous namespace)::heal_unit, std::allocator<(anonymous namespace)::heal_unit> >&)
()
#7 0x00000000012fa3d7 in calculate_healing(int, bool) ()
#8 0x00000000018a6349 in play_controller::do_init_side(unsigned int, bool) ()
#9 0x00000000018a5d48 in play_controller::maybe_do_init_side(unsigned int, bool) ()
#10 0x00000000018a5c63 in play_controller::init_side(unsigned int, bool) ()
#11 0x00000000018c12da in playsingle_controller::play_turn(bool) ()
#12 0x00000000018bfd13 in playsingle_controller::play_scenario(std::pair<config::const_child_iterator, config::const_child_iterator> const&, bool) ()
#13 0x00000000018b4be2 in playsingle_scenario(config const&, config const*, display&, game_state&, std::pair<config::const_child_iterator, config::const_child_iterator> const&, bool, end_level_data&) ()
---Type <return> to continue, or q <return> to quit---
#14 0x00000000018b6bab in play_game(game_display&, game_state&, config const&, io_type_t, bool, bool, bool) ()
#15 0x000000000161789f in game_controller::launch_game(game_controller::RELOAD_GAME_DATA) ()
#16 0x000000000110c41d in do_gameloop(int, char**) ()
#17 0x000000000110c916 in main ()

Eli Dupree <elvish_pillager>

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by involution (Posted a comment)
  • -unavailable- added by coffee (Posted a comment)
  • -unavailable- added by elvish_pillager (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 10 Jul 2014 04:45:55 PM UTCinvolutionStatusNone=>Fixed
    Thu 06 Mar 2014 11:03:49 PM UTCelvish_pillagerAttached File-=>Added 3p_—_Island_of_the_Horatii_Turn_7-2.gz, #20273
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup