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

                 Summary: Random bug with WML variables on -O3 builds (GNU
g++)
                 Project: Battle for Wesnoth
            Submitted by: shadowmaster
            Submitted on: Tuesday 01/06/2009 at 22:49
                Category: Bug
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group:  None of the others
                  Status: None
                 Privacy: Public
             Assigned to: sapient
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.5.7+svn r32003
        Operating System: Debian lenny

    _______________________________________________________

Details:

Some WML that is not working properly in any build of this SVN revision (that
is, it does not have the desired effect) causes crashes on Wesnoth
(segmentation fault) only when the engine is built with the following
parameters for the SCons recipe:

++
default_targets = 'campaignd,test,wesnoth,wesnothd'
build = 'debug'
extra_flags_release = '-mtune=native -march=native -O3 -mmmx -msse -msse2
-m3dnow'
extra_flags_debug = '-mtune=native -march=native'
raw_sockets = True
ccache = True
fast = True
--

... using the release build.

It does not happen when built as the debug build using the same recipe, or
when built with CMake with the -O2 optimization set.

The attachments contain the guilty WML and the related macros for better
understanding of it. As I said, the WML does not have the desired effect
because it seems to have been broken when porting it to 1.5.x - it was
originally intended for 1.4. However, only on the aforementioned conditions
it may cause a segmentation fault.

I introduced a small speaker=narrator dialog to the WML that causes a
continuous sequence of dialogs to be shown - skipping that sequence with ESC
skips the segmentation fault. Turning verbose logging on with --log-debug=all
also makes the bug go away.

Therefore I suspect that this is either a rare condition caused by the build
parameters, or a bug in the compiler.

The crash occurs (when it does) at the very end of the event. Note that the
WML spawns many new events.


System specifications:

Debian GNU/Linux testing distribution (codename 'lenny') for AMD64/EM64T
g++ (Debian 4.3.2-1) 4.3.2
libstdc++ 6 4.3.2 (Debian 4.3.2-1)
libsdl1.2debian 1.2.13-2
libpng12-0 1.2.27-2

Backtrace:

++
#
#0  0x0000000000816d4f in config::get_attribute ()
#
#1  0x00000000005e8419 in vconfig::expand ()
#
#2  0x0000000000471dc6 in game_events::event_handler::matches_name ()
#
#3  0x000000000048fb78 in game_events::pump ()
#
#4  0x00000000006d93c3 in move_unit ()
#
#5  0x0000000000793078 in
events::mouse_handler::move_unit_along_current_route ()
#
#6  0x0000000000796a2a in events::mouse_handler::left_click ()
#
#7  0x00000000004f3575 in events::mouse_handler_base::mouse_press ()
#
#8  0x000000000071f2dd in controller_base::handle_event ()
#
#9  0x0000000000895ad4 in events::pump ()
#
#10 0x000000000071faa8 in controller_base::play_slice ()
#
#11 0x00000000005333e8 in playsingle_controller::play_human_turn ()
#
#12 0x00000000005341b0 in playsingle_controller::play_side ()
#
#13 0x0000000000533ae4 in playsingle_controller::play_turn ()
#
#14 0x0000000000535ee8 in playsingle_controller::play_scenario ()
#
#15 0x0000000000528287 in play_game ()
#
#16 0x0000000000417dfa in (anonymous namespace)::game_controller::launch_game
()
#
#17 0x0000000000422144 in do_gameloop ()
#
#18 0x0000000000422fa7 in main ()
--




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tuesday 01/06/2009 at 22:49  Name: preconditions  Size: 5kB   By:
shadowmaster

<http://gna.org/bugs/download.php?file_id=5149>
-------------------------------------------------------
Date: Tuesday 01/06/2009 at 22:49  Name: wml  Size: 2kB   By: shadowmaster

<http://gna.org/bugs/download.php?file_id=5150>

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  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