adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.1k stars 1.22k forks source link

Battle.net crashes when a CircuitPython device is connected #4588

Open rhooper opened 3 years ago

rhooper commented 3 years ago

Battle.net crashes when a CircuitPython device is connected

Devices and Versions

Some examples from devices on my desk:

Behavior

The presence of a CircuitPython board causes Battle.net to crash, during IOHID related code.

Plug a CircuitPython board and start Battle.net. Battle.net will crash. Start Battle.net without any CircuitPython boards plugged in. Plug one in, and Battle.net will crash.

Double-press the reset button to enter the boot loader. Start Battle.net. It does not crash. Exit the bootloader with a reset. Battle.net crashes.

Description

There appears to be something special about the HID device behaviour while CircuitPython is running that causes Battle.net to crash at startup.

This is not a new bug. It was first observed in Sept or Oct 2019.

Additional Info

Here is a sample crash dump from Battle.net (~Library/Application Support/Battle.net/Errors) always contains an attempt to access memory at 0x0

<BlizzardError.Summary:>
EXC_BAD_ACCESS: KERN_INVALID_ADDRESS at 0x0000000000000000

<:BlizzardError.Summary>

<Exception.Assertion:>
KERN_INVALID_ADDRESS at 0x0000000000000000
Thread 0x00000307 "CrBrowserMain" [Stack Base: 0x00000000e9af7000 Used Space: 10072/8388608 bytes]
  0 0x00007FFF2E5A982B "com.apple.CoreFoundation"             CFArrayGetCount + 6
  1 0x00007FFF313B6671 "com.apple.framework.IOKit"            __IOHIDManagerDeviceApplier + 764
  2 0x00007FFF2E5D66DE "com.apple.CoreFoundation"             __CFSetApplyFunction_block_invoke + 18
  3 0x00007FFF2E5D654F "com.apple.CoreFoundation"             CFBasicHashApply + 115
  4 0x00007FFF2E5D64C4 "com.apple.CoreFoundation"             CFSetApplyFunction + 129
  5 0x00007FFF313B50DA "com.apple.framework.IOKit"            __ApplyToDevices + 105
  6 0x00007FFF313B68C4 "com.apple.framework.IOKit"            __IOHIDManagerInitialEnumCallback + 39
  7 0x00007FFF2E60DF12 "com.apple.CoreFoundation"             __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
  8 0x00007FFF2E60DEB1 "com.apple.CoreFoundation"             __CFRunLoopDoSource0 + 103
  9 0x00007FFF2E60DD27 "com.apple.CoreFoundation"             __CFRunLoopDoSources0 + 301
 10 0x00007FFF2E60C9FA "com.apple.CoreFoundation"             __CFRunLoopRun + 927
 11 0x00007FFF2E60BFFE "com.apple.CoreFoundation"             CFRunLoopRunSpecific + 462
 12 0x00007FFF2D23FABD "com.apple.HIToolbox"                  RunCurrentEventLoopInMode + 292
 13 0x00007FFF2D23F6F4 "com.apple.HIToolbox"                  ReceiveNextEventCommon + 359
 14 0x00007FFF2D23F579 "com.apple.HIToolbox"                  _BlockUntilNextEventMatchingListInModeWithFilter + 64
 15 0x00007FFF2B88AC99 "com.apple.AppKit"                     _DPSNextEvent + 883
 16 0x00007FFF2B8894E0 "com.apple.AppKit"                     -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
 17 0x00007FFF2B87B1EE "com.apple.AppKit"                     -[NSApplication run] + 658
 18 0x000000010EC06401 "libqcocoa.dylib"                      qt_plugin_instance + 134689
 19 0x000000010C6E02B1 "QtCore"                               QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 417
 20 0x000000010C6E4E66 "QtCore"                               QCoreApplication::exec() + 390
 21 0x0000000109ABFF2D "net.battle.app.framework"             Run + 8040738
 22 0x0000000109ABFC62 "net.battle.app.framework"             Run + 8040023
 23 0x0000000109314E42 "net.battle.app.framework"             Run + 55
 24 0x000000010610F05E "net.battle.app"                      
 25 0x00007FFF68555CC9 "libdyld.dylib"                        start + 1

<:Exception.Assertion>
tannewt commented 3 years ago

Is it possible to file an issue on Battle.net? I'm not sure it's something to fix on the CP side.