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 key binding configuration screen #458

Closed assertivist closed 11 months ago

assertivist commented 11 months ago

I was doing the usual thing on a new Antares install with a laptop, and rebinding all the keyboard keys off of the number pad. I rebound W to ACCEL and A to ROTATE COUNTER-CLOCKWISE, and so forth for WASD, but then as soon as I got to fire controls and tried to map the space bar, I got a segfault. After restarting, I go to this screen, click one of the buttons, and press a key, same segfault. It appears that anytime I try to bind the space bar, I get a segfault.

Thread 1 "antares" received signal SIGSEGV, Segmentation fault.
0x00000000004c8c0f in antares::KeyControlScreen::flash_on(unsigned long) ()
Missing separate debuginfos, use: dnf debuginfo-install llvm-libs-15.0.7-2.fc37.x86_64
(gdb) bt
#0  0x00000000004c8c0f in antares::KeyControlScreen::flash_on(unsigned long) ()
#1  0x00000000004c8924 in antares::KeyControlScreen::adjust_interface() ()
#2  0x0000000000406e17 in antares::GLFWVideoDriver::key(int, int, int, int) ()
#3  0x00007ffff7873d39 in processEvent (event=0x7fffffffd1e0) at /usr/src/debug/glfw-3.3.8-1.fc37.x86_64/src/x11_window.c:1271
#4  _glfwPlatformPollEvents () at /usr/src/debug/glfw-3.3.8-1.fc37.x86_64/src/x11_window.c:2786
#5  0x00000000004078ad in antares::GLFWVideoDriver::loop(antares::Card*) ()
#6  0x0000000000407e06 in antares::(anonymous namespace)::main(int, char* const*) ()
#7  0x000000000049638e in antares::wrap_main(std::function<void (int, char* const*)> const&, int, char* const*) ()
#8  0x0000000000407b4d in main ()
(gdb) 

config.pn:

sound:  {volume: 8, speech: false, "idle music": true, "game music": true}
keys:   {"ship accel": 4, "ship decel": 4, "ship ccw": 4, "ship cw": 7, "fire 1": 44, "fire 2": 227, "fire s": 44, warp: 43, "select friendly": 83, "select hostile": 103, "select base": 84, target: 225, order: 224, "zoom in": 87, "zoom out": 86, "comp up": 82, "comp down": 81, "comp accept": 79, "comp cancel": 80, transfer: 65, "zoom 1:1": 66, "zoom 1:2": 67, "zoom 1:4": 68, "zoom 1:16": 69, "zoom hostile": 117, "zoom object": 74, "zoom all": 75, "next message": 42, help: 58, "volume down": 59, "volume up": 60, "game music": 61, "net settings": 62, "fast motion": 63, "hotkey 1": 30, "hotkey 2": 31, "hotkey 3": 32, "hotkey 4": 33, "hotkey 5": 34, "hotkey 6": 35, "hotkey 7": 36, "hotkey 8": 37, "hotkey 9": 38, "hotkey 10": 39}
video:
        fullscreen:  false
        window:      {width: 2160, height: 1261}

I see that several keys are set to 4 which is unexpected, as the screen reported the correct keys on the button labels. Deleting config.pn caused this to stop happening.

I can re-enter/trigger this condition by performing the following steps:

  1. Click FIRE WEAPON 1
  2. Press Space

core attached keybind_screen_segfault.106720.tar.gz

ThinkPad X1 Nano Gen 2 running Fedora Linux 37 with KDE Plasma / Wayland, Intel graphics Linux fedora 6.4.4-100.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 19 17:06:05 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

GLFW version 3.3.8 release 1.fc37

sfiera commented 11 months ago

Is this at HEAD?

I see this crash at HEAD (it’s just a dumb string mismatch between data and code, triggers on any key conflict) but I just changed that yesterday.

assertivist commented 11 months ago

Yes, this is in master branch. Worked great after checking out sfiera/crash and updating data submodule! Thanks!

sfiera commented 11 months ago

OK, thanks for the report! I guess the options test should trigger a conflict.