Andrettin / Wyrmsun

Strategy game based on history, mythology and fiction
http://andrettin.github.io/
GNU General Public License v2.0
301 stars 47 forks source link

Crash when changing resolution ingame #26

Closed KroArtem closed 8 years ago

KroArtem commented 8 years ago

Start game (e.g. custom one), go to options -> video, change width or height, press ok and receive a segfault. Didn't manage to debug what's happening.

Program received signal SIGSEGV, Segmentation fault.
0x00000000007978b1 in CDecoVarSpriteBar::Draw (this=0x92107f0, x=415, y=198, 
    var=...) at /home/kroartem/SVN/Wyrmgus/src/unit/unit_draw.cpp:537
537     int n = sprite.NumFrames - 1; // frame of the sprite to show.
(gdb) bt
#0  0x00000000007978b1 in CDecoVarSpriteBar::Draw (this=0x92107f0, x=415, 
    y=198, var=...) at /home/kroartem/SVN/Wyrmgus/src/unit/unit_draw.cpp:537
#1  0x0000000000797e23 in DrawDecoration (unit=..., type=..., screenPos=...)
    at /home/kroartem/SVN/Wyrmgus/src/unit/unit_draw.cpp:619
#2  0x0000000000798e1e in DrawInformations (unit=..., type=..., screenPos=...)
    at /home/kroartem/SVN/Wyrmgus/src/unit/unit_draw.cpp:894
#3  0x000000000079a588 in CUnit::Draw (this=0xd80ca60, vp=...)
    at /home/kroartem/SVN/Wyrmgus/src/unit/unit_draw.cpp:1403
#4  0x0000000000645ca8 in CViewport::Draw (this=0x245d950 <UI+1232>)
    at /home/kroartem/SVN/Wyrmgus/src/map/map_draw.cpp:424
#5  0x00000000006dabc6 in DrawMapArea ()
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/mainloop.cpp:174
#6  0x00000000006dac55 in UpdateDisplay ()
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/mainloop.cpp:191
#7  0x00000000006dbdb1 in DisplayLoop ()
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/mainloop.cpp:544
#8  0x00000000006dbdcd in SingleGameLoop ()
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/mainloop.cpp:563
#9  0x00000000006dbe7a in GameMainLoop ()
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/mainloop.cpp:601
#10 0x00000000005fcb4d in StartMap (filename="maps/alfheim/ulfdalir.smp", 
    clean=true) at /home/kroartem/SVN/Wyrmgus/src/game/game.cpp:173
#11 0x00000000007ef5f8 in tolua_stratagus_StartMap00 (tolua_S=0x2487780)
---Type <return> to continue, or q <return> to quit---
    at /home/kroartem/SVN/Wyrmgus/tolua.cpp:1064
#12 0x00007ffff7bb7360 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#13 0x00007ffff7bc1efa in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#14 0x00007ffff7bb77bd in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#15 0x00007ffff7bb6a9e in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#16 0x00007ffff7bb792b in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#17 0x00007ffff7bb33e8 in lua_pcall ()
   from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#18 0x00000000006da6e9 in LuaCallback::run (this=0x8431758, results=0)
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/luacallback.cpp:149
#19 0x0000000000753caa in LuaActionListener::action (this=0x8431750, 
    eventId="") at /home/kroartem/SVN/Wyrmgus/src/ui/widgets.cpp:392
#20 0x0000000000618bc6 in gcn::Widget::generateAction (this=0x8431510)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/widget.cpp:616
#21 0x000000000061c227 in gcn::Button::mouseClick (this=0x8431510, button=1)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/widgets/button.cpp:254
#22 0x00000000006185ff in gcn::Widget::_mouseInputMessage (this=0x8431510, 
    mouseInput=...) at /home/kroartem/SVN/Wyrmgus/src/guichan/widget.cpp:502
#23 0x000000000061dd91 in gcn::Container::_mouseInputMessage (this=0x84e76e0, 
    mouseInput=...)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/widgets/container.cpp:394
#24 0x000000000060ff1e in gcn::Gui::logic (this=0x8129c50)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/gui.cpp:155
---Type <return> to continue, or q <return> to quit---
#25 0x0000000000753ad9 in handleInput (event=0x0)
    at /home/kroartem/SVN/Wyrmgus/src/ui/widgets.cpp:341
#26 0x00000000007d5f09 in WaitEventsOneFrame ()
    at /home/kroartem/SVN/Wyrmgus/src/video/sdl.cpp:989
#27 0x000000000075f8a6 in MenuScreen::run (this=0x84e76e0, loop=true)
    at /home/kroartem/SVN/Wyrmgus/src/ui/widgets.cpp:3115
#28 0x000000000083465b in tolua_stratagus_CMenuScreen_run00 (tolua_S=0x2487780)
    at /home/kroartem/SVN/Wyrmgus/tolua.cpp:25142
#29 0x00007ffff7bb7360 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#30 0x00007ffff7bc1efa in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#31 0x00007ffff7bb77bd in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#32 0x00007ffff7bb6a9e in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#33 0x00007ffff7bb792b in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#34 0x00007ffff7bb33e8 in lua_pcall ()
   from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#35 0x00000000006da6e9 in LuaCallback::run (this=0xd7a15f8, results=0)
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/luacallback.cpp:149
#36 0x0000000000753caa in LuaActionListener::action (this=0xd7a15f0, 
    eventId="") at /home/kroartem/SVN/Wyrmgus/src/ui/widgets.cpp:392
#37 0x0000000000618bc6 in gcn::Widget::generateAction (this=0x8ef0a60)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/widget.cpp:616
#38 0x000000000061c227 in gcn::Button::mouseClick (this=0x8ef0a60, button=1)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/widgets/button.cpp:254
---Type <return> to continue, or q <return> to quit---
#39 0x00000000006185ff in gcn::Widget::_mouseInputMessage (this=0x8ef0a60, 
    mouseInput=...) at /home/kroartem/SVN/Wyrmgus/src/guichan/widget.cpp:502
#40 0x000000000061dd91 in gcn::Container::_mouseInputMessage (this=0xd7ab110, 
    mouseInput=...)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/widgets/container.cpp:394
#41 0x000000000060ff1e in gcn::Gui::logic (this=0x8129c50)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/gui.cpp:155
#42 0x0000000000753ad9 in handleInput (event=0x0)
    at /home/kroartem/SVN/Wyrmgus/src/ui/widgets.cpp:341
#43 0x00000000007d5f09 in WaitEventsOneFrame ()
    at /home/kroartem/SVN/Wyrmgus/src/video/sdl.cpp:989
#44 0x000000000075f8a6 in MenuScreen::run (this=0xd7ab110, loop=true)
    at /home/kroartem/SVN/Wyrmgus/src/ui/widgets.cpp:3115
#45 0x000000000083465b in tolua_stratagus_CMenuScreen_run00 (tolua_S=0x2487780)
    at /home/kroartem/SVN/Wyrmgus/tolua.cpp:25142
#46 0x00007ffff7bb7360 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#47 0x00007ffff7bc1e97 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#48 0x00007ffff7bb77bd in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#49 0x00007ffff7bb6a9e in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#50 0x00007ffff7bb792b in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#51 0x00007ffff7bb33e8 in lua_pcall ()
   from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#52 0x00000000006da6e9 in LuaCallback::run (this=0xd8a0f08, results=0)
---Type <return> to continue, or q <return> to quit---
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/luacallback.cpp:149
#53 0x0000000000753caa in LuaActionListener::action (this=0xd8a0f00, 
    eventId="") at /home/kroartem/SVN/Wyrmgus/src/ui/widgets.cpp:392
#54 0x0000000000618bc6 in gcn::Widget::generateAction (this=0xd8a0d10)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/widget.cpp:616
#55 0x000000000061c227 in gcn::Button::mouseClick (this=0xd8a0d10, button=1)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/widgets/button.cpp:254
#56 0x00000000006185ff in gcn::Widget::_mouseInputMessage (this=0xd8a0d10, 
    mouseInput=...) at /home/kroartem/SVN/Wyrmgus/src/guichan/widget.cpp:502
#57 0x000000000061dd91 in gcn::Container::_mouseInputMessage (this=0xd800800, 
    mouseInput=...)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/widgets/container.cpp:394
#58 0x000000000060ff1e in gcn::Gui::logic (this=0x8129c50)
    at /home/kroartem/SVN/Wyrmgus/src/guichan/gui.cpp:155
#59 0x0000000000753ad9 in handleInput (event=0x0)
    at /home/kroartem/SVN/Wyrmgus/src/ui/widgets.cpp:341
#60 0x00000000007d5f09 in WaitEventsOneFrame ()
    at /home/kroartem/SVN/Wyrmgus/src/video/sdl.cpp:989
#61 0x000000000075f8a6 in MenuScreen::run (this=0xd800800, loop=true)
    at /home/kroartem/SVN/Wyrmgus/src/ui/widgets.cpp:3115
#62 0x000000000083465b in tolua_stratagus_CMenuScreen_run00 (tolua_S=0x2487780)
    at /home/kroartem/SVN/Wyrmgus/tolua.cpp:25142
#63 0x00007ffff7bb7360 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
---Type <return> to continue, or q <return> to quit---
#64 0x00007ffff7bc1e97 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#65 0x00007ffff7bb77bd in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#66 0x00007ffff7bb6a9e in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#67 0x00007ffff7bb792b in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#68 0x00007ffff7bb33e8 in lua_pcall ()
   from /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#69 0x00000000006e69e8 in LuaCall (narg=0, clear=1, exitOnError=true)
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/script.cpp:168
#70 0x00000000006e6d28 in LuaLoadFile (file="scripts/guichan.lua")
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/script.cpp:225
#71 0x0000000000710b98 in MenuLoop ()
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/stratagus.cpp:305
#72 0x000000000071152f in stratagusMain (argc=1, argv=0x7fffffffdfb8)
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/stratagus.cpp:787
#73 0x00000000006da7cf in main (argc=1, argv=0x7fffffffdfb8)
    at /home/kroartem/SVN/Wyrmgus/src/stratagus/main.cpp:37
akien-mga commented 8 years ago

I can't reproduce it with the current version on Steam (1.4.0, compiled on Ubuntu 12.04 LTS). I'll see how it behaves on Mageia 5 with the current master branch.

akien-mga commented 8 years ago

Couldn't reproduce either on Mageia 5 64-bit with a build of HEAD.

Andrettin commented 8 years ago

Thanks for the bug report! I could successfully change the resolution without issues, but I managed to reproduce the error afterwards. It seems to only happen if there is a decoration sprite (i.e. a health bar) on the unit.

I fixed the error here: https://github.com/Andrettin/Wyrmsun/commit/963d60d29400186fb98b7bceac47c8651312a092