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

[Qt] Crash when connecting Switch Pro Controller via USB #1622

Closed
Parnassius opened this issue Jan 19, 2020 · 4 comments
Closed

[Qt] Crash when connecting Switch Pro Controller via USB #1622

Parnassius opened this issue Jan 19, 2020 · 4 comments

Comments

@Parnassius
Copy link

@Parnassius Parnassius commented Jan 19, 2020

Steps to reproduce

  • Connect a Nintendo Switch Pro Controller via Bluetooth
  • Open mGBA
  • Go to Tools -> Settings -> Controllers, and make sure 'Pro Controller' is selected (might not be required, not sure)
  • Connect the controller to the pc with a USB-C cable
  • mGBA crashes after a few seconds

This always happens, both with and without a game loaded.

OS:

  • Debian 10 x86-64, mGBA 0.8-b1, 0.7.3, 0.7.2, 0.7.1, 0.7.0
  • Ubuntu 19.10 x86-64, mGBA 0.7.0
@endrift
Copy link
Member

@endrift endrift commented Jan 21, 2020

This appears to have already been fixed in the dev builds, so it should be fine in 0.8.0 final when that comes out.

@endrift endrift closed this Jan 21, 2020
@Parnassius
Copy link
Author

@Parnassius Parnassius commented Jan 21, 2020

I just built master (6ae02d0) and it still crashes, should I try a different branch?

Anyway here's the backtrace given by the KDE crash handler, not sure if it helps:

Application: mgba-qt (mgba-qt), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fd4867a9cc0 (LWP 8551))]

Thread 5 (Thread 0x7fd475cb2700 (LWP 8556)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x5614cdaa4dc8) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x5614cdaa4d78, cond=0x5614cdaa4da0) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=cond@entry=0x5614cdaa4da0, mutex=mutex@entry=0x5614cdaa4d78) at pthread_cond_wait.c:655
#3  0x00007fd476be2e03 in cnd_wait (mtx=0x5614cdaa4d78, cond=0x5614cdaa4da0) at ../src/../include/c11/threads_posix.h:155
#4  util_queue_thread_func (input=input@entry=0x5614cda4e300) at ../src/util/u_queue.c:270
#5  0x00007fd476be2b57 in impl_thrd_routine (p=<optimized out>) at ../src/../include/c11/threads_posix.h:87
#6  0x00007fd48c4effa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7  0x00007fd48b0204cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7fd4765f4700 (LWP 8555)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x5614cd9cdf58) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x5614cd9cdf08, cond=0x5614cd9cdf30) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=cond@entry=0x5614cd9cdf30, mutex=mutex@entry=0x5614cd9cdf08) at pthread_cond_wait.c:655
#3  0x00007fd476be2e03 in cnd_wait (mtx=0x5614cd9cdf08, cond=0x5614cd9cdf30) at ../src/../include/c11/threads_posix.h:155
#4  util_queue_thread_func (input=input@entry=0x5614cdc3a670) at ../src/util/u_queue.c:270
#5  0x00007fd476be2b57 in impl_thrd_routine (p=<optimized out>) at ../src/../include/c11/threads_posix.h:87
#6  0x00007fd48c4effa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7  0x00007fd48b0204cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7fd47f12c700 (LWP 8553)):
#0  0x00007fd48b015819 in __GI___poll (fds=0x7fd478004db0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fd489b21136 in g_main_context_poll (priority=<optimized out>, n_fds=1, fds=0x7fd478004db0, timeout=<optimized out>, context=0x7fd478000bf0) at ../../../glib/gmain.c:4221
#2  g_main_context_iterate (context=context@entry=0x7fd478000bf0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:3915
#3  0x00007fd489b2125c in g_main_context_iteration (context=0x7fd478000bf0, may_block=may_block@entry=1) at ../../../glib/gmain.c:3981
#4  0x00007fd48b6c67b3 in QEventDispatcherGlib::processEvents (this=0x7fd478000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#5  0x00007fd48b6741cb in QEventLoop::exec (this=this@entry=0x7fd47f12bd30, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140
#6  0x00007fd48b4c3e96 in QThread::exec (this=this@entry=0x7fd4862d0d60 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at ../../include/QtCore/../../src/corelib/global/qflags.h:120
#7  0x00007fd486251545 in QDBusConnectionManager::run (this=0x7fd4862d0d60 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:178
#8  0x00007fd48b4cda87 in QThreadPrivate::start (arg=0x7fd4862d0d60 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:367
#9  0x00007fd48c4effa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#10 0x00007fd48b0204cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fd485999700 (LWP 8552)):
#0  0x00007fd48b015819 in __GI___poll (fds=fds@entry=0x7fd485998c78, nfds=nfds@entry=1, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fd4899b8cf7 in poll (__timeout=-1, __nfds=1, __fds=0x7fd485998c78) at /usr/include/x86_64-linux-gnu/bits/poll2.h:46
#2  _xcb_conn_wait (c=c@entry=0x5614cd8421a0, cond=cond@entry=0x5614cd8421e0, vector=vector@entry=0x0, count=count@entry=0x0) at ../../src/xcb_conn.c:479
#3  0x00007fd4899ba91a in xcb_wait_for_event (c=0x5614cd8421a0) at ../../src/xcb_in.c:697
#4  0x00007fd48635ed79 in QXcbEventReader::run (this=0x5614cd84c970) at qxcbconnection.h:409
#5  0x00007fd48b4cda87 in QThreadPrivate::start (arg=0x5614cd84c970) at thread/qthread_unix.cpp:367
#6  0x00007fd48c4effa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7  0x00007fd48b0204cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fd4867a9cc0 (LWP 8551)):
[KCrash Handler]
#6  __strncmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:101
#7  0x00007fd48ccd3a97 in SDL_FixupJoystickName (name=0x101070001030101 <error: Cannot access memory at address 0x101070001030101>) at ./src/joystick/SDL_joystick.c:203
#8  0x00005614cbda8be4 in QGBA::InputController::updateJoysticks() ()
#9  0x00007fd48b69e9a3 in QtPrivate::QSlotObjectBase::call (a=0x7ffc909a0be0, r=0x5614cd8f3058, this=0x5614cdb59ee0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:376
#10 QMetaObject::activate (sender=0x5614cd8f3058, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3754
#11 0x00007fd48b6aa3f7 in QTimer::timeout (this=<optimized out>, _t1=...) at .moc/moc_qtimer.cpp:200
#12 0x00007fd48b69f09b in QObject::event (this=0x5614cd8f3058, e=<optimized out>) at kernel/qobject.cpp:1232
#13 0x00007fd48bff04c1 in QApplicationPrivate::notify_helper (this=this@entry=0x5614cd8318d0, receiver=receiver@entry=0x5614cd8f3058, e=e@entry=0x7ffc909a0eb0) at kernel/qapplication.cpp:3726
#14 0x00007fd48bff7970 in QApplication::notify (this=0x7ffc909a12b0, receiver=0x5614cd8f3058, e=0x7ffc909a0eb0) at kernel/qapplication.cpp:3485
#15 0x00007fd48b6754f9 in QCoreApplication::notifyInternal2 (receiver=0x5614cd8f3058, event=event@entry=0x7ffc909a0eb0) at ../../include/QtCore/5.11.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#16 0x00007fd48b6c5ba8 in QCoreApplication::sendEvent (event=0x7ffc909a0eb0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#17 QTimerInfoList::activateTimers (this=0x5614cd891e80) at kernel/qtimerinfo_unix.cpp:643
#18 0x00007fd48b6c643c in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:182
#19 idleTimerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:229
#20 0x00007fd489b20f2e in g_main_dispatch (context=0x7fd480004ff0) at ../../../glib/gmain.c:3182
#21 g_main_context_dispatch (context=context@entry=0x7fd480004ff0) at ../../../glib/gmain.c:3847
#22 0x00007fd489b211c8 in g_main_context_iterate (context=context@entry=0x7fd480004ff0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:3920
#23 0x00007fd489b2125c in g_main_context_iteration (context=0x7fd480004ff0, may_block=may_block@entry=1) at ../../../glib/gmain.c:3981
#24 0x00007fd48b6c6797 in QEventDispatcherGlib::processEvents (this=0x5614cd89dd70, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#25 0x00007fd4863f5401 in QPAEventDispatcherGlib::processEvents (this=0x5614cd89dd70, flags=...) at qeventdispatcher_glib.cpp:69
#26 0x00007fd48b6741cb in QEventLoop::exec (this=this@entry=0x7ffc909a1130, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140
#27 0x00007fd48b67c1a2 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:120
#28 0x00005614cbd5a26b in main ()
[Inferior 1 (process 8551) detached]

Thanks for your time!

@endrift
Copy link
Member

@endrift endrift commented Jan 21, 2020

Strange, it didn't crash for me when I tried master but it did crash with 0.8-b1. I'll see if I can fix this blind.

@endrift
Copy link
Member

@endrift endrift commented Feb 16, 2020

I managed to reproduce it with the same backtrace, so it should be fixed for real this time.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.