URL:
<http://gna.org/bugs/?12951>
Summary: Repeatable segfault of unknown origin
Project: Battle for Wesnoth
Submitted by: pmawhorter
Submitted on: Saturday 02/07/2009 at 11:59
Category: Bug
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 1.5.9+svn
Operating System: Ubuntu 8.04
_______________________________________________________
Details:
I'm sorry that I'm not better able to track down this bug, and I know that
it's not likely to get fixed because of that, but I'm reporting it because it
seems fairly serious...
I'm working on a campaign called "The Knights of the Silver Spire", and
during playtesting for my latest scenario, I got a segfault. Thinking nothing
of an occasional error, especially since I'm using the bleeding edge svn code
(compiled using scons with all dependencies from standard Ubuntu Hardy
repos), I loaded my save game, only to encounter the segfault again, at the
same place. I have a unit on an AI-controlled allied team, a Knight with
id=Merrysworth, who I want to say something when he dies. Thus, I have an
event with name=lastbreath using [filter] id=Merrysworth [/filter] to trigger
when he dies. However, the game segfaults when he is killed. In the event, I
originally used a macro to assign a role, and then delivered some messages.
My first reaction to the segfault was to pare down the event, to just a
single message, using id=Merrysworth as the filter. The code looks like
this:
[event]
name=last_breath
[filter]
id=Merrysworth
[/filter]
[message]
id=Merrysworth
message=_"I'm sorry..."
[/message]
[/event]
However, even with just that code, the segfault persisted: as soon as
Merrysworth dies, the game crashes. The message is not displayed. A backtrace
in gdb (after the segfault) looks like this:
(gdb) bt
#0 0x0854d28c in config::all_children_iterator::operator* ()
#1 0x0854fde2 in config::append ()
#2 0x0854ff1b in config::config ()
#3 0x083da92a in attack::attack ()
#4 0x0835699f in ai_interface::attack_enemy ()
#5 0x08356f31 in ai::attack_enemy ()
#6 0x083636e2 in ai::do_combat ()
#7 0x0836412c in ai::do_move ()
#8 0x0834ea11 in ai::play_turn ()
#9 0x081b9990 in playsingle_controller::play_ai_turn ()
#10 0x081b9fd4 in playsingle_controller::play_side ()
#11 0x081ba9aa in playsingle_controller::play_turn ()
#12 0x081bd467 in playsingle_controller::play_scenario ()
#13 0x081ab456 in play_game ()
#14 0x0805f95a in (anonymous namespace)::game_controller::launch_game ()
#15 0x08069c1e in do_gameloop ()
#16 0x0806aa80 in main ()
(gdb)
If I remove the [message] tag from the event, so that it's just an empty
event:
[event]
name=last_breath
[filter]
id=Merrysworth
[/filter]
[/event]
the segfault does not occur. Even more interesting, if, after loading a game
in which I've used debug mode to set the unit to 0 hitpoints so that it will
be killed on the enemy's turn, I save the game, the segfault does not occur,
and the dialogue appears as it should. However, if I load the new saved game
and let him die, the error does occur. Thus there appears to be some
side-effect of saving the game that changes the current game state but which
is not preserved in the saved game that wards off this error.
...after a bit more testing, the segfault seems to be more elusive than I
first thought, not triggering in every case, but I can't put a better pattern
on it. I'm including two savegames, an autosave on turn 3 that sometimes
triggers it for me (you have to :debug and :unit hitpoints=0 on the Knight
named Sir Merrysworth) and a savegame called "broken" that already has the
debugging done, just end turn and the segfault should happen after a bit of
dialogue.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Saturday 02/07/2009 at 11:59 Name: broken.gz Size: 63kB By:
pmawhorter
Two save files, map file, and scenario file...
<http://gna.org/bugs/download.php?file_id=5273>
-------------------------------------------------------
Date: Saturday 02/07/2009 at 11:59 Name: Aethenport.map Size: 44kB By:
pmawhorter
Two save files, map file, and scenario file...
<http://gna.org/bugs/download.php?file_id=5274>
-------------------------------------------------------
Date: Saturday 02/07/2009 at 11:59 Name:
TKotSS-Restless_Waters-Auto-Save3.gz Size: 67kB By: pmawhorter
Two save files, map file, and scenario file...
<http://gna.org/bugs/download.php?file_id=5275>
-------------------------------------------------------
Date: Saturday 02/07/2009 at 11:59 Name: 2-Restless_Waters.cfg Size: 85kB
By: pmawhorter
Two save files, map file, and scenario file...
<http://gna.org/bugs/download.php?file_id=5276>
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?12951>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs