Hello,
I got crash reports from my users, showing an NSInvalidArgumentException deep in NSConnection code. Unfortunately, I wasn't able to reproduce this myself, and the code works quite well whenever I test it.
Here's the exception and stack that I'm seeing:
Uncaught exception NSInvalidArgumentException (*** -[NSKeyedPortCoder initWithReceivePort:sendPort:components:]: encoded data has been corrupted, not a valid binary property list
0 com.apple.CoreFoundation 140735795579618 __exceptionPreprocess + 178
1 libobjc.A.dylib 140735859693372 objc_exception_throw + 48
2 com.apple.CoreFoundation 140735795579277 +[NSException raise:format:] + 205
3 com.apple.Foundation 140735756661201 -[NSKeyedPortCoder initWithReceivePort:sendPort:components:] + 421
4 com.apple.Foundation 140735756647694 -[NSConnection portCoderWithComponents:] + 431
5 com.apple.Foundation 140735756660300 -[NSConnection dispatchWithComponents:] + 26
6 com.apple.Foundation 140735756552276 __NSFireMachPort + 254
7 com.apple.CoreFoundation 140735794596210 __CFMachPortPerform + 290
8 com.apple.CoreFoundation 140735794595897 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
9 com.apple.CoreFoundation 140735794595753 __CFRunLoopDoSource1 + 473
10 com.apple.CoreFoundation 140735794535963 __CFRunLoopRun + 2171
11 com.apple.CoreFoundation 140735794533176 CFRunLoopRunSpecific + 296
12 com.apple.Foundation 140735756492385 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270
13 com.dxo.****** 4528234196 cli_main + 19050
14 com.dxo.****** 4528214706 main + 718
15 libdyld.dylib 140735810454957 start + 1
----------------
0x7fff98bd2000 com.apple.Foundation - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x7fff9bfd1000 libdyld.dylib - /usr/lib/system/libdyld.dylib
0x7fff9eeb7000 libobjc.A.dylib - /usr/lib/libobjc.A.dylib
0x7fff9b036000 com.apple.CoreFoundation - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundationThis was happening sometimes on previous OS versions, but not that much. Starting with 10.11, however, this has become the top crash for my app, and I can't find any info on this exception.
Would anyone have a clue as to what's happening here?