Skarsnik / QUsb2snes

A Qt based webserver for usb2snes. Users: go check usb2snes.com
https://skarsnik.github.io/QUsb2snes/
GNU General Public License v3.0
52 stars 34 forks source link

QUsb2Snes crashed on MacOS (BigSur) #95

Closed sbzappa closed 2 years ago

sbzappa commented 3 years ago

I managed to make QUsb2Snes crash on Mac while using Poptracker (Secret of Mana pack) with RetroArch.

Repro Steps:

QUsb2Snes crashes.

At a glance, it appears there is a missing null check in AppUI::addDevicesInfo()

Here is the stack:


0   nyo.skarsnik.QUsb2Snes          0x00000001071830ec AppUi::addDevicesInfo(DeviceFactory*) + 748
1   nyo.skarsnik.QUsb2Snes          0x0000000107182d7c AppUi::onMenuAboutToshow() + 188
2   org.qt-project.QtCore           0x00000001080bb06f QMetaObject::activate(QObject*, int, int, void**) + 2319
3   org.qt-project.QtWidgets        0x0000000107391df8 0x107208000 + 1613304
4   org.qt-project.QtCore           0x00000001080bb06f QMetaObject::activate(QObject*, int, int, void**) + 2319
5   libqcocoa.dylib                 0x00000001085d0fb0 0x108599000 + 229296
6   com.apple.AppKit                0x00007fff2347524c -[NSMenu _sendMenuOpeningNotification:] + 97
7   com.apple.AppKit                0x00007fff231e33c5 -[NSCarbonMenuImpl _carbonOpenEvent:handlerCallRef:] + 191
8   com.apple.AppKit                0x00007fff2311d5d1 NSSLMMenuEventHandler + 1078
9   com.apple.HIToolbox             0x00007fff2882e631 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1362
10  com.apple.HIToolbox             0x00007fff2882da53 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 331
11  com.apple.HIToolbox             0x00007fff2882d8fc SendEventToEventTargetWithOptions + 45
12  com.apple.HIToolbox             0x00007fff288b2491 SendMenuOpening(MenuSelectData*, MenuData*, double, unsigned int, unsigned int, __CFDictionary*, unsigned char, unsigned char*) + 513
13  com.apple.HIToolbox             0x00007fff289d77c4 DrawTheMenu(MenuSelectData*, MenuData*, __CFArray**, unsigned char, unsigned char*) + 268
14  com.apple.HIToolbox             0x00007fff288d1bbb OpenSubmenu(MenuSelectData*, MenuData*, unsigned char, unsigned char*) + 199
15  com.apple.HIToolbox             0x00007fff289daa3e TrackMenuCommon(MenuSelectData&, unsigned char*, SelectionData*, MenuResult*, MenuResult*) + 1368
16  com.apple.HIToolbox             0x00007fff289d6f3b PopUpMenuSelectCore(MenuData*, Point, double, Point, unsigned short, unsigned int, unsigned int, Rect const*, unsigned short, unsigned int, Rect const*, Rect const*, __CFDictionary const*, __CFString const*, OpaqueMenuRef**, unsigned short*) + 1274
17  com.apple.HIToolbox             0x00007fff289d654a _HandlePopUpMenuSelection8(OpaqueMenuRef*, OpaqueEventRef*, unsigned int, Point, unsigned short, unsigned int, unsigned int, Rect const*, unsigned short, Rect const*, Rect const*, __CFDictionary const*, __CFString const*, OpaqueMenuRef**, unsigned short*) + 410
18  com.apple.HIToolbox             0x00007fff288ab019 _HandlePopUpMenuSelectionWithDictionary + 329
19  com.apple.AppKit                0x00007fff232e49ea SLMPerformPopUpCarbonMenu + 2227
20  com.apple.AppKit                0x00007fff23180361 _NSSLMPopUpCarbonMenu3 + 1096
21  com.apple.AppKit                0x00007fff2317fe73 -[NSCarbonMenuImpl popUpMenu:atLocation:width:forView:withSelectedItem:withFont:withFlags:withOptions:] + 445
22  com.apple.AppKit                0x00007fff235849b6 +[NSStatusBarButtonCell popupStatusBarMenu:ofBar:inRect:ofView:withEvent:] + 388
23  com.apple.AppKit                0x00007fff235879b3 -[NSStatusItem popUpStatusItemMenu:] + 147
24  com.apple.AppKit                0x00007fff23031e5e -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4961
25  com.apple.AppKit                0x00007fff22fa1648 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2594
26  com.apple.AppKit                0x00007fff22fa0a06 -[NSWindow(NSEventRouting) sendEvent:] + 347
27  com.apple.AppKit                0x00007fff23586282 -[NSStatusBarWindow sendEvent:] + 618
28  com.apple.AppKit                0x00007fff22f9ee14 -[NSApplication(NSEvent) sendEvent:] + 352
29  libqcocoa.dylib                 0x00000001085d07aa 0x108599000 + 227242
30  com.apple.AppKit                0x00007fff23277be1 -[NSApplication _handleEvent:] + 65
31  com.apple.AppKit                0x00007fff22e07c8e -[NSApplication run] + 623
32  libqcocoa.dylib                 0x00000001085cd013 0x108599000 + 213011
33  org.qt-project.QtCore           0x0000000108084fef QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 431
34  org.qt-project.QtCore           0x000000010808a182 QCoreApplication::exec() + 130
35  nyo.skarsnik.QUsb2Snes          0x00000001071a4c23 main + 3795
36  libdyld.dylib                   0x00007fff20533f3d start + 1```
sbzappa commented 3 years ago

QUsb2Snes_2021-09-12-125830.log

black-sliver commented 3 years ago

There have been some changes to the UI code to fix RA status, but there are still some bugs left. I think I identified all crashes, so we'll probably have a release soon :tm:

Skarsnik commented 2 years ago

Does this still happen?

sbzappa commented 2 years ago

No, doesn't happen anymore with newer QUsb2Snes. I think we can close this!

Skarsnik commented 2 years ago

k