IOHIDElementGetLogicalMax() crash upon startup #548

Closed
bavarious opened this Issue Mar 24, 2013 · 1 comment

Projects

None yet

2 participants

@bavarious
Member

When starting OpenEmu, I get this crash on the main thread:

* thread #1: tid = 0x1d07, 0x00007fff8b8191d1 IOKit`IOHIDElementGetLogicalMax + 4, stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
    frame #0: 0x00007fff8b8191d1 IOKit`IOHIDElementGetLogicalMax + 4
    frame #1: 0x000000010037a18c OpenEmuSystem`-[OEHIDDeviceHandler OE_setUpHatSwitchElement:](self=0x000000010253fb70, _cmd=0x00000001003888c8, element=0x0000000000000000) + 28 at OEHIDDeviceHandler.m:398
    frame #2: 0x00000001003798fa OpenEmuSystem`-[OEHIDDeviceHandler OE_elementForRepresentation:inGenericDesktopElements:andButtonElements:](self=0x000000010253fb70, _cmd=0x000000010038881a, representation=0x000000010235a2b0, genericDesktopElements=0x00000001025591a0, buttonElements=0x00000001025c4a50) + 858 at OEHIDDeviceHandler.m:355
    frame #3: 0x00000001003792b6 OpenEmuSystem`__69-[OEHIDDeviceHandler setUpControllerDescription:usingRepresentation:]_block_invoke123(.block_descriptor=0x00007fff5fbfc0e8, identifier=0x000000010235a250, rep=0x000000010235a2b0, stop=0x00007fff5fbfbd4f) + 134 at OEHIDDeviceHandler.m:297
    frame #4: 0x00007fff8957373f CoreFoundation`____NSDictionaryEnumerate_block_invoke_0399 + 31
    frame #5: 0x00007fff8945e7b0 CoreFoundation`CFBasicHashApply + 128
    frame #6: 0x00007fff894cb7d4 CoreFoundation`__NSDictionaryEnumerate + 868
    frame #7: 0x0000000100378879 OpenEmuSystem`-[OEHIDDeviceHandler setUpControllerDescription:usingRepresentation:](self=0x000000010253fb70, _cmd=0x00000001003855b6, description=0x0000000102359750, controlRepresentations=0x000000010235ab50) + 889 at OEHIDDeviceHandler.m:294
    frame #8: 0x000000010037fdf5 OpenEmuSystem`-[OEControllerDescription OE_setUpControlsWithDeviceHandler:representation:](self=0x0000000102359750, _cmd=0x0000000100388ece, handler=0x000000010253fb70, representation=0x000000010235ab50) + 277 at OEControllerDescription.m:191
    frame #9: 0x000000010037ef65 OpenEmuSystem`+[OEControllerDescription OE_deviceDescriptionForDeviceHandler:](self=0x000000010039e858, _cmd=0x0000000100388e8e, deviceHandler=0x000000010253fb70) + 549 at OEControllerDescription.m:115
    frame #10: 0x0000000100383c96 OpenEmuSystem`+[OEDeviceDescription deviceDescriptionForDeviceHandler:](self=0x000000010039e948, _cmd=0x00000001003854ce, deviceHandler=0x000000010253fb70) + 54 at OEDeviceDescription.m:34
    frame #11: 0x000000010034ba23 OpenEmuSystem`-[OEDeviceHandler deviceDescription](self=0x000000010253fb70, _cmd=0x00007fff84744339) + 67 at OEDeviceHandler.m:67
    frame #12: 0x000000010034bc3e OpenEmuSystem`-[OEDeviceHandler description](self=0x000000010253fb70, _cmd=0x00007fff84728c70) + 94 at OEDeviceHandler.m:89
    frame #13: 0x00007fff8cf07823 Foundation`_NSDescriptionWithLocaleFunc + 91
    frame #14: 0x00007fff89453a00 CoreFoundation`__CFStringAppendFormatCore + 13952
    frame #15: 0x00007fff8949d4fb CoreFoundation`_CFStringCreateWithFormatAndArgumentsAux + 107
    frame #16: 0x00007fff8950b350 CoreFoundation`_CFLogvEx + 112
    frame #17: 0x00007fff8cf3ecd5 Foundation`NSLogv + 79
    frame #18: 0x00007fff8cf3ec6e Foundation`NSLog + 148
    frame #19: 0x000000010037700f OpenEmuSystem`-[OEHIDDeviceHandler initWithIOHIDDevice:](self=0x000000010253fb70, _cmd=0x000000010038874d, aDevice=0x0000000103a229c0) + 367 at OEHIDDeviceHandler.m:81
    frame #20: 0x0000000100376e4b OpenEmuSystem`+[OEHIDDeviceHandler deviceHandlerWithIOHIDDevice:](self=0x000000010039e6c8, _cmd=0x0000000100385488, aDevice=0x0000000103a229c0) + 59 at OEHIDDeviceHandler.m:61
    frame #21: 0x000000010034dcec OpenEmuSystem`-[OEDeviceManager OE_addDeviceHandlerForDevice:](self=0x000000010853b0c0, _cmd=0x00000001003858ea, aDevice=0x0000000103a229c0) + 252 at OEDeviceManager.m:317
    frame #22: 0x000000010034d1f1 OpenEmuSystem`-[OEDeviceManager OE_addDeviceHandlerForDeviceRef:](self=0x000000010853b0c0, _cmd=0x0000000100385c85, device=0x0000000103a229c0) + 257 at OEDeviceManager.m:258
    frame #23: 0x000000010034c8b1 OpenEmuSystem`OEHandle_DeviceMatchingCallback(inContext=0x000000010853b0c0, inResult=0, inSender=0x000000010853a010, inIOHIDDeviceRef=0x0000000103a229c0) + 273 at OEDeviceManager.m:504
    frame #24: 0x00007fff8b81d600 IOKit`__IOHIDManagerDeviceApplier + 159
    frame #25: 0x00007fff895499c2 CoreFoundation`__CFSetApplyFunction_block_invoke_0 + 18
    frame #26: 0x00007fff8945e7b0 CoreFoundation`CFBasicHashApply + 128
    frame #27: 0x00007fff8945e71e CoreFoundation`CFSetApplyFunction + 158
    frame #28: 0x00007fff8b81e72e IOKit`__IOHIDManagerInitialEnumCallback + 58
    frame #29: 0x00007fff8945eb31 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #30: 0x00007fff8945e51d CoreFoundation`__CFRunLoopDoSources0 + 445
    frame #31: 0x00007fff894817f5 CoreFoundation`__CFRunLoopRun + 789
    frame #32: 0x00007fff894810e2 CoreFoundation`CFRunLoopRunSpecific + 290
    frame #33: 0x00007fff80bd3eb4 HIToolbox`RunCurrentEventLoopInMode + 209
    frame #34: 0x00007fff80bd3b94 HIToolbox`ReceiveNextEventCommon + 166
    frame #35: 0x00007fff80bd3ae3 HIToolbox`BlockUntilNextEventMatchingListInMode + 62
    frame #36: 0x00007fff83eff563 AppKit`_DPSNextEvent + 685
    frame #37: 0x00007fff83efee22 AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
    frame #38: 0x00007fff83ef61d3 AppKit`-[NSApplication run] + 517
    frame #39: 0x00007fff83e9ac06 AppKit`NSApplicationMain + 869
    frame #40: 0x000000010000c3dd OpenEmu`main(argc=3, argv=0x00007fff5fbff850) + 61 at main.m:33
    frame #41: 0x00000001000022a4 OpenEmu`start + 52

git bisect says the offending commit is 4285a00

This crash happens because -[OEHIDDeviceHandler OE_setUpHatSwitchElement:] receives a NULL argument.

@clobber
Member
clobber commented Mar 24, 2013

Was this because your controller has the same vendor and product ID as another but isn't the same device at all?

@bavarious bavarious closed this Mar 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment