-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
3.3.0 segfaults when connecting a controller #579
Comments
That is a quick report. It must crash on something simple in the main function. Are you able to compile antimicrox by yourself with an enabled debug flag and then run it with gdb to properly check which line crashes? |
GNU gdb (Gentoo 11.2 vanilla) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bin/antimicrox...
(gdb) run
Starting program: /home/xy/source/public/github.com/AntiMicroX/antimicrox/build/bin/antimicrox
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff2202640 (LWP 9380)]
[New Thread 0x7fffeb614640 (LWP 9381)]
[New Thread 0x7fffeae13640 (LWP 9382)]
[New Thread 0x7fffe90ab640 (LWP 9383)]
[New Thread 0x7fffe88aa640 (LWP 9384)]
[New Thread 0x7fffdbfff640 (LWP 9385)]
[New Thread 0x7fffdb7fe640 (LWP 9386)]
[New Thread 0x7fffdaffd640 (LWP 9387)]
[New Thread 0x7fffda7fc640 (LWP 9388)]
[New Thread 0x7fffd9ffb640 (LWP 9389)]
[New Thread 0x7fffd97fa640 (LWP 9390)]
[New Thread 0x7fffd8ff9640 (LWP 9391)]
[New Thread 0x7fffb3fff640 (LWP 9392)]
[New Thread 0x7fffaad6a640 (LWP 9416)]
[New Thread 0x7fffaa569640 (LWP 9417)]
[New Thread 0x7fffa9d68640 (LWP 9418)]
[New Thread 0x7fffa9567640 (LWP 9419)]
[New Thread 0x7fffa8d66640 (LWP 9420)]
[New Thread 0x7fff9bfff640 (LWP 9421)]
[New Thread 0x7fff9b7fe640 (LWP 9422)]
[New Thread 0x7fff9affd640 (LWP 9423)]
[New Thread 0x7fff9a7fc640 (LWP 9424)]
[New Thread 0x7fff99ffb640 (LWP 9425)]
[New Thread 0x7fff997fa640 (LWP 9426)]
[New Thread 0x7fff98ff9640 (LWP 9427)]
Thread 14 "inputEventThrea" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffb3fff640 (LWP 9392)]
0x0000555555887bac in VDPad::VDPad (this=0x7fffb8065640, upButton=0x7fffb802f650, downButton=0x0, leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555f05de0, parent=0x555555f05de0) at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/vdpad.cpp:44
44 downButton->setVDPad(this);
(gdb) info frame
Stack level 0, frame at 0x7fffb3ffe340:
rip = 0x555555887bac in VDPad::VDPad (/home/xy/source/public/github.com/AntiMicroX/antimicrox/src/vdpad.cpp:44);
saved rip = 0x5555556c9412
called by frame at 0x7fffb3ffe3a0
source language c++.
Arglist at 0x7fffb3ffe330, args: this=0x7fffb8065640, upButton=0x7fffb802f650, downButton=0x0, leftButton=0x0,
rightButton=0x0, index=0, originset=0, parentSet=0x555555f05de0, parent=0x555555f05de0
Locals at 0x7fffb3ffe330, Previous frame's sp is 0x7fffb3ffe340
Saved registers:
rbx at 0x7fffb3ffe328, rbp at 0x7fffb3ffe330, rip at 0x7fffb3ffe338
(gdb) bt
#0 0x0000555555887bac in VDPad::VDPad (this=0x7fffb8065640, upButton=0x7fffb802f650, downButton=0x0,
leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555f05de0, parent=0x555555f05de0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/vdpad.cpp:44
#1 0x00005555556c9412 in GameControllerDPad::GameControllerDPad (this=0x7fffb8065640, upButton=0x7fffb802f650,
downButton=0x0, leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555f05de0,
parent=0x555555f05de0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerdpad.cpp:31
#2 0x00005555556c9ba1 in GameControllerSet::populateSticksDPad (this=0x555555f05de0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:90
#3 0x00005555556c995a in GameControllerSet::resetSticks (this=0x555555f05de0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:65
#4 0x00005555556c9843 in GameControllerSet::GameControllerSet (this=0x555555f05de0, device=0x7fffb8004b40,
index=0, parent=0x7fffb8004b40)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:38
#5 0x00005555556c614d in GameController::GameController (this=0x7fffb8004b40, controller=0x7fffb80056b0,
deviceIndex=0, settings=0x7fffffffc4b0, counterUniques=0, parent=0x555555bf1bb0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontroller.cpp:53
#6 0x00005555557ceac3 in InputDaemon::addInputDevice (this=0x555555bf1bb0, index=0, uniques=...,
counterUniques=@0x7fffb3ffe730: 1, duplicatedGamepad=@0x7fffb3ffe729: false)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/inputdaemon.cpp:642
#7 0x00005555557d11e9 in InputDaemon::secondInputPass (this=0x555555bf1bb0, sdlEventQueue=0x7fffb3ffe8a0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/inputdaemon.cpp:1252
#8 0x00005555557cc7aa in InputDaemon::run (this=0x555555bf1bb0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/inputdaemon.cpp:117
#9 0x00005555556acd7b in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (InputDaemon::*)()>::call(void (InputDaemon::*)(), InputDaemon*, void**) (
f=(void (InputDaemon::*)(InputDaemon * const)) 0x5555557cc70e <InputDaemon::run()>, o=0x555555bf1bb0,
arg=0x7fffb4009b88) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
#10 0x00005555556ac8af in QtPrivate::FunctionPointer<void (InputDaemon::*)()>::call<QtPrivate::List<>, void>(void (InputDaemon::*)(), InputDaemon*, void**) (
f=(void (InputDaemon::*)(InputDaemon * const)) 0x5555557cc70e <InputDaemon::run()>, o=0x555555bf1bb0,
arg=0x7fffb4009b88) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
#11 0x00005555556abbac in QtPrivate::QSlotObject<void (InputDaemon::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555555c32150, r=0x555555bf1bb0,
a=0x7fffb4009b88, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:418
#12 0x00007ffff6973a4a in QObject::event(QEvent*) () from /usr/lib64/libQt5Core.so.5
#13 0x00007ffff79baf7f in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
from /usr/lib64/libQt5Widgets.so.5
#14 0x00007ffff6944788 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#15 0x00007ffff6947c26 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
from /usr/lib64/libQt5Core.so.5
#16 0x00007ffff69a1873 in ?? () from /usr/lib64/libQt5Core.so.5
#17 0x00007ffff51e5f2b in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#18 0x00007ffff51e61f8 in ?? () from /usr/lib64/libglib-2.0.so.0
#19 0x00007ffff51e62cf in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#20 0x00007ffff69a0e44 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib64/libQt5Core.so.5
#21 0x00007ffff6942f0b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib64/libQt5Core.so.5
#22 0x00007ffff6748e9e in QThread::exec() () from /usr/lib64/libQt5Core.so.5
#23 0x00007ffff674a14f in ?? () from /usr/lib64/libQt5Core.so.5
#24 0x00007ffff61f5c5a in ?? () from /lib64/libc.so.6
--Type <RET> for more, q to quit, c to continue without paging--c
#25 0x00007ffff627bb7c in ?? () from /lib64/libc.so.6
(gdb)
|
(gdb) where
#0 0x0000555555887bac in VDPad::VDPad (this=0x555555c2aac0, upButton=0x555555c48cc0, downButton=0x0,
leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555c71370, parent=0x555555c71370)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/vdpad.cpp:44
#1 0x00005555556c9412 in GameControllerDPad::GameControllerDPad (this=0x555555c2aac0, upButton=0x555555c48cc0,
downButton=0x0, leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555c71370,
parent=0x555555c71370)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerdpad.cpp:31
#2 0x00005555556c9ba1 in GameControllerSet::populateSticksDPad (this=0x555555c71370)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:90
#3 0x00005555556c995a in GameControllerSet::resetSticks (this=0x555555c71370)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:65
#4 0x00005555556c9843 in GameControllerSet::GameControllerSet (this=0x555555c71370, device=0x555555c5d590,
index=0, parent=0x555555c5d590)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:38
#5 0x00005555556c614d in GameController::GameController (this=0x555555c5d590, controller=0x555555c5a5c0,
deviceIndex=0, settings=0x7fffffffc4e0, counterUniques=0, parent=0x555555bf3ac0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontroller.cpp:53
#6 0x00005555557cd07e in InputDaemon::refreshJoysticks (this=0x555555bf3ac0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/inputdaemon.cpp:242
#7 0x00005555557cc100 in InputDaemon::InputDaemon (this=0x555555bf3ac0, joysticks=0x555555bc4920,
settings=0x7fffffffc4e0, graphical=true, parent=0x0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/inputdaemon.cpp:53
#8 0x00005555556a4faf in main (argc=1, argv=0x7fffffffc958)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/main.cpp:562
(gdb) |
Ok, It crashes here VDPad::VDPad(JoyButton *upButton, JoyButton *downButton, JoyButton *leftButton, JoyButton *rightButton, int index,
int originset, SetJoystick *parentSet, QObject *parent)
: JoyDPad(index, originset, parentSet, parent)
{
this->upButton = upButton;
upButton->setVDPad(this);
this->downButton = downButton;
downButton->setVDPad(this); //HERE
I can guess, that |
JoyButton *buttonUp = getJoyButton(SDL_CONTROLLER_BUTTON_DPAD_UP); //we get nulls here
JoyButton *buttonDown = getJoyButton(SDL_CONTROLLER_BUTTON_DPAD_DOWN);
JoyButton *buttonLeft = getJoyButton(SDL_CONTROLLER_BUTTON_DPAD_LEFT);
JoyButton *buttonRight = getJoyButton(SDL_CONTROLLER_BUTTON_DPAD_RIGHT);
GameControllerDPad *controllerDPad =
new GameControllerDPad(buttonUp, buttonDown, buttonLeft, buttonRight, 0, getIndex(), this, this); It seems to have less buttons than typical GameController should have. typedef enum
{
SDL_CONTROLLER_BUTTON_INVALID = -1,
SDL_CONTROLLER_BUTTON_A,
SDL_CONTROLLER_BUTTON_B,
SDL_CONTROLLER_BUTTON_X,
SDL_CONTROLLER_BUTTON_Y,
SDL_CONTROLLER_BUTTON_BACK,
SDL_CONTROLLER_BUTTON_GUIDE,
SDL_CONTROLLER_BUTTON_START,
SDL_CONTROLLER_BUTTON_LEFTSTICK,
SDL_CONTROLLER_BUTTON_RIGHTSTICK,
SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
SDL_CONTROLLER_BUTTON_DPAD_UP,
SDL_CONTROLLER_BUTTON_DPAD_DOWN,
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
SDL_CONTROLLER_BUTTON_MISC1, @xgqt |
I tried this with a off-brand USB PS4-like controller as well as official Dual sense controller (trace if from the off-brand one). |
off-brand PS4:
#0 0x0000555555887bac in VDPad::VDPad (this=0x555555c2dd20, upButton=0x555555c39e80, downButton=0x0,
leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555c73d80, parent=0x555555c73d80)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/vdpad.cpp:44
#1 0x00005555556c9412 in GameControllerDPad::GameControllerDPad (this=0x555555c2dd20, upButton=0x555555c39e80,
downButton=0x0, leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555c73d80,
parent=0x555555c73d80)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerdpad.cpp:31
#2 0x00005555556c9ba1 in GameControllerSet::populateSticksDPad (this=0x555555c73d80)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:90
#3 0x00005555556c995a in GameControllerSet::resetSticks (this=0x555555c73d80)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:65
#4 0x00005555556c9843 in GameControllerSet::GameControllerSet (this=0x555555c73d80, device=0x555555c50d30,
index=0, parent=0x555555c50d30)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:38
#5 0x00005555556c614d in GameController::GameController (this=0x555555c50d30, controller=0x555555c307a0,
deviceIndex=0, settings=0x7fffffffc4e0, counterUniques=0, parent=0x555555bf3560)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontroller.cpp:53
#6 0x00005555557cd07e in InputDaemon::refreshJoysticks (this=0x555555bf3560)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/inputdaemon.cpp:242
#7 0x00005555557cc100 in InputDaemon::InputDaemon (this=0x555555bf3560, joysticks=0x555555bc4350,
settings=0x7fffffffc4e0, graphical=true, parent=0x0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/inputdaemon.cpp:53
#8 0x00005555556a4faf in main (argc=1, argv=0x7fffffffc958)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/main.cpp:562 Dual Sense:
(gdb) run
Starting program: /home/xy/source/public/github.com/AntiMicroX/antimicrox/build/bin/antimicrox
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff2202640 (LWP 15489)]
[New Thread 0x7fffeb614640 (LWP 15494)]
[New Thread 0x7fffeae13640 (LWP 15495)]
Thread 1 "antimicrox" received signal SIGSEGV, Segmentation fault.
0x0000555555887be6 in VDPad::VDPad (this=0x555555c40cf0, upButton=0x555555c75d90, downButton=0x555555c7fce0, leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555c7e010, parent=0x555555c7e010) at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/vdpad.cpp:47
47 leftButton->setVDPad(this);
(gdb) where
#0 0x0000555555887be6 in VDPad::VDPad (this=0x555555c40cf0, upButton=0x555555c75d90, downButton=0x555555c7fce0,
leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555c7e010, parent=0x555555c7e010)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/vdpad.cpp:47
#1 0x00005555556c9412 in GameControllerDPad::GameControllerDPad (this=0x555555c40cf0, upButton=0x555555c75d90,
downButton=0x555555c7fce0, leftButton=0x0, rightButton=0x0, index=0, originset=0, parentSet=0x555555c7e010,
parent=0x555555c7e010)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerdpad.cpp:31
#2 0x00005555556c9ba1 in GameControllerSet::populateSticksDPad (this=0x555555c7e010)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:90
#3 0x00005555556c995a in GameControllerSet::resetSticks (this=0x555555c7e010)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:65
#4 0x00005555556c9843 in GameControllerSet::GameControllerSet (this=0x555555c7e010, device=0x555555c65180,
index=0, parent=0x555555c65180)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontrollerset.cpp:38
#5 0x00005555556c614d in GameController::GameController (this=0x555555c65180, controller=0x555555c5cd60,
deviceIndex=0, settings=0x7fffffffc4e0, counterUniques=0, parent=0x555555bf3400)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/gamecontroller/gamecontroller.cpp:53
#6 0x00005555557cd07e in InputDaemon::refreshJoysticks (this=0x555555bf3400)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/inputdaemon.cpp:242
#7 0x00005555557cc100 in InputDaemon::InputDaemon (this=0x555555bf3400, joysticks=0x555555bc4470,
settings=0x7fffffffc4e0, graphical=true, parent=0x0)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/inputdaemon.cpp:53
#8 0x00005555556a4faf in main (argc=1, argv=0x7fffffffc958)
at /home/xy/source/public/github.com/AntiMicroX/antimicrox/src/main.cpp:562
(gdb) |
So with the off-brand we crash on line 44 and with Dual Sense on 47... |
Could you revert one commit? |
After this revert it works correctly! |
Could you also privide me an some logs from connecting these controllers? |
Those are the logs from the CORRECTED version:
|
And for Dual Sense:
|
And this is from UNPATCHED 3.3.0 with Dual Sense:
|
And this from "off-brand":
|
Now I am surprised |
I created a new release with this revert. I think that it may be caused by broken Could you compile branch button_logs and collect logs from it?
|
|
Thank you for help, |
That's what "downstream" maintainers are for. :) |
Closing. Further investigations of this topic will be in #582 |
Is there an existing issue for this?
Current Behavior
If a controller is already connected and I try to open antimicrox then I get a crash.
If a antimicrox GUI is already already and a controller is connected, be it bluetooth or USB, the program segfaults.
Expected Behavior
No segfault.
Steps To Reproduce
antimiucrox
Environment
Anything else?
The version 3.2.5 works correctly.
The text was updated successfully, but these errors were encountered: