Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault after starting first scenario #167

Open
akien-mga opened this issue Jan 26, 2021 · 1 comment
Open

Segfault after starting first scenario #167

akien-mga opened this issue Jan 26, 2021 · 1 comment

Comments

@akien-mga
Copy link
Contributor

akien-mga commented Jan 26, 2021

With 4.1.3 + #166 I finally managed to package a version of Wyrmsun 4.x that runs (to upgrade my 3.5.4 package), but when trying the first scenario I get a segmentation fault.

System:

System:    Host: cauldron Kernel: 5.10.10-desktop-1.mga8 x86_64 bits: 64 Desktop: KDE Plasma 5.20.4 Distro: Mageia 8 mga8 
CPU:       Info: Quad Core model: Intel Core i7-8705G bits: 64 type: MT MCP L2 cache: 8 MiB 
           Speed: 1822 MHz min/max: 800/3100 MHz Core speeds (MHz): 1: 1822 2: 2050 3: 2694 4: 1747 5: 2212 6: 2208 7: 2138 
           8: 2979 
Graphics:  Device-1: Intel HD Graphics 630 driver: i915 v: kernel 
           Device-2: Advanced Micro Devices [AMD/ATI] Polaris 22 XL [Radeon RX Vega M GL] driver: amdgpu v: kernel 
           Device-3: Cheng Uei Precision Industry (Foxlink) HP Wide Vision FHD Camera type: USB driver: uvcvideo 
           Display: x11 server: Mageia X.org 1.20.10 driver: intel,v4l resolution: 1920x1080 
           OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) v: 4.6 Mesa 20.3.3

Steps to reproduce:

  • Build and run Wyrmsun 4.1.3
  • Start the first single-player scenario ('The First Dwarves')
  • The first story dialogs work fine, then when you select and try to move units, it crashes:
wyrmgus::effect_list<CPlayer>::do_effects (this=0xc0, scope=0x7fffdc232d60, ctx=...) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/script/effect/effect_list.cpp:69
69              for (const std::unique_ptr<effect<scope_type>> &effect : this->effects) {
(gdb) bt
#0  wyrmgus::effect_list<CPlayer>::do_effects (this=0xc0, scope=0x7fffdc232d60, ctx=...) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/script/effect/effect_list.cpp:69
#1  0x0000000000889abe in TriggersEachCycle () at /usr/include/c++/10/bits/unique_ptr.h:173
#2  0x000000000093b2a0 in GameLogicLoop () at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/mainloop.cpp:315
#3  SingleGameLoop () at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/mainloop.cpp:479
#4  GameMainLoop () at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/mainloop.cpp:561
#5  0x000000000078d7d9 in StartMap (filename="scripts/map_templates/campaign.smp", clean=<optimized out>) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/game/game.cpp:359
#6  0x00000000006d145e in tolua_stratagus_StartMap00 (tolua_S=0x7fffdc000c50) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/build/tolua.cpp:925
#7  0x00007ffff64ebbe8 in luaD_precall () from /lib64/liblua.so.5.1
#8  0x00007ffff64f6575 in luaV_execute () from /lib64/liblua.so.5.1
#9  0x00007ffff64ec175 in luaD_call () from /lib64/liblua.so.5.1
#10 0x00007ffff64eb4c8 in luaD_rawrunprotected () from /lib64/liblua.so.5.1
#11 0x00007ffff64ec31d in luaD_pcall () from /lib64/liblua.so.5.1
#12 0x00007ffff64e8138 in lua_pcall () from /lib64/liblua.so.5.1
#13 0x0000000000937bcf in LuaCallback::run (this=0x7fff5b2adf58, results=0) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/luacallback.cpp:147
#14 0x00000000007a5bfd in gcn::Widget::generateAction (this=0x7fffdf951ec0) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/widget.cpp:613
#15 0x00000000007a588e in gcn::Widget::_mouseInputMessage (this=0x7fffdf951ec0, mouseInput=...) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/widget.cpp:499
#16 0x00000000007a72c3 in gcn::Container::_mouseInputMessage (this=0x7fffdf2bbf40, mouseInput=...) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/widgets/container.cpp:389
#17 0x00000000007a2f32 in gcn::Gui::logic (this=0x7fffdf04f700) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/gui.cpp:152
#18 0x0000000000699a76 in WaitEventsOneFrame () at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/video/sdl.cpp:863
#19 0x00000000005d3b54 in MenuScreen::run (this=this@entry=0x7fffdf2bbf40, loop=loop@entry=true) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/ui/widgets.cpp:2946
#20 0x00000000006ae2cd in tolua_stratagus_CMenuScreen_run00 (tolua_S=0x7fffdc000c50) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/build/tolua.cpp:19984
#21 0x00007ffff64ebbe8 in luaD_precall () from /lib64/liblua.so.5.1
#22 0x00007ffff64f6575 in luaV_execute () from /lib64/liblua.so.5.1
#23 0x00007ffff64ec175 in luaD_call () from /lib64/liblua.so.5.1
#24 0x00007ffff64eb4c8 in luaD_rawrunprotected () from /lib64/liblua.so.5.1
#25 0x00007ffff64ec31d in luaD_pcall () from /lib64/liblua.so.5.1
#26 0x00007ffff64e8138 in lua_pcall () from /lib64/liblua.so.5.1
#27 0x0000000000937bcf in LuaCallback::run (this=0x7fffdec27148, results=0) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/luacallback.cpp:147
--Type <RET> for more, q to quit, c to continue without paging--
#28 0x00000000007a5bfd in gcn::Widget::generateAction (this=0x7fff5b2b8710) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/widget.cpp:613
#29 0x00000000007a588e in gcn::Widget::_mouseInputMessage (this=0x7fff5b2b8710, mouseInput=...) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/widget.cpp:499
#30 0x00000000007a72c3 in gcn::Container::_mouseInputMessage (this=0x7fffdc5962e0, mouseInput=...) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/widgets/container.cpp:389
#31 0x00000000007a2f32 in gcn::Gui::logic (this=0x7fffdf04f700) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/gui.cpp:152
#32 0x0000000000699a76 in WaitEventsOneFrame () at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/video/sdl.cpp:863
#33 0x00000000005d3b54 in MenuScreen::run (this=this@entry=0x7fffdc5962e0, loop=loop@entry=true) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/ui/widgets.cpp:2946
#34 0x00000000006ae2cd in tolua_stratagus_CMenuScreen_run00 (tolua_S=0x7fffdc000c50) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/build/tolua.cpp:19984
#35 0x00007ffff64ebbe8 in luaD_precall () from /lib64/liblua.so.5.1
#36 0x00007ffff64f661d in luaV_execute () from /lib64/liblua.so.5.1
#37 0x00007ffff64ec175 in luaD_call () from /lib64/liblua.so.5.1
#38 0x00007ffff64eb4c8 in luaD_rawrunprotected () from /lib64/liblua.so.5.1
#39 0x00007ffff64ec31d in luaD_pcall () from /lib64/liblua.so.5.1
#40 0x00007ffff64e8138 in lua_pcall () from /lib64/liblua.so.5.1
#41 0x0000000000937bcf in LuaCallback::run (this=0x7fff5b149528, results=0) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/luacallback.cpp:147
#42 0x00000000007a5bfd in gcn::Widget::generateAction (this=0x7fffdc5a2700) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/widget.cpp:613
#43 0x00000000007a588e in gcn::Widget::_mouseInputMessage (this=0x7fffdc5a2700, mouseInput=...) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/widget.cpp:499
#44 0x00000000007a72c3 in gcn::Container::_mouseInputMessage (this=0x7fffdc5fea40, mouseInput=...) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/widgets/container.cpp:389
#45 0x00000000007a2f32 in gcn::Gui::logic (this=0x7fffdf04f700) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/guichan/gui.cpp:152
#46 0x0000000000699a76 in WaitEventsOneFrame () at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/video/sdl.cpp:863
#47 0x00000000005d3b54 in MenuScreen::run (this=this@entry=0x7fffdc5fea40, loop=loop@entry=true) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/ui/widgets.cpp:2946
#48 0x00000000006ae2cd in tolua_stratagus_CMenuScreen_run00 (tolua_S=0x7fffdc000c50) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/build/tolua.cpp:19984
#49 0x00007ffff64ebbe8 in luaD_precall () from /lib64/liblua.so.5.1
#50 0x00007ffff64f661d in luaV_execute () from /lib64/liblua.so.5.1
#51 0x00007ffff64ec175 in luaD_call () from /lib64/liblua.so.5.1
#52 0x00007ffff64eb4c8 in luaD_rawrunprotected () from /lib64/liblua.so.5.1
#53 0x00007ffff64ec31d in luaD_pcall () from /lib64/liblua.so.5.1
#54 0x00007ffff64e8138 in lua_pcall () from /lib64/liblua.so.5.1
#55 0x000000000056a37b in LuaCall (narg=0, clear=1, exitOnError=<optimized out>) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/script.cpp:188
--Type <RET> for more, q to quit, c to continue without paging--
#56 0x000000000056a450 in LuaLoadFile (file="/usr/share/games/wyrmsun/scripts/guichan.lua", strArg="") at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/script.cpp:249
#57 0x000000000057d804 in MenuLoop () at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/stratagus.cpp:281
#58 stratagusMain (argc=<optimized out>, argv=<optimized out>) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/stratagus.cpp:730
#59 0x00000000004e2d8d in operator() (__closure=<optimized out>) at /home/akien/Projects/mageia/Checkout/wyrmsun/BUILD/Wyrmgus-4.1.3/src/stratagus/main.cpp:127
#60 std::__invoke_impl<void, main(int, char**)::<lambda()> > (__f=...) at /usr/include/c++/10/bits/invoke.h:60
#61 std::__invoke<main(int, char**)::<lambda()> > (__fn=...) at /usr/include/c++/10/bits/invoke.h:95
#62 std::thread::_Invoker<std::tuple<main(int, char**)::<lambda()> > >::_M_invoke<0> (this=<optimized out>) at /usr/include/c++/10/thread:264
#63 std::thread::_Invoker<std::tuple<main(int, char**)::<lambda()> > >::operator() (this=<optimized out>) at /usr/include/c++/10/thread:271
#64 std::thread::_State_impl<std::thread::_Invoker<std::tuple<main(int, char**)::<lambda()> > > >::_M_run(void) (this=<optimized out>) at /usr/include/c++/10/thread:215
#65 0x00007ffff5f73e70 in execute_native_thread_routine () from /lib64/libstdc++.so.6
#66 0x00007ffff63fedea in start_thread () from /lib64/libpthread.so.0
#67 0x00007ffff5dc481f in clone () from /lib64/libc.so.6

Screenshot:
Screenshot_20210126_154657

I managed to reproduce it twice in a row (once without debugger, once with gdb), haven't tried further.

@Andrettin
Copy link
Owner

Andrettin commented Jan 26, 2021

Thank you for the report, Akien! I managed to reproduce the issue in my Ubuntu VM.

I implemented a fix for a problem I noticed when investigating your stack trace, and that seems to have solved the issue:
49917c1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants