arescentral / antares

A tactical space combat game
http://arescentral.org/antares/
GNU Lesser General Public License v3.0
100 stars 18 forks source link

Segfault in attempt to access options screen #478

Closed assertivist closed 3 months ago

assertivist commented 3 months ago

Both of these crashes are with the stock scenario and I deleted my config.pn just in case. All I do is launch the game and click Options or press the O button.

OS: Fedora Linux 39 (KDE Plasma) x86_64 Host: 21E80013US ThinkPad X1 Nano Gen 2 Kernel: 6.7.9-200.fc39.x86_64 Uptime: 4 mins Packages: 3530 (rpm), 25 (flatpak) Resolution: 2160x1350 DE: Plasma 5.27.11 WM: kwin CPU: 12th Gen Intel i7-1280P (20) @ 4.700GHz GPU: Intel Alder Lake-P GT2 [Iris Xe Graphics]

Mouse click on Options in Main Menu

Thread 1 "antares" received signal SIGSEGV, Segmentation fault.
0x00000000004cf39a in std::function<void ()>::operator=(std::function<void ()> const&) ()
(gdb) bt
#0  0x00000000004cf39a in std::function<void ()>::operator=(std::function<void ()> const&) ()
#1  0x00000000004cc523 in antares::PlainButton::bind(antares::PlainButton::Action) ()
#2  0x00000000004c87b2 in antares::SoundControlScreen::SoundControlScreen(antares::OptionsScreen::State*) ()
#3  0x00000000004c8321 in antares::OptionsScreen::become_front() ()
#4  0x00000000004c015a in antares::CardStack::push(antares::Card*) ()
#5  0x00000000004c791d in antares::MainScreen::mouse_up(antares::MouseUpEvent const&) ()
#6  0x000000000040752c in antares::GLFWVideoDriver::mouse_button(int, int, int) ()
#7  0x00007ffff7852d07 in _glfwInputMouseClick (mods=<optimized out>, action=0, button=0, window=<optimized out>)
    at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/input.c:323
#8  _glfwInputMouseClick (mods=<optimized out>, action=0, button=0, window=<optimized out>) at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/input.c:309
#9  processEvent (event=0x7fffffffd0c0) at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/x11_window.c:1433
#10 _glfwPlatformPollEvents () at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/x11_window.c:2786
#11 0x00000000004079a3 in antares::GLFWVideoDriver::loop(antares::Card*) ()
#12 0x0000000000407ed1 in antares::(anonymous namespace)::main(int, char* const*) ()
#13 0x00000000004969a6 in antares::wrap_main(std::function<void (int, char* const*)> const&, int, char* const*) ()
#14 0x0000000000407c39 in main ()

Key press "O" on main menu

Thread 1 "antares" received signal SIGSEGV, Segmentation fault.
0x00000000004cf39a in std::function<void ()>::operator=(std::function<void ()> const&) ()
(gdb) bt
#0  0x00000000004cf39a in std::function<void ()>::operator=(std::function<void ()> const&) ()
#1  0x00000000004cc523 in antares::PlainButton::bind(antares::PlainButton::Action) ()
#2  0x00000000004c87b2 in antares::SoundControlScreen::SoundControlScreen(antares::OptionsScreen::State*) ()
#3  0x00000000004c8321 in antares::OptionsScreen::become_front() ()
#4  0x00000000004c015a in antares::CardStack::push(antares::Card*) ()
#5  0x00000000004c7961 in antares::MainScreen::key_up(antares::KeyUpEvent const&) ()
#6  0x0000000000406f9f in antares::GLFWVideoDriver::key(int, int, int, int) ()
#7  0x00007ffff7852368 in processEvent (event=0x7fffffffd0f0) at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/x11_window.c:1389
#8  _glfwPlatformPollEvents () at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/x11_window.c:2786
#9  0x00000000004079a3 in antares::GLFWVideoDriver::loop(antares::Card*) ()
#10 0x0000000000407ed1 in antares::(anonymous namespace)::main(int, char* const*) ()
#11 0x00000000004969a6 in antares::wrap_main(std::function<void (int, char* const*)> const&, int, char* const*) ()
#12 0x0000000000407c39 in main ()
sfiera commented 3 months ago

I assume this is at HEAD. The past couple of changes have been to add some features to the Options screen, but I don’t get segfaults myself.

Do you have the latest version of the submodules too, data in particular?

assertivist commented 3 months ago

Well, I think I was on stable, but i totally messed up my local branch, and also my system python no longer runs the configure script. However, I still get this crash on the latest commit + updated submodules. And I did it right this time, with git submodule update --remote. Also i built with debug symbols this time and got a real stack trace. Maybe something in here is useful.


Thread 1 "antares" received signal SIGSEGV, Segmentation fault.
0x000000000040d9c7 in std::swap<std::_Any_data> (__a=..., __b=...) at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/move.h:198
198           __a = _GLIBCXX_MOVE(__b);
(gdb) bt
#0  0x000000000040d9c7 in std::swap<std::_Any_data> (__a=..., __b=...) at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/move.h:198
#1  0x00000000006debd1 in std::function<void ()>::swap(std::function<void ()>&) (this=0x7fffffffc560, __x=...)
    at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/std_function.h:558
#2  0x00000000006dea82 in std::function<void ()>::operator=(std::function<void ()> const&) (this=0x40, __x=...)
    at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/std_function.h:471
#3  0x00000000006dd681 in antares::PlainButton::Action::operator= (this=0x40) at ../../../include/ui/widget.hpp:154
#4  0x00000000006d84fd in antares::PlainButton::bind (this=0x0, a=...) at ../../../src/ui/widget.cpp:486
#5  0x00000000006c803f in antares::SoundControlScreen::SoundControlScreen (this=0x15c13d0, state=0x170eff8) at ../../../src/ui/screens/options.cpp:188
#6  0x00000000006c7a81 in antares::OptionsScreen::become_front (this=0x170efe0) at ../../../src/ui/screens/options.cpp:120
#7  0x00000000006ab5b7 in antares::CardStack::push (this=0x7fffffffd050, card=0x170efe0) at ../../../src/ui/card.cpp:64
#8  0x00000000006c6a77 in antares::MainScreen::MainScreen()::$_10::operator()() const (this=0x156f940) at ../../../src/ui/screens/main.cpp:95
#9  0x00000000006c6a25 in std::__invoke_impl<void, antares::MainScreen::MainScreen()::$_10&>(std::__invoke_other, antares::MainScreen::MainScreen()::$_10&) (__f=...)
    at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/invoke.h:61
#10 0x00000000006c69d5 in std::__invoke_r<void, antares::MainScreen::MainScreen()::$_10&>(antares::MainScreen::MainScreen()::$_10&) (__fn=...)
    at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/invoke.h:150
#11 0x00000000006c68dd in std::_Function_handler<void (), antares::MainScreen::MainScreen()::$_10>::_M_invoke(std::_Any_data const&) (__functor=...)
    at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/std_function.h:290
#12 0x0000000000684a45 in std::function<void ()>::operator()() const (this=0x156f940) at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/std_function.h:591
#13 0x00000000006d8547 in antares::PlainButton::action (this=0x156f900) at ../../../src/ui/widget.cpp:490
#14 0x00000000006b66d9 in antares::InterfaceScreen::mouse_up (this=0x160c1b0, event=...) at ../../../src/ui/screen.cpp:133
#15 0x00000000006c4201 in antares::MainScreen::mouse_up (this=0x160c1b0, event=...) at ../../../src/ui/screens/main.cpp:151
#16 0x00000000006b01ae in antares::MouseUpEvent::send (this=0x7fffffffcc60, receiver=0x160c1b0) at ../../../src/ui/event.cpp:47
#17 0x00000000004093d4 in antares::GLFWVideoDriver::mouse_button (this=0x7fffffffd190, button=0, action=0, mods=0) at ../../../src/glfw/video-driver.cpp:376
#18 0x0000000000409624 in antares::GLFWVideoDriver::mouse_button_callback (w=0xc038f0, button=0, action=0, mods=0) at ../../../src/glfw/video-driver.cpp:434
#19 0x00007ffff7852d07 in _glfwInputMouseClick (mods=<optimized out>, action=0, button=0, window=<optimized out>) at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/input.c:323
#20 _glfwInputMouseClick (mods=<optimized out>, action=0, button=0, window=<optimized out>) at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/input.c:309
#21 processEvent (event=0x7fffffffce10) at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/x11_window.c:1433
#22 _glfwPlatformPollEvents () at /usr/src/debug/glfw-3.3.8-4.fc39.x86_64/src/x11_window.c:2786
#23 0x0000000000409baa in antares::GLFWVideoDriver::loop (this=0x7fffffffd190, initial=0xbf1610) at ../../../src/glfw/video-driver.cpp:515
#24 0x000000000040bfb8 in antares::(anonymous namespace)::main (argc=1, argv=0x7fffffffd828) at ../../../src/glfw/main.cpp:131
#25 0x000000000040f81a in std::__invoke_impl<void, void (*&)(int, char* const*), int, char* const*>
    (__f=@0x7fffffffd6d0: 0x40bb30 <antares::(anonymous namespace)::main(int, char* const*)>, __args=@0x7fffffffd614: 1, __args=@0x7fffffffd608: 0x7fffffffd828)
    at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/invoke.h:61
#26 0x000000000040f7b5 in std::__invoke_r<void, void (*&)(int, char* const*), int, char* const*>
    (__fn=@0x7fffffffd6d0: 0x40bb30 <antares::(anonymous namespace)::main(int, char* const*)>, __args=@0x7fffffffd614: 1, __args=@0x7fffffffd608: 0x7fffffffd828)
    at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/invoke.h:150
#27 0x000000000040f6ad in std::_Function_handler<void (int, char* const*), void (*)(int, char* const*)>::_M_invoke(std::_Any_data const&, int&&, char* const*&&)
    (__functor=..., __args=@0x7fffffffd614: 1, __args=@0x7fffffffd608: 0x7fffffffd828) at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/std_function.h:290
#28 0x00000000006374a4 in std::function<void (int, char* const*)>::operator()(int, char* const*) const (this=0x7fffffffd6d0, __args=1, __args=0x7fffffffd828)
    at /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/std_function.h:591
#29 0x0000000000637323 in antares::wrap_main(std::function<void (int, char* const*)> const&, int, char* const*) (main=..., argc=1, argv=0x7fffffffd828) at ../../../src/lang/exception.cpp:51
#30 0x000000000040bae8 in main (argc=1, argv=0x7fffffffd828) at ../../../src/glfw/main.cpp:137
(gdb) s
sfiera commented 3 months ago

Hmm, that crash still looks consistent with running the new binary with old data. I assume you’re running the binary from out/cur/antares; does the crash happen if you explicitly pass the path to the submodule (out/cur/antares -a ./data)? It might be using the installed data if you don’t do that (I think out/cur/antares --help will clarify).

assertivist commented 3 months ago

No it does not, thanks for being patient with me!