Core Plot 2.2 crashes on OS X 10.8 with "Unrecognized Selector" exception - core-plot

I am using Xcode 8.1 on macOS Sierra. The deployment target of my app is set to 10.8, it uses Core Plot 2.2, which should be compatible with 10.8. The app works on my development machine, but when I start it on OS X 10.8.5 (VMware Fusion virtual machine) it crashes when opening the main window which contains a CPTGraph.
Stack trace:
OS Version: Mac OS X 10.8.5 (12F2560)
Report Version: 10
Interval Since Last Report: 227946 sec
Crashes Since Last Report: 8
Per-App Interval Since Last Report: 87 sec
Per-App Crashes Since Last Report: 3
Anonymous UUID: 25357976-7739-B0C4-594A-D7FC51D4A1F3
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString boundingRectWithSize:options:attributes:context:]: unrecognized selector sent to instance 0x1012ab910'
abort() called
terminate called throwing an exception
Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff81e7fb06 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff856073f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff81f1640a -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
3 CoreFoundation 0x00007fff81e6e02e ___forwarding___ + 414
4 CoreFoundation 0x00007fff81eb3dad __forwarding_prep_1___ + 237
5 CorePlot 0x000000010139d96e -[NSString(CPTTextStyleExtensions) sizeWithTextStyle:] + 93
6 CorePlot 0x00000001013858e9 -[CPTTextLayer sizeThatFits] + 198
7 CorePlot 0x00000001013859b2 -[CPTTextLayer sizeToFit] + 93
8 CorePlot 0x0000000101384df0 -[CPTTextLayer initWithText:style:] + 295
9 CorePlot 0x000000010134ee14 -[CPTGraph setTitle:] + 448
10 RehaSport Desktop 0x0000000101266dcd RehaSport Desktop + 331213
Obviously boundingRectWithSize:options:attributes:context: gets called, but this is only available on macOS 10.11 and newer.
Any ideas?

This is a Core Plot bug. I fixed it on the release-2.3 branch.

Related

Is it possible to catch 3rd party iOS library exception?

My Objective-C application is using a 3rd party VoIP SDK. I found the application crashes if left running overnight. The crash only happens if I enable the SDK, so I strongly suspect it causes the crash.
The library is a static library (.a extension). I tried catching the exception using try-catch block, and NSSetUncaughtExceptionHandler, but it didn't work. I suspect those methods only work with Objective-C exceptions, and the SDK is written in native C?
Is it possible to catch a 3rd party native C exception? I'm fine with any kind of hacks, since this will not be going into production code. Just trying to get to the bottom of the issue.
EDIT:
Here's the crash log:
Hardware Model: iPad5,1
Version: 0.14 (6.0)
Beta: YES
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Date/Time: 2016-11-22 08:24:59.7336 -0500
Launch Time: 2016-11-21 13:45:09.9956 -0500
OS Version: iPhone OS 10.1.1 (14B100)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Filtered syslog:
None found
Last Exception Backtrace:
(0x18953e1c0 0x187f7855c 0x18953e108 0x18f89359c 0x18f6f4444 0x18f4c653c
0x18f391d48 0x18f391c78 0x18f44bb10 0x18f44aec0 0x18f44a90c 0x18f44a4c0
0x18f44a424 0x18f38f220 0x18c84f188 0x18c843e64 0x18c843d24 0x18c7c07ec
0x18c7e7c58 0x18c7e8678 0x1894eb7dc 0x1894e940c 0x1894e989c 0x189418048
0x18ae9e198 0x18f3fd2fc 0x18f3f8034 0x10002304c 0x1883fc5b8)
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018850e014 0x1884ef000 + 126996
1 libsystem_pthread.dylib 0x00000001885d6450 0x1885d1000 + 21584
2 libsystem_c.dylib 0x00000001884823e0 0x18841f000 + 406496
3 libc++abi.dylib 0x0000000187f4d2d4 0x187f4c000 + 4820
4 libc++abi.dylib 0x0000000187f6acc0 0x187f4c000 + 126144
5 libobjc.A.dylib 0x0000000187f78844 0x187f70000 + 34884
6 libc++abi.dylib 0x0000000187f6766c 0x187f4c000 + 112236
7 libc++abi.dylib 0x0000000187f67234 0x187f4c000 + 111156
8 libobjc.A.dylib 0x0000000187f7871c 0x187f70000 + 34588
9 CoreFoundation 0x00000001894180bc 0x18940f000 + 37052
10 GraphicsServices 0x000000018ae9e198 0x18ae92000 + 49560
11 UIKit 0x000000018f3fd2fc 0x18f382000 + 504572
12 UIKit 0x000000018f3f8034 0x18f382000 + 483380
13 Remote 0x000000010002304c 0x100008000 + 110668
14 libdyld.dylib 0x00000001883fc5b8 0x1883f8000 + 17848
That isn't a catchable exception, that is a hard crash. And, specifically, it is a purposeful crash; something on the main thread decided things had gone badly enough that it called abort().
So, no, nothing you can do to catch it and it isn't even clear that the crash is triggered by the 3rd party library, given that crash log.

My app is rejected with Exception EXC_BREAKPOINT (SIGTRAP)

I tested my app on iPhone and iPad devices and it works fine, also I tested it on iOS 10.1.1 and on IPV6 network and it also works fine but after uploading my app to the app store, it is rejected because it crashes when login if the device is offline or on Wifi. They gave me a crash report and after I symplocited it, I get thhis Info :
Date/Time: 2016-11-01 10:07:03.2150 -0700
Launch Time: 2016-11-01 10:05:21.7124 -0700
OS Version: iPhone OS 10.1 (14B72)
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001000f18c0
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 MyApp -[FIRMessagingSecureSocket closeStream:] (in MyApp) + 56
1 MyApp -[FIRMessagingRmq2PersistentStore openDatabase:] (in MyApp) + 228
2 MyApp -[FIRMessagingReceiver didSendDataMessageWithID:] (in MyApp) + 128
3 Foundation 0x00000001835e08f8
4 CoreFoundation 0x0000000182aa48f4
5 CoreFoundation 0x0000000182aa4608
6 CoreFoundation 0x0000000182aa3ec4
7 CoreFoundation 0x0000000182aa1ac0
8 CoreFoundation 0x00000001829d0048
9 GraphicsServices 0x0000000184456198
10 UIKit 0x00000001889b42fc
11 UIKit 0x00000001889af034
12 MyApp -[FIRMessagingClient tryToConnect] (in MyApp) + 212
13 libdyld.dylib 0x00000001819b45b8
update :
I published new version put also get this crash log
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001000a1658
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 MyApp [FIRAMeasurement setUserAttributeOnWorkerQueue:] (in MyApp) + 580
1 MyApp [FIRAMeasurement uploadData] (MyApp) + 180 0x100054000 + 303808
2 MyApp [FIRAMeasurement reportOSUpdateOnWorkerQueue] (in PetCasa Vet) + 124
3 Foundation 0x0000000187acc8f8 0x1879c1000 + 1095928
4 CoreFoundation 0x0000000186f908f4 0x186eb3000 + 907508
5 CoreFoundation 0x0000000186f90608 0x186eb3000 + 906760
6 CoreFoundation 0x0000000186f8fec4 0x186eb3000 + 904900
7 CoreFoundation 0x0000000186f8dac0 0x186eb3000 + 895680
8 CoreFoundation 0x0000000186ebc048 0x186eb3000 + 36936
9 GraphicsServices 0x0000000188942198 0x188936000 + 49560
10 UIKit 0x000000018cea02fc 0x18ce25000 + 504572
11 UIKit 0x000000018ce9b034 0x18ce25000 + 483380
12 MyApp 0x00000001000907d8 (in MyApp) + 448
13 libdyld.dylib 0x0000000185ea05b8 0x185e9c000 + 17848
and this log crash :
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001000e5658
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 MyApp 0x00000001000e5658 (in MyApp) + 1060
1 MyApp [FIRMessagingConnection loginRequestWithToken:authID:] (in MyApp) + 300
2 MyApp [FIRMessagingConnection initWithAuthID:token:host:port:runLoop:rmq2Manager:gcmManager:] (in MyApp) + 32
3 Foundation 0x0000000187acc8f8 0x1879c1000 + 1095928
4 CoreFoundation 0x0000000186f908f4 0x186eb3000 + 907508
5 CoreFoundation 0x0000000186f90608 0x186eb3000 + 906760
6 CoreFoundation 0x0000000186f8fec4 0x186eb3000 + 904900
7 CoreFoundation 0x0000000186f8dac0 0x186eb3000 + 895680
8 CoreFoundation 0x0000000186ebc048 0x186eb3000 + 36936
9 GraphicsServices 0x0000000188942198 0x188936000 + 49560
10 UIKit 0x000000018cea02fc 0x18ce25000 + 504572
11 UIKit 0x000000018ce9b034 0x18ce25000 + 483380
12 MyApp [FIRInstanceIDRegistrationClient parseToken:authToken:withRequestID:handler:] (in MyApp) + 564
13 libdyld.dylib 0x0000000185ea05b8 0x185e9c000 + 17848
From apple documentation
Trace Trap [EXC_BREAKPOINT // SIGTRAP]
......
......
Swift code will terminate with this exception type if an unexpected
condition is encountered at runtime such as:
1- a non-optional type with a nil
2- value a failed forced type conversion
In my app I use location and I send it to backend, and it works fine, but when opening app at first time, system show alert to say that my app want to use your location allow or not allow, if user didn't allow so location methods will not work and location will be nil and unfortunately I didn't check if location is nil so when unwrap it app crashed, it's my mistake.
Please send message to the Apple review team about same and ask to them
"We tested application on iPhone 6, 6s, 7 and 7+ with iOS 10.x and application works perfect in IPV6 network, We follow following process for IPV6 network: http://www.brianjcoleman.com/tutorial-how-to-test-your-app-for-ipv6-compatibility/" and request to them your event will be held on the coming week so, please release application to store asap and let me know the flow of the application, where you find issue or crashes.
It works, I had done same thing with 4 application and they approved.

Apply Pay crashing in simulator in Xcode .07 and Xcode 7.1

I'm testing Apple Pay and trying to make a sample purchase, however when I'm in simulator in the XCode 7.0 and 7.1, there is an option of Pay with Passcode and it kept crashing simulator after you tap that..
Any ideas?
Process: PassbookUIService [10809]
Path: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/PassbookUIService.app/PassbookUIService
Identifier: PassbookUIService
Version: 1.0 (1.0)
Code Type: X86-64 (Native)
Parent Process: launchd_sim [10692]
Responsible: launchd_sim [10692]
User ID: 501
Date/Time: 2015-09-11 17:08:10.953 +0100
OS Version: Mac OS X 10.10.5 (14F27)
Report Version: 11
Anonymous UUID: ECB58F9C-C22D-6885-D23E-251989A674E0
Sleep/Wake UUID: A0D81423-EF8E-48CF-9C81-E81BF0FCF129
Time Awake Since Boot: 19000 seconds
Time Since Wake: 6600 seconds
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderSet initWithObjects:count:]: attempt to insert nil object from objects[0]'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 182.4 - Device: iPhone 6s - Runtime: iOS 9.1 (13B5110e) - DeviceType: iPhone 6s
Application Specific Backtrace 1:
0 CoreFoundation 0x00000001103b6f65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000110743deb objc_exception_throw + 48
2 CoreFoundation 0x0000000110287cfe -[__NSPlaceholderSet initWithObjects:count:] + 334
3 CoreFoundation 0x00000001102f7f9f +[NSSet setWithObject:] + 47
4 PassKit 0x000000010ea6c47c -[PKPaymentOptionsDefaults setDefaultBillingAddress:forPaymentPass:] + 585
5 PassKit 0x000000010eaf1bd9 -[PKPaymentAuthorizationServiceViewController _didAuthorizePaymentWithToken:] + 233
6 UIKit 0x000000010edcb825 -[UIApplication sendAction:to:from:forEvent:] + 92
7 UIKit 0x000000010ef32c8e -[UIControl sendAction:to:forEvent:] + 67
By https://developer.apple.com/library/tvos/releasenotes/DeveloperTools/RN-Xcode/Chapters/xc7_release_notes.html#//apple_ref/doc/uid/TP40001051-CH5-DontLinkElementID_135
And in "Known Issues"
Simulated transactions using Apple Pay in Simulator do not complete if requesting a user's billing address. (22551685)
We need to wait for the new version of Xcode, it would seem.

ios app runs perfectly in debug mode but crashes in release

My app crashes in certain moments in release build. I don't know if it is important but I use mainly c++ with cocos2d-x framework. I tried setting optimization level to none but it won't work too. I get this output in console :
libc++abi.dylib: terminating with uncaught exception of type std::out_of_range: map::at: key not found
This is part of the crash log:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3870d1f0 0x386fa000 + 78320
1 libsystem_pthread.dylib 0x38777792 0x38774000 + 14226
2 libsystem_c.dylib 0x386bdfd8 0x38675000 + 298968
3 libc++abi.dylib 0x379eccd2 0x379ec000 + 3282
4 libc++abi.dylib 0x37a056aa 0x379ec000 + 104106
5 libobjc.A.dylib 0x3814af86 0x38147000 + 16262
6 libc++abi.dylib 0x37a031c4 0x379ec000 + 94660
7 libc++abi.dylib 0x37a02d28 0x379ec000 + 93480
8 libobjc.A.dylib 0x3814ae12 0x38147000 + 15890
9 CoreFoundation 0x2d3d2f80 0x2d3cb000 + 32640
10 CoreFoundation 0x2d3d2cee 0x2d3cb000 + 31982
11 GraphicsServices 0x3230565e 0x322fc000 + 38494
12 UIKit 0x2fd1e168 0x2fcb0000 + 450920
13 BumpRace iOS 0x00044b1e 0x4000 + 264990
14 libdyld.dylib 0x38657ab4 0x38656000 + 6836
Any help would be apprieciated.
You must use iOS instruments tool. To debug you memory leaks. As possible to conclude from youre ERROR message.
Small useful link.

Crash on fast changes between view controllers

Currently I am testing an almost finished App. In general it is working well.
But I have seen that the App is crashing (reproduceable, but at random times), when I change fast between a view controller that is using MapKit and CoreLocation and a plain one just displaying some simple buttons.
The crash happens after returning to the plain VC. Such fast changes are not the usual usage scenario of a user, I have done that just because testing is sooo boring ;-) - but now I know that there is an error somewhere.
Does anyone have an idea, where to look? See the error report from the device below - it looks always the same. The error messages in Xcode are different, but always something with unrecognized selector. Btw. I do not use performSelector:withObject: that must come from the framework.
I am tending to guess, that there are some internal initializing tasks from MKMapView or CoreLocation that are not finished when returning so fast from this VC and that these are causing the problem?
Error Message in Xcode:
2012-08-25 17:26:20.375 Kanal01[4070:707] -[__NSCFArray
mapView:didUpdateUserLocation:]: unrecognized selector sent to
instance 0x10b030 2012-08-25 17:26:20.384 Kanal01[4070:707] ***
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[__NSCFArray
mapView:didUpdateUserLocation:]: unrecognized selector sent to
instance 0x10b030' *** First throw call stack: (0x374fa88f
0x351ff259 0x374fda9b 0x374fc915 0x37457650 0x36f13e63 0x374591fb
0x37495ab9 0x36f09b21 0x36badde3 0x36bad785 0x36ba7e4f 0x374ceb01
0x374ce12f 0x374cd351 0x374504a5 0x3745036d 0x33c0f439 0x311fccd5
0xa9eed 0xa9e88) terminate called throwing an exception
Content of Device Log:
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at 0x00000000 Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0
Crashed: 0 libobjc.A.dylib 0x36fe8f7e 0x36fe5000
+ 16254 1 MapKit 0x337b9e5c 0x3378b000 + 192092 2 CoreFoundation 0x30c0f1f4 0x30bf7000 +
98804 3 CoreFoundation 0x30c4bab2 0x30bf7000 +
346802 4 MapKit 0x337afb1a 0x3378b000 +
150298 5 CoreLocation 0x33ccaddc 0x33cc2000 +
36316 6 CoreLocation 0x33cca77e 0x33cc2000 +
34686 7 CoreLocation 0x33cc4e48 0x33cc2000 +
11848 8 CoreFoundation 0x30c84afa 0x30bf7000 +
580346 9 CoreFoundation 0x30c84128 0x30bf7000 +
577832 10 CoreFoundation 0x30c8334a 0x30bf7000 +
574282 11 CoreFoundation 0x30c0649e 0x30bf7000 +
62622 12 CoreFoundation 0x30c06366 0x30bf7000 +
62310 13 GraphicsServices 0x32c80432 0x32c7c000 +
17458 14 UIKit 0x30369cce 0x30338000 +
203982 15 Kanal01 0x00069fde 0x68000 +
8158 16 Kanal01 0x00069f78 0x68000 +
8056

Resources