iOS app crash, symbolicated logs are opaque - objective-c

I believe I'm looking at properly symbolicated logs, but please do tell me if that's not the case. This is an excerpt of a crash log I received from Apple after rejected due to a crash upon launch, which I have been entirely unable to replicate.
I installed a crash reporting system called Crashlytics which received no crash reports during the time the app was In Review, leading me to believe the crash occurs before AppDelegate's didFinishLaunchingWithOptions where Crashlytics is initialized. That said, Crashlytics only sends reports upon re-opening the app after a crash. So the Apple reviewer may have experienced a crash and didn't bother to attempt again, possible the reason I have no Crashlytics report.
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
(0x181f9a084 0x1929ec0e4 0x180819674 0x100091318 0x100084fe4 0x100084098 0x18671d158 0x18671ce68 0x1867d0ee8 0x1869d1da8 0x186791938 0x18671e88c 0x1867906f8 0x10006187c 0x18678e5d0 0x1869a4de8 0x1869a7568 0x1869a5c00 0x18a171640 0x181f52360 0x181f51468 0x181f4fa8c 0x181e7d664 0x18678798c 0x186782984 0x100061c28 0x19305aa08)
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000193172964 __kill + 8
1 Luff 0x00000001001330dc 0x10005c000 + 880860
2 libsystem_platform.dylib 0x0000000193208958 _sigtramp + 64
3 libsystem_pthread.dylib 0x0000000193211224 pthread_kill + 108
4 libsystem_c.dylib 0x00000001930eab14 abort + 108
5 libc++abi.dylib 0x00000001921d1414 abort_message + 112
6 libc++abi.dylib 0x00000001921f0b88 default_terminate_handler() + 300
7 libobjc.A.dylib 0x00000001929ec3bc _objc_terminate() + 124
8 libc++abi.dylib 0x00000001921edbb0 std::__terminate(void (*)()) + 12
9 libc++abi.dylib 0x00000001921ed738 __cxa_rethrow + 140
10 libobjc.A.dylib 0x00000001929ec290 objc_exception_rethrow + 40
11 CoreFoundation 0x0000000181e7d710 CFRunLoopRunSpecific + 568
12 UIKit 0x0000000186787988 -[UIApplication _run] + 548
13 UIKit 0x0000000186782980 UIApplicationMain + 1484
14 Luff 0x0000000100061c24 0x10005c000 + 23588
15 libdyld.dylib 0x000000019305aa04 start + 0

What you have is NOT fully symbolicated. In order to get it fully symbolicated, i.e. with the names for your functions on lines 14 and 1, and the last exception backtrace, you need the dSYM file which would have been generated when you built the app for submission and placed in the same folder as your app bundle. If you used Xcode's archive functionality, I believe the dSYM is included in the archive. I say lines 1 and 14 because those are the ones that have your app name on them (Luff).
What you need to do is put the crash report, dSYM file and app file (not the IPA) in the same folder (I'm not sure if the app file is actually necessary for Xcode to symbolicate, therefore make sure it is there if it doesn't work with just the crash report and dSYM). Then, import the crash report into the Xcode organizer and click "Re-symbolicate".
What you have above as it is right now is 100% useless without the dSYM, unless you can somehow map the addresses in the report to symbols (functions, methods).
Also, the stack trace of the crashed thread is not where the relevant info is. From experience, I can tell you a couple of things about that stack trace, though. The symbol on line 14 is most likely your main() function. Nothing special there.
The lines between 1 and 14 show a bunch of exception rethrow and catch, i.e. that is not the stack trace that led to the crash, but the stacktrace of the exception being passed around. Since you mentioned you have Crashlytics, I bet line 14 is just that. It says Luff and not Crashlytics because Crashlytics is a static library embedded into your app. For all intents and purposes, iOS sees it as just another part of your app. The reason I say it is Crashlytics is when you are catching crashes, the thing that caused the crash (exception, signal, etc.) is sometimes rethrown and it eventually reaches your own custom crash-reporting code.
The relevant info is in the Last Exception Backtrace addresses you have above. But to read that, it has to be symbolicated with the dSYM file.
Like you said, Crashlytics is not real-time. The user needs to reopen the app. I know all this because I'm working on my own project called Crashional which is real-time, provided there is an internet connection.

A possible reason that you did not get a report through Crashlytics is that the reviewer may have had internet disabled on the device when she first launched your app. Even if she opened it again, it would not have sent the crash back to Crashlytics.

Related

Xcode 11 crashes when opening the project

I downloaded new Xcode 11 today and when I am trying to open my project, Xcode will always crash.
Does anyone else experience this problem ? I have provided part of crash log. It's IDE related problem, but I would be really glad, someone has a solution to this.
Crashed Thread: 25 Dispatch queue: ConcurrentQueue: -[IDEProvisioningMechanic _executeNextRepairIfNeeded]_block_invoke
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
ProductBuildVersion: 11A420a
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-14936/IDEFoundation/Provisioning/Mechanic/IDEProvisioningRepairStepGenerator.m:252
Details: Didn't find a single primary certificate type from {(
)}
Object: <IDEProvisioningRepairStepGenerator_Automatic: 0x7fdc55061ef0>
Method: -_evaluateCertificatesWithSession:context:repairable:steps:userAction:error:
Thread: <NSThread: 0x7fdc44944ca0>{number = 20, name = (null)}
Hints:
Backtrace:
0 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
1 _DVTAssertionHandler (in DVTFoundation)
2 _DVTAssertionFailureHandler (in DVTFoundation)
3 -[IDEProvisioningRepairStepGenerator_Automatic _evaluateCertificatesWithSession:context:repairable:steps:userAction:error:] (in IDEFoundation)
4 -[IDEProvisioningRepairStepGenerator_Automatic stepsWithSession:context:userAction:error:] (in IDEFoundation)
5 -[IDEProvisioningRepair execute] (in IDEFoundation)
6 __53-[IDEProvisioningMechanic _executeNextRepairIfNeeded]_block_invoke_2 (in IDEFoundation)
7 __DVT_CALLING_CLIENT_BLOCK__ (in DVTFoundation)
8 __DVTDispatchAsync_block_invoke (in DVTFoundation)
9 _dispatch_call_block_and_release (in libdispatch.dylib)
10 _dispatch_client_callout (in libdispatch.dylib)
11 _dispatch_continuation_pop (in libdispatch.dylib)
12 _dispatch_async_redirect_invoke (in libdispatch.dylib)
13 _dispatch_root_queue_drain (in libdispatch.dylib)
14 _dispatch_worker_thread2 (in libdispatch.dylib)
15 _pthread_wqthread (in libsystem_pthread.dylib)
16 start_wqthread (in libsystem_pthread.dylib)
I have deleted caches in library, derivated data, even disabled automatic signing, but none of these work.
UPDATE
Project can be opened, when I logout from developer account, otherwise, this crash always occurs.
I was having the same crash on XCode 11.3.1. I went on to "Show package contents" of the ".xcworkspace" workspace directory and deleted "xcuserdata" folder. This resolved the crash for me.
After working for a day on older Xcode, suddenly error popped out, that code signing in our test target is wrong, so I just removed team and added it again.
None of the solutions works for me, including all solution this discussion in Apple Developer Forums. Someone suggest you delete all xcuserdata in *.xcworkspace folder; Someone suggests you create a new *.xcworkspace from you xcodeproj. However, those are not workarounds for me.
It seems a signing issues on my project, but I cannot open my project to reset the provisions method. So I modify the project.pbxproj file located in *.xcodeproj/project.pbxproj. Replace ALL:
ProvisioningStyle = Automatic;
to
ProvisioningStyle = Manual;
Then open the project to uncheck automatically manage signing in Signing & Capabilities option. Then when I sign again manually, problem solved.
I still don't know why this error comes out, but it just crashes every time I sign my UITest target. Hope someone can explain to me.
Delete the .xcworkspace from your project. then
from terminal pod install. This is how solve my problem
Same problem was occurring with me for one project. I just delete .workspace file and reinstall pods so .workspace file is generated. Now i am able to open this project and Xcode is not crashing.
Solution 1. if you are using the pod.
Delete .xcworkspace file and pod update
2. If there is any xib file that is not supported or corrupted.
copy that xib outside and remove from the physical folder.
I was getting:
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace ASSERTIOND, Code 0xd00d2bad
Tried restarting Xcode, the computer, deleting xcworkspace, but nothing worked.
Finally deleting Derived Data worked. This is because I'm testing Xcode extensions (12.4) and had an error in my XCSourceEditorCommandDefinitionKey dictionary. I was storing an integer for .identifierKey instead of a String.
Since I was actively developing the extension, I had to delete Derived Data to remove the extension.

Is EXC_BAD_ACCESS(code=EXC_I386_GPFLT) a SEGFAULT (invalid address) on iOS 64 bit simulator?

Our app has never worked with the simulator (due to not having 3rd party dependency support for i386 and x86_64). I've just recently resolved the dependencies and I'm now running in 64 bit mode on the simulator now, yet I'm seeing a crash that says EXC_i386_GPFLT. There is no extended code, so I can't tell what exactly the error is.
Is it possible it could be an alignment error too or should I be taking this as a bad address? The crash doesn't occur at all on a 64 bit device. memcpy_s is just a macro for memmove, we do some size checking in it.
Here's the top of the stock, so that you can see where the exception was actually raised.
EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
* frame #0: 0x0000000109cd23a0 libsystem_platform.dylib`_platform_memmove$VARIANT$Nehalem + 96
frame #1: 0x0000000109a66bd4 libsystem_sim_c.dylib`__memmove_chk + 22
frame #2: 0x0000000103b5ee21 appName`memcpy_s(dest=0x6ba6820000000800, sizeInBytes=2, src=0x00007fb26c0ebc18, count=2048) + 113 at file.h:26

How do I debug a crash when the debugger won't crash and the crash log is lacking details?

(Draco has provided an excellent idea in the checked response below.)
This crash occurs in the program when a custom URL is handled by the app delegate, then an operation is started on another thread. Sometimes the operation finishes and I can see the results in the UI. But it is always crashing.
This only happens when running without the debugger. Here is the crash log:
0 libobjc.A.dylib 0x37d9ff7e objc_msgSend + 22
1 CoreData 0x3634bbd2 -[_PFManagedObjectReferenceQueue _processReferenceQueue:] + 934
2 CoreData 0x3634efd0 _performRunLoopAction + 196
3 CoreFoundation 0x359d2b14 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
4 CoreFoundation 0x359d0d50 __CFRunLoopDoObservers + 252
5 CoreFoundation 0x359d10aa __CFRunLoopRun + 754
6 CoreFoundation 0x3595449e CFRunLoopRunSpecific + 294
7 CoreFoundation 0x35954366 CFRunLoopRunInMode + 98
8 GraphicsServices 0x375f0432 GSEventRunModal + 130
9 UIKit 0x33460cce UIApplicationMain + 1074
10 myApp 0x000e2770 main (main.m:15)
11 myApp 0x000e2728 start + 32
It looks like its trying to respond to an event or, more specifically, a notification. If that's the case, I'm guessing that the tageted observer has been removed or the object it was added to has been deallocated.
Is there a way I can intercept notifications and have a look at what's in them? If I could, I can probably identify which observer is missing, or at least narrow it down.
Update added to address WrightsCS's point about All Exceptions breakpoint. These are both set to Break On Throw, all exceptions. (Break on catch doesn't work either.)
How does this work when there is no exception, no crash, while running in the debugger?
Update 2
Re-titled to provide a more general scope of searches by other users.
Was: "App crashes without debugger, but not with. What does the crash log tell me?"
This doesn't answer your explicit question, but it does answer the implied question:
"How do I debug a crash when the debugger won't crash and the crash log is lacking details?"
You can look at more than just the crash logs in XCode Organizer. Take a look at the Console output in the Organizer Devices section; look at the device that had the crash and click on Console. You should be able to see the debugging output from the NSLog statements there, even if it's not running with the debugger.
You can look at this in XCode while the application is running, even if the debugger is not running.
The console shows more than your application's output, so you will have to sift through it to see your applications outputs. You will see the application name on the corresponding lines.
You can do this with code compiled for Debug, Ad-Hoc, or Release. Try it with someone else's app. (Try it with Twitter. You will see some debug logging there. Try it with Safari. You might see your other suspended apps being killed by jetsam.)
You may not be able to see the line it crashed on, but you should be able to narrow it down by judiciously inserting some debug code.

Xcode crashes - but only for a specific project (target 'MyApp' has been asked for its build context but it does not belong to a project)

Whenever I try to run a specific project / app from Xcode it crashes with the details in the backtrace (please see below).
All sorts of funny stuff is going on running this in Xcode.
First, deleting the app from the iPad simulator and then running it for the first time seems to be working 90% of the time. But then either the second or the third attempt running on the iPad simulator it crashes again.
Trying to run it on a iPad device always crash, not luck at all.
Another funny thing I noticed is that whenever I do manage to get it to run for a second time on the iPad simulator all my appearance code (colors etc.) define in my app delegate is gone...
The only clue I could gather from the backtrace is: target 'MyApp' has been asked for its build context but it does not belong to a project
So, I'm not sure wheter this is Xcode related or perhaps somthing with the workspace / project file since it only crashes on this very specific project. If it is a problem with my workspace or project file, does anybody know how to fix this?
I appreciate your help.
Backtrace details:
Application Specific Information:
ProductBuildVersion: 4E2002
ASSERTION FAILURE in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport- 1197/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/Target.subproj/PBXTarget.m:4006
Details: target 'MyApp' has been asked for its build context but it does not belong to a project
Object: <PBXNativeTarget: 0x409f3d8c0>
Method: -targetBuildContext
Thread: <NSThread: 0x40a7d8a80>{name = (null), num = 51}
Hints: None
Backtrace:
0 0x000000010bbbbb9f -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in IDEKit)
1 0x000000010b070635 _DVTAssertionFailureHandler (in DVTFoundation)
2 0x000000010e18c505 -[PBXTarget targetBuildContext] (in DevToolsCore)
3 0x000000010e18fec4 -[PBXTarget(XCBuildables) buildDidFinishWithBuildLogRecorder:] (in DevToolsCore)
4 0x000000010e2fefe2 -[Xcode3TargetBuildableSnapshot buildForBuilderDidFinish:] (in DevToolsCore)
5 0x000000010b6bb668 -[IDEBuildableSnapshot performBuildForBuilder:buildCommand:buildOnlyTheseFiles:] (in IDEFoundation)
6 0x000000010b6bada6 -[IDEBuilder main] (in IDEFoundation)
7 0x00007fff95e8b6b4 -[__NSOperationInternal start] (in Foundation)
8 0x00007fff95e9e912 ____NSOQSchedule_block_invoke_2 (in Foundation)
9 0x00007fff96d6da86 _dispatch_call_block_and_release (in libdispatch.dylib)
10 0x00007fff96d6e965 _dispatch_worker_thread2 (in libdispatch.dylib)
11 0x00007fff8f67c3da _pthread_wqthread (in libsystem_c.dylib)
12 0x00007fff8f67db85 start_wqthread (in libsystem_c.dylib)
objc[31243]: garbage collection is ON
abort() called
So I finally figured out what the problem was.
I was using a build script that bumped my build number (CFBundleShortVersionString) after each build.
It seems Xcode doesn't like the fact that the plist file gets changed underneath it.
The only "workaround" I could come up with was to remove the build step containing my version bump script that changed that plist file on every build.
Have faced with that about hour and I haven't auto-increasing build number script. If you are trying to delete target by right-click make sure that this target is closed, even at tab where you are deleting. Select another one and right-click to delete needed target.
Hope it helps

Multiple locks on web thread not allowed! Please file a bug. Crashing now

i make a url-Request and waiting for the answer with
I start the request, then waiting until synchronousOperationComplete=TRUE
NSRunLoop *theRL = [NSRunLoop currentRunLoop];
while (!synchronousOperationComplete && [theRL runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]);
then I return the response
all seems to be ok,i get the response and everything is working normal, but when I close the app
i get:
bool _WebTryThreadLock(bool), 0x227f40: Multiple locks on web thread not allowed! Please file a bug. Crashing now...
1 _ZL17_WebTryThreadLockb
2 _ZL14WebRunLoopLockP19__CFRunLoopObservermPv
3 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
4 __CFRunLoopDoObservers
5 __CFRunLoopRun
6 CFRunLoopRunSpecific
7 CFRunLoopRunInMode
8 _ZL12RunWebThreadPv
9 _pthread_start
10 thread_start
it seems to be the NSRunLoop what causes the error,
when I commend it out the error doesn't appear.
I use IOS 5.0
does someone have a clue what I can do to avoid this error?
i used this in IOS 4.3 and IOS5 Beta and it works fine.
but i moved my tomcat6 to an other server, maybe it is an error of the server
THX
mBax
I just had the same error message, but I tried to call a stringByEvaluatingJavaScript on a webView that wasn't on screen.
In general this message hints that something is trying to access an item (UIWebView) while the particular thread of this item is locked.
If you have used the following code:
[[NSRunLoop currentRunLoop ] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:2.0]];
Remove it if not needed, or reduce the time interval. It worked for me.
For me it was a view that was added on
- (void)applicationDidEnterBackground:(UIApplication *)application{}
i commended it out and now it woks!
https://devforums.apple.com/message/575760#575760
may help if someone has the same error