iPad crash log does not have symbolic info - ipad

I got a crash log from a user, and I do not see any function names - only pointers in hex:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x30a29c98 0x30a27000 + 11416
1 UIKit 0x3517b4ee 0x35167000 + 83182
2 UIKit 0x3518eddc 0x35167000 + 163292
3 UIKit 0x3523a84a 0x35167000 + 866378
4 CoreFoundation 0x32368c3c 0x32366000 + 11324
5 UIKit 0x3517b5ee 0x35167000 + 83438
6 UIKit 0x3518eddc 0x35167000 + 163292
7 UIKit 0x3523a70c 0x35167000 + 866060
How can I get the crash log to show more meaningful info ?

This should point you in the right direction:
Technical Note TN2151 - Understanding and Analyzing iPhone OS Application Crash Reports

Related

CMotionManager crash on instantiation

EDIT: This appears to be resolved on iOS 13. Leaving all the original details below.
I'm getting a crash when instantiating my CMMotionManager object for Core Motion. This is on an iPhone Xs running iOS 12.0.1.
I can reliably reproduce this with a single-view app, with the following view controller.
import UIKit
import CoreMotion
class ViewController: UIViewController {
var motion: CMMotionManager?
override func viewDidLoad() {
super.viewDidLoad()
// This causes a crash on iPhone Xs, iOS 12.0.1
self.motion = CMMotionManager()
}
}
Full sample project is at https://github.com/doctorcolinsmith/motiontestcrash/tree/master
When running the above, I am getting a fault on a thread with the following output in the debugger.
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 3634, TID: 630341, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 libobjc.A.dylib 0x000000019b0d3894 <redacted> + 56
5 CoreMotion 0x00000001a19337a4 CoreMotion + 305060
6 CoreMotion 0x00000001a1933cd8 CoreMotion + 306392
7 CoreMotion 0x00000001a1933be8 CoreMotion + 306152
8 CoreMotion 0x00000001a19653cc CoreMotion + 508876
9 CoreMotion 0x00000001a196542c CoreMotion + 508972
10 CoreFoundation 0x000000019be6c888 <redacted> + 28
11 CoreFoundation 0x000000019be6c16c <redacted> + 276
12 CoreFoundation 0x000000019be67470 <redacted> + 2324
13 CoreFoundation 0x000000019be66844 CFRunLoopRunSpecific + 452
14 CoreFoundation 0x000000019be675a8 CFRunLoopRun + 84
15 CoreMotion 0x00000001a1964d64 CoreMotion + 507236
16 libsystem_pthread.dylib 0x000000019bae1a04 <redacted> + 132
17 libsystem_pthread.dylib 0x000000019bae1960 _pthread_start + 52
18 libsystem_pthread.dylib 0x000000019bae9df4 thread_start + 4
2018-10-24 16:19:31.423680-0700 motiontest[3634:630341] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 3634, TID: 630341, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 libobjc.A.dylib 0x000000019b0d3894 <redacted> + 56
5 CoreMotion 0x00000001a19337a4 CoreMotion + 305060
6 CoreMotion 0x00000001a1933cd8 CoreMotion + 306392
7 CoreMotion 0x00000001a1933be8 CoreMotion + 306152
8 CoreMotion 0x00000001a19653cc CoreMotion + 508876
9 CoreMotion 0x00000001a196542c CoreMotion + 508972
10 CoreFoundation 0x000000019be6c888 <redacted> + 28
11 CoreFoundation 0x000000019be6c16c <redacted> + 276
12 CoreFoundation 0x000000019be67470 <redacted> + 2324
13 CoreFoundation 0x000000019be66844 CFRunLoopRunSpecific + 452
14 CoreFoundation 0x000000019be675a8 CFRunLoopRun + 84
15 CoreMotion 0x00000001a1964d64 CoreMotion + 507236
16 libsystem_pthread.dylib 0x000000019bae1a04 <redacted> + 132
17 libsystem_pthread.dylib 0x000000019bae1960 _pthread_start + 52
18 libsystem_pthread.dylib 0x000000019bae9df4 thread_start + 4
(lldb)
Has anyone encountered this before or have an idea on how to solve the crash?
Well, I've tested your application both physical iPhone 6S and iPhone 7 - obviously with iOS 12.0.1. I've also checked for a couple of things in your project and couldn't reproduce your problem at all - not even in simulators - and I don't think it's possible to download a simulator with specific fixes (12.0.x), only with minor version updates - so 12.1 being the next one. This looks really specific on iPhone XS hardware, and I would suggest you to fill an issue with Apple support.
EDIT: Well, I saw that you've already filled a bug report on openradar. This guy even referenced the bug report status on openradar-mirror.
I don't know much about CoreMotion, but the error message tells you you're trying to call a UI action on a background thread. Try putting your code into:
DispatchQueue.main.async {
//your code here
}
It also seems you're trying to do UI related actions in viewDidLoad(). Technically that's fine, but remember that some views probably aren't layed out at that point in time.

KVO crash on UITextField initWithFrame

A customer of my app sent me this strange crash report and I cannot figure out how this could ever crash. I cannot reproduce the problem myself, so am reliant on the crash report.
It crashes on the following very simple line of code:
UITextField *value = [[UITextField alloc] initWithFrame:frame];
The crash seems to be related to key-value-observing (KVO), but I am not doing anything with that here; it's a simply constructor!
The only possibility I could see, is that another thread is writing to a dealloc'ed object that happens to have the same memory address as an object that is created by the initWithFrame:. But in the crash report, all other threads are quiet.
I have found other similar questions, but none of them have an answer.
Any ideas?
Here are the relevant parts from the crash report:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000181981b90 objc_msgSend + 16
1 Foundation 0x0000000182bf2454 -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 324
2 QuartzCore 0x0000000184deb11c CA::Layer::set_delegate(objc_object*) + 72
3 UIKit 0x0000000187456f40 -[UIView _createLayerWithFrame:] + 580
4 UIKit 0x0000000187456a00 UIViewCommonInitWithFrame + 688
5 UIKit 0x00000001874566f0 -[UIView initWithFrame:] + 140
6 UIKit 0x000000018745dfb0 -[UILabel initWithFrame:] + 48
7 UIKit 0x0000000187542064 -[UITextField createTextLabelWithTextColor:] + 76
8 UIKit 0x0000000187541c30 -[UITextField initWithFrame:] + 416
9 Flyskyhy 0x00000001000e1f68 -[ElementView doInitWithUnit:] (ElementView.m:178)

Crash on + (UIImage *)imageWithData:(NSData *)data scale:(CGFloat)scale on iOS 8 | EXC_BAD_ACCESS UNKNOWN or KERNEL_INVALID_ADDRESS

The top 2 crash of my app happens on the method below:
+ (UIImage *)imageWithData:(NSData *)data scale:(CGFloat)scale
So far it has occurred more than 2000 times and it manifest itself in slightly different ways according to the crash reports:
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x00000004
Thread : Crashed: com.apple.main-thread
0 ImageIO 0x27b6a1b6 CGImagePlusSetImageBlockProc + 41
1 libsystem_malloc.dylib 0x34a5139b calloc + 58
2 ImageIO 0x27b671c5 initImagePng + 4492
3 ImageIO 0x27b65a2f makeImagePlus + 930
4 ImageIO 0x27b65271 CGImageSourceCreateImageAtIndex + 160
5 UIKit 0x2a1e0bf3 _UIImageRefFromData + 262
6 UIKit 0x2a32d191 -[UIImage(UIImagePrivate) _initWithData:preserveScale:cache:] + 76
7 UIKit 0x2a1e0ae5 -[UIImage initWithData:] + 28
8 UIKit 0x2a2a36af -[UIImage initWithData:scale:] + 22
9 UIKit 0x2a32b721 +[UIImage imageWithData:scale:] + 56
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x00000000
Thread : Crashed: com.apple.main-thread
0 CoreFoundation 0x25bca41c CFArrayGetCount + 23
1 ImageIO 0x26c3898b getImagePlus + 118
2 ImageIO 0x26c3898b getImagePlus + 118
3 ImageIO 0x26c38433 makeImagePlus + 46
4 ImageIO 0x26c37fed CGImageSourceCreateImageAtIndex + 160
5 UIKit 0x292954c3 _UIImageRefFromData + 282
6 UIKit 0x293e1ad9 -[UIImage(UIImagePrivate) _initWithData:preserveScale:cache:] + 76
7 UIKit 0x292953a5 -[UIImage initWithData:] + 28
8 UIKit 0x29357ee7 -[UIImage initWithData:scale:] + 22
9 UIKit 0x293e0081 +[UIImage imageWithData:scale:] + 56
EXC_BAD_ACCESS UNKNOWN at 0x0000000104f44000
Thread : Crashed: com.apple.main-thread
0 libsystem_platform.dylib 0x0000000194795390 _platform_memmove + 320
1 libsystem_c.dylib 0x0000000194690424 __memcpy_chk + 32
2 libsystem_c.dylib 0x0000000194690424 __memcpy_chk + 32
3 ImageIO 0x0000000184a3172c _CGImageSourceBindToPlugin + 316
4 ImageIO 0x0000000184a31574 CGImageSourceGetCount + 112
5 UIKit 0x000000018816d46c _UIImageRefFromData + 276
6 UIKit 0x00000001882d1c20 -[UIImage(UIImagePrivate) _initWithData:preserveScale:cache:] + 112
7 UIKit 0x000000018823e21c -[UIImage initWithData:scale:] + 32
8 UIKit 0x00000001882cffa4 +[UIImage imageWithData:scale:] + 72
I don't see how my code could affect this but I tried sending nil to this method and it just returns nil. Would a corrupted NSData be able to cause this crash? Does this method retain the NSData? Would it be cause by the NSData being released while this line is processing? I don't think so because it's synchronous, right?
Besides that, I couldn't reproduce this bug but since we have a big user base it happens often. I also noted it happens 99% of the times on iOS 8.
Any help will be very appreciated.
Are you using a library as AFNetwork or Hanekee? I've just submitted a pull request to both this libraries because of ios8 UIImage imageWithData. It seems UIImage with data is NOT thread safe, meaning that calling it simultaneous from different threads it will crash.... A way to replicate this is to test the following code:
let data = NSData(contentsOfURL: NSURL(string: "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTf4P0V2TrszykwPguyeulcSt4vwQPcvvWKKq_RePhUUVFoHevG9lw8GVcw")!)
var test: Array<UIImage> = []
let lock = NSLock()
for i in 0...10000 {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { () -> Void in
NSLog("Processing \(i)")
let a = UIImage(data:data!)
NSLog("Processed \(i)")
lock.lock()
test.append(a!)
test.removeLast()
lock.unlock()
})
So make sure you synchronise UIImage(data:data!) or [UIImage imageWithData:data] calls to avoid simultaneous calls.
Pull Requests:
Haneke: https://github.com/Haneke/HanekeSwift/pull/207
AFNetwork: https://github.com/AFNetworking/AFNetworking/pull/2815

iOS crash, EXC_BREAKPOINT, No clue with Xcode 6.1

I am usually able to solve the crashes but here I have not clue from where it comes from.
I use parse, and I am simply doing a request in background with a completion block.
The app crashes at a simple if condition and I can barely identify anything, no way to print description, ...
Do you have any idea ? A starting point ? anything ?
Xcode 6.1 is really strange, it seems that the debugger is buggy.
Here is the log of the crash :
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000019657a964 __kill + 8
1 MyAPP 0x00000001001f2b70 0x10009c000 + 1403760
2 libsystem_platform.dylib 0x0000000196610958 _sigtramp + 64
3 MyAPP 0x00000001001318cc 0x10009c000 + 612556
4 MyAPP 0x000000010013797c 0x10009c000 + 637308
5 MyAPP 0x0000000100135fc4 0x10009c000 + 630724
6 MyAPP 0x00000001002e408c 0x10009c000 + 2392204
7 MyAPP 0x00000001001dbf78 0x10009c000 + 1310584
8 libdispatch.dylib 0x00000001964393a8 _dispatch_call_block_and_release + 20
9 libdispatch.dylib 0x0000000196439368 _dispatch_client_callout + 12
10 libdispatch.dylib 0x000000019643d97c _dispatch_main_queue_callback_4CF + 928
11 CoreFoundation 0x000000018566d69c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
12 CoreFoundation 0x000000018566b744 __CFRunLoopRun + 1488
13 CoreFoundation 0x00000001855991f0 CFRunLoopRunSpecific + 392
14 GraphicsServices 0x000000018e7275a0 GSEventRunModal + 164
15 UIKit 0x0000000189eca780 UIApplicationMain + 1484
16 Shuff 0x0000000100129474 0x10009c000 + 578676
17 libdyld.dylib 0x0000000196462a04 start + 0
And here is a sample of the iOS code :
var query = PFQuery(className: "_User")
query.whereKey("facebookId", containedIn: ids)
query.findObjectsInBackgroundWithBlock(){
results, error in
if var resultsvar = results? {
self.functionToCall(resultsvar)
}
}
and the functionToCall crashes.
Maybe this can help :
0 0x00000001001679c8 in specialization of Swift._ArrayBuffer._nonNative.getter : Swift.Optional [inlined] ()
Yes !!! The debugger is not working well ! I was able to find the correct lines by doing the following : put a breakpoint at the start of where you think the app crashes, go step by step, remember the lowest line you've gone through. Even if the debugger crashes on another the line, the line you are looking for is probably the lowest one.
This is just a guess but I was working on something similar and I think you need to change this code to:
query.findObjectsInBackgroundWithBlock(){
results?, error? in
if var resultsvar = results {
self.functionToCall(resultsvar)
}
}
Note that I made both results and error optional. In my case I was providing a block defined in Obj-C, and in Obj-C these objects can legally be == nil. So I think you have to define them as optionals in Swift.

iOS 7-only: NSMapTable crash

I'm keeping something like memory-cache in NSMapTable:
// check for nils
if (key && image) {
// set object to NSMapTable
[_mapTable setObject:object forKey:key]; // crash
}
Unfortunately, lately I've got some problems with this method. Crash happens rather rarely, only on iOS 7. Crashlog indicates it happens at above line and shows more details:
-- Crashed: com.apple.root.default-priority ---
SIGABRT ABORT at 0x123456789
--- call stack ---
0
libsystem_kernel.dylib
__pthread_kill + 8
1
libsystem_pthread.dylib
pthread_kill + 58
2
libsystem_c.dylib
abort + 76
3
libsystem_malloc.dylib
free + 382
4
Foundation
-[NSConcreteMapTable grow] + 546
5
Foundation
-[NSConcreteMapTable setObject:forKey:] + 140
In fact, only 4 & 5 gives any info. I can't figure what's wrong in here. Because it happens in iOS7 only, maybe it's an Apple bug? Any ideas what can be the reason?

Resources