Help with strange NSInvalidArgumentException

  • Hi all,

    I've had two customer reports of the exception below.  My code is not in the backtrace, so I'm not sure how to figure this one out.  Anyone recognise anything here?

    NSInvalidArgumentException

    +[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil

    0  CoreFoundation                      0x00007fff86cee7b4 __exceptionPreprocess + 180
    1  libobjc.A.dylib                    0x00007fff87f36f03 objc_exception_throw + 45
    2  CoreFoundation                      0x00007fff86cc2b8d +[NSInvocation invocationWithMethodSignature:] + 493
    3  CoreData                            0x00007fff81cadb42 -[NSManagedObjectContext(NSEditorAndEditorRegistration) _sendCommitEditingSelectorToTarget:sender:selector:flag:contextInfo:delayed:] + 82
    4  CoreData                            0x00007fff81cb06e3 -[NSManagedObjectContext(NSEditorAndEditorRegistration) _managedObjectContextEditor:didCommit:contextInfo:] + 115
    5  AppKit                              0x00007fff802b0411 _NSSendCommitEditingSelector + 61
    6  AppKit                              0x00007fff802b1d7f -[NSController _controllerEditor:didCommit:contextInfo:] + 199
    7  CoreFoundation                      0x00007fff86cc396c __invoking___ + 140
    8  CoreFoundation                      0x00007fff86cc383d -[NSInvocation invoke] + 141
    9  CoreFoundation                      0x00007fff86cdf711 -[NSInvocation invokeWithTarget:] + 49
    10  Foundation                          0x00007fff80fee33c __NSFireDelayedPerform + 404
    11  CoreFoundation                      0x00007fff86c8abe8 __CFRunLoopRun + 6488
    12  CoreFoundation                      0x00007fff86c88dbf CFRunLoopRunSpecific + 575
    13  HIToolbox                          0x00007fff826897ee RunCurrentEventLoopInMode + 333
    14  HIToolbox                          0x00007fff826895f3 ReceiveNextEventCommon + 310
    15  HIToolbox                          0x00007fff826894ac BlockUntilNextEventMatchingListInMode + 59
    16  AppKit                              0x00007fff800edeb2 _DPSNextEvent + 708
    17  AppKit                              0x00007fff800ed801 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
    18  AppKit                              0x00007fff800b368f -[NSApplication run] + 395
    19  AppKit                              0x00007fff800ac3b0 NSApplicationMain + 364

    Thanks,

    --
    Sean
  • Does anything in your code call -commitEditingWithDelegate:didCommitSelector:contextInfo: ?

    On 17 Jul 2012, at 20:46, Sean McBride wrote:

    > Hi all,
    >
    > I've had two customer reports of the exception below.  My code is not in the backtrace, so I'm not sure how to figure this one out.  Anyone recognise anything here?
    >
    >
    > NSInvalidArgumentException
    >
    > +[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil
    >
    > 0  CoreFoundation                      0x00007fff86cee7b4 __exceptionPreprocess + 180
    > 1  libobjc.A.dylib                    0x00007fff87f36f03 objc_exception_throw + 45
    > 2  CoreFoundation                      0x00007fff86cc2b8d +[NSInvocation invocationWithMethodSignature:] + 493
    > 3  CoreData                            0x00007fff81cadb42 -[NSManagedObjectContext(NSEditorAndEditorRegistration) _sendCommitEditingSelectorToTarget:sender:selector:flag:contextInfo:delayed:] + 82
    > 4  CoreData                            0x00007fff81cb06e3 -[NSManagedObjectContext(NSEditorAndEditorRegistration) _managedObjectContextEditor:didCommit:contextInfo:] + 115
    > 5  AppKit                              0x00007fff802b0411 _NSSendCommitEditingSelector + 61
    > 6  AppKit                              0x00007fff802b1d7f -[NSController _controllerEditor:didCommit:contextInfo:] + 199
    > 7  CoreFoundation                      0x00007fff86cc396c __invoking___ + 140
    > 8  CoreFoundation                      0x00007fff86cc383d -[NSInvocation invoke] + 141
    > 9  CoreFoundation                      0x00007fff86cdf711 -[NSInvocation invokeWithTarget:] + 49
    > 10  Foundation                          0x00007fff80fee33c __NSFireDelayedPerform + 404
    > 11  CoreFoundation                      0x00007fff86c8abe8 __CFRunLoopRun + 6488
    > 12  CoreFoundation                      0x00007fff86c88dbf CFRunLoopRunSpecific + 575
    > 13  HIToolbox                          0x00007fff826897ee RunCurrentEventLoopInMode + 333
    > 14  HIToolbox                          0x00007fff826895f3 ReceiveNextEventCommon + 310
    > 15  HIToolbox                          0x00007fff826894ac BlockUntilNextEventMatchingListInMode + 59
    > 16  AppKit                              0x00007fff800edeb2 _DPSNextEvent + 708
    > 17  AppKit                              0x00007fff800ed801 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
    > 18  AppKit                              0x00007fff800b368f -[NSApplication run] + 395
    > 19  AppKit                              0x00007fff800ac3b0 NSApplicationMain + 364
    >
    > Thanks,
    >
    > --
    > Sean
  • Mike,

    Thanks for answering.

    I never directly call that.  Though I call plain-old commitEditing in about 100 different places.

    Further searching found one similar report:
    <http://www.cocoabuilder.com/archive/cocoa/284791-nsinvocation-error-when-cl
    osing-dirty-document.html?q=%5BNSInvocation+invocationWithMethodSignature%3
    A%5D%3A+method+signature+argument+cannot+be+nil#284791
    >

    Which gave enough clues to repro the issue.  It seems like an OS bug, since it repros only in 10.6 and not 10.7 or 10.8.  (For us, it happens when there a text field that has focus but is empty, then a long computation is started, then the user presses Cmd-S.)

    Cheers,

    Sean

    On Wed, 18 Jul 2012 00:10:51 +0100, Mike Abdullah said:

    > Does anything in your code call -comm
    > itEditingWithDelegate:didCommitSelector:contextInfo: ?
    >
    > On 17 Jul 2012, at 20:46, Sean McBride wrote:
    >
    >> Hi all,
    >>
    >> I've had two customer reports of the exception below.  My code is not
    > in the backtrace, so I'm not sure how to figure this one out.  Anyone
    > recognise anything here?
    >>
    >>
    >> NSInvalidArgumentException
    >>
    >> +[NSInvocation invocationWithMethodSignature:]: method signature
    > argument cannot be nil
    >>
    >> 0  CoreFoundation                      0x00007fff86cee7b4
    > __exceptionPreprocess + 180
    >> 1  libobjc.A.dylib                    0x00007fff87f36f03
    > objc_exception_throw + 45
    >> 2  CoreFoundation                      0x00007fff86cc2b8d +
    > [NSInvocation invocationWithMethodSignature:] + 493
    >> 3  CoreData                            0x00007fff81cadb42 -
    > [NSManagedObjectContext(NSEditorAndEditorRegistration)
    > _sendCommitEditingSelectorToTarget:se
    > nder:selector:flag:contextInfo:delayed:] + 82
    >> 4  CoreData                            0x00007fff81cb06e3 -
    > [NSManagedObjectContext(NSEditorAndEditorRegistration)
    > _managedObjectContextEditor:didCommit:contextInfo:] + 115
    >> 5  AppKit                              0x00007fff802b0411
    > _NSSendCommitEditingSelector + 61
    >> 6  AppKit                              0x00007fff802b1d7f -
    > [NSController _controllerEditor:didCommit:contextInfo:] + 199
    >> 7  CoreFoundation                      0x00007fff86cc396c
    > __invoking___ + 140
    >> 8  CoreFoundation                      0x00007fff86cc383d -
    > [NSInvocation invoke] + 141
    >> 9  CoreFoundation                      0x00007fff86cdf711 -
    > [NSInvocation invokeWithTarget:] + 49
    >> 10  Foundation                          0x00007fff80fee33c
    > __NSFireDelayedPerform + 404
    >> 11  CoreFoundation                      0x00007fff86c8abe8
    > __CFRunLoopRun + 6488
    >> 12  CoreFoundation                      0x00007fff86c88dbf
    > CFRunLoopRunSpecific + 575
    >> 13  HIToolbox                          0x00007fff826897ee
    > RunCurrentEventLoopInMode + 333
    >> 14  HIToolbox                          0x00007fff826895f3
    > ReceiveNextEventCommon + 310
    >> 15  HIToolbox                          0x00007fff826894ac
    > BlockUntilNextEventMatchingListInMode + 59
    >> 16  AppKit                              0x00007fff800edeb2
    > _DPSNextEvent + 708
    >> 17  AppKit                              0x00007fff800ed801 -
    > [NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
    >> 18  AppKit                              0x00007fff800b368f -
    > [NSApplication run] + 395
    >> 19  AppKit                              0x00007fff800ac3b0
    > NSApplicationMain + 364
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today