firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.69k stars 1.48k forks source link

Crashed: com.google.firebase.crashlytics.ios.exception #5435

Closed kumaresan closed 4 years ago

kumaresan commented 4 years ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Firebase Crashlytics crashing our Application Crashed: com.google.firebase.crashlytics.ios.exception

Steps to reproduce:

The iOS application was shared with a closed user group (customers) via Testflight and hence we could not replicate the issue. But the information that we received was there were two crashes noticed by the user. But we got only one crash logged n our Crashlytics console. Looking deeper, the stack trace looks like it came from Firebase Crashlytics SDK itself while trying to submit the crash. We have upgraded the SDK to a 4.0.0 stable version now. Since, We have planned to go live after this CUG testing we wanted to report this issue.

Exception

 Crashed: com.google.firebase.crashlytics.ios.exception 

Stack Trace:

Crashed: com.google.firebase.crashlytics.ios.exception
0  My Application         0x104a94c64 FIRCLSProcessRecordAllThreads + 392 (FIRCLSProcess.c:392)
1  My Application            0x104a95048 FIRCLSProcessRecordAllThreads + 423 (FIRCLSProcess.c:423)
2  My Application               0x104a8b8ac FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3  My Application               0x104a86ef4 __FIRCLSExceptionRecord_block_invoke + 218 (FIRCLSException.mm:218)
4  libdispatch.dylib              0x1be50b524 _dispatch_client_callout + 16
5  libdispatch.dylib              0x1be4ef1fc _dispatch_lane_barrier_sync_invoke_and_complete + 56
6  My Application             0x104a8668c FIRCLSExceptionRecord + 225 (FIRCLSException.mm:225)
7  My Application               0x104a86984 FIRCLSExceptionRecordNSException + 111 (FIRCLSException.mm:111)
8  My Application             0x104a8626c FIRCLSTerminateHandler() + 279 (FIRCLSException.mm:279)
9  libc++abi.dylib                0x1be60e14c std::__terminate(void (*)()) + 16
10 libc++abi.dylib                0x1be610e58 __cxa_rethrow + 144
11 libobjc.A.dylib                0x1be567d80 objc_exception_rethrow + 40
12 CoreFoundation                 0x1be7bdca0 CFRunLoopRunSpecific + 532
13 GraphicsServices               0x1c890738c GSEventRunModal + 160
14 UIKitCore                      0x1c28f022c UIApplicationMain + 1932
15 My Application            0x1042f0604 main + 4367123972 (<compiler-generated>:4367123972)
16 libdyld.dylib                  0x1be645800 start + 4

Exception

Fatal Exception: NSMallocException
Out of memory. We suggest restarting the application. If you have an unsaved document, create a backup copy in Finder, then try to save.

Stacktrace

Fatal Exception: NSMallocException
0  CoreFoundation                 0x1be8455f0 __exceptionPreprocess
1  libobjc.A.dylib                0x1be567bcc objc_exception_throw
2  CoreFoundation                 0x1be8a1054 _CFPreferencesCopyManagedPreferencesContainerURL.cold.1
3  CoreFoundation                 0x1be89cf34 __CFStringHandleOutOfMemory
4  CoreFoundation                 0x1be7fb458 __CFStringChangeSizeMultiple
5  CoreFoundation                 0x1be7f58f0 __CFStringAppendBytes
6  CoreFoundation                 0x1be7e65b4 __CFStringAppendFormatCore
7  CoreFoundation                 0x1be7e7b10 _CFStringCreateWithFormatAndArgumentsAux2
8  Foundation                     0x1beb003c4 +[NSString stringWithFormat:]
9  Foundation                     0x1bec09e90 __NSISSparseVectorDescription_block_invoke
10 Foundation                     0x1bec09dac NSISSparseVectorDescription
11 Foundation                     0x1bed273dc -[NSISObjectiveLinearExpression description]
12 Foundation                     0x1bec2d530 _NSDescriptionWithLocaleFunc
13 CoreFoundation                 0x1be7e6b48 __CFStringAppendFormatCore
14 CoreFoundation                 0x1be7e7b10 _CFStringCreateWithFormatAndArgumentsAux2
15 Foundation                     0x1beb003c4 +[NSString stringWithFormat:]
16 Foundation                     0x1beb68b00 -[NSISObjectiveLinearExpression setPriorityVector:forKnownAbsentVar:]
17 Foundation                     0x1beb66ab0 -[NSISObjectiveLinearExpression addVar:priority:times:processVarNewToReceiver:processVarDroppedFromReceiver:]
18 Foundation                     0x1bed26930 NSISLinExpEnumerateVarsAndCoefficients
19 Foundation                     0x1beb7602c -[NSISObjectiveLinearExpression addExpression:priority:times:processVarNewToReceiver:processVarDroppedFromReceiver:]
20 Foundation                     0x1beb63eb8 -[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:row:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:]
21 Foundation                     0x1bed1e620 -[NSISEngine _tryToAddConstraintWithMarkerEngineVar:row:mutuallyExclusiveConstraints:]
22 Foundation                     0x1beb63154 -[NSISEngine tryToAddConstraintWithMarker:expression:mutuallyExclusiveConstraints:]
23 Foundation                     0x1beb62d84 -[NSLayoutConstraint _addLoweredExpression:toEngine:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:]
24 Foundation                     0x1beb625f8 -[NSLayoutConstraint _addToEngine:mutuallyExclusiveConstraints:]
25 UIKitCore                      0x1c2cc1c4c -[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:]
26 UIKitCore                      0x1c2cc20cc -[UIView(UIConstraintBasedLayout) _tryToAddConstraintWithoutUpdatingConstraintsArray:roundingAdjustment:mutuallyExclusiveConstraints:]
27 UIKitCore                      0x1c2cc27a8 -[UIView(UIConstraintBasedLayout) nsli_addConstraint:]
28 UIKitCore                      0x1c2cb3b28 -[_UIOrderedLayoutArrangement _activateAndInsertEdgeToEdgeConstraintForGapBetweenPrecedingItem:followingItem:isPrecededByVisibleItem:isFollowedByVisibleItem:isHidden:]
29 UIKitCore                      0x1c2cb5114 -[_UIOrderedLayoutArrangement _insertIndividualGuidesAndConstraintsAsNecessary]
30 UIKitCore                      0x1c2cb5f14 -[_UIOrderedLayoutArrangement _updateArrangementConstraints]
31 UIKitCore                      0x1c2cd0254 -[UIView(AdditionalLayoutSupport) _handleLayoutArrangementConstraintsIfNecessary]
32 UIKitCore                      0x1c2cd0384 -[UIView(AdditionalLayoutSupport) _updateSystemConstraints]
33 UIKitCore                      0x1c2cb79f0 __32-[UIStackView updateConstraints]_block_invoke
34 UIKitCore                      0x1c2cce6b4 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:]
35 UIKitCore                      0x1c2cb79b0 -[UIStackView updateConstraints]
36 UIKitCore                      0x1c2ccf138 -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:]
37 UIKitCore                      0x1c2ccf604 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:]
38 UIKitCore                      0x1c2ccf4e4 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:]
39 UIKitCore                      0x1c2ccf4e4 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:]
40 UIKitCore                      0x1c2ccf4e4 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:]
41 UIKitCore                      0x1c2ccf4e4 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:]
42 Foundation                     0x1beb20080 -[NSISEngine withBehaviors:performModifications:]
43 UIKitCore                      0x1c2ccf818 -[UIView(AdditionalLayoutSupport) _recursiveUpdateConstraintsIfNeededCollectingViews:forSecondPass:]
44 UIKitCore                      0x1c2ccf4e4 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:]
45 UIKitCore                      0x1c2ccfcd4 __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke
46 UIKitCore                      0x1c2ccf90c -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]
47 UIKitCore                      0x1c2cd0750 -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:]
48 UIKitCore                      0x1c2d8b910 -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine]
49 UIKitCore                      0x1c2d9ecf8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
50 QuartzCore                     0x1c53384ac -[CALayer layoutSublayers]
51 QuartzCore                     0x1c533e604 CA::Layer::layout_if_needed(CA::Transaction*)
52 UIKitCore                      0x1c2d8af48 -[UIView(Hierarchy) layoutBelowIfNeeded]
53 UIKitCore                      0x1c2d915ec +[UIView(Animation) performWithoutAnimation:]
54 UIKitCore                      0x1c2ae49f8 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:]
55 UIKitCore                      0x1c2ab2640 -[UITableView _updateVisibleCellsNow:]
56 UIKitCore                      0x1c2acf364 -[UITableView layoutSubviews]
57 UIKitCore                      0x1c2d9ec7c -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
58 QuartzCore                     0x1c53384ac -[CALayer layoutSublayers]
59 QuartzCore                     0x1c533e604 CA::Layer::layout_if_needed(CA::Transaction*)
60 QuartzCore                     0x1c5349148 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
61 QuartzCore                     0x1c5291e34 CA::Context::commit_transaction(CA::Transaction*, double)
62 QuartzCore                     0x1c52bb7c4 CA::Transaction::commit()
63 UIKitCore                      0x1c28e8f40 _UIApplicationFlushRunLoopCATransactionIfTooLate
64 UIKitCore                      0x1c298bba4 __handleEventQueueInternal
65 UIKitCore                      0x1c29838d0 __handleHIDEventFetcherDrain
66 CoreFoundation                 0x1be7c3b64 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
67 CoreFoundation                 0x1be7c3abc __CFRunLoopDoSource0
68 CoreFoundation                 0x1be7c3244 __CFRunLoopDoSources0
69 CoreFoundation                 0x1be7be274 __CFRunLoopRun
70 CoreFoundation                 0x1be7bdc34 CFRunLoopRunSpecific
71 GraphicsServices               0x1c890738c GSEventRunModal
72 UIKitCore                      0x1c28f022c UIApplicationMain
73 My Application            0x1042f0604 main (<compiler-generated>)
74 libdyld.dylib                  0x1be645800 start
google-oss-bot commented 4 years ago

I found a few problems with this issue:

morganchen12 commented 4 years ago

From what I understand com.google.firebase.crashlytics.ios.exception is the mach exception handler thread and a crash in that thread is not indicative of Crashlytics causing the crash but rather intercepting it after some other thread has crashed.

@samedson can definitely explain in more detail than I can, but this crash looks like a normal OOM crash. If that's the case, Firebase won't be able to fix the crash in your app--you'll have to look at your app's allocations and find a way to avoid allocating unnecessary memory.

samedson commented 4 years ago

Yeah what Morgan said is correct - sometimes our own crash capturing is collected in the report. I would recommend you look at the second stacktrace to identify the root cause, and look into your memory allocations.

kumaresan commented 4 years ago

Since the issue could not be replicated, it's not possible to a debugging on the crash. One more Crash reported. Stack trace below. We have upgraded the FirebaseCrashlytics version to 4.0.0 (Stable version).

Fatal Exception: std::bad_alloc
std::bad_alloc
Crashed: com.google.firebase.crashlytics.ios.exception
SIGABRT ABORT 0x0000000199ea2d88
std::__terminate(void (*)())
Crashed: com.google.firebase.crashlytics.ios.exception
0  My Application         0x105488c64 FIRCLSProcessRecordAllThreads + 392 (FIRCLSProcess.c:392)
1    My Application          0x105489048 FIRCLSProcessRecordAllThreads + 423 (FIRCLSProcess.c:423)
2    My Application            0x10547f8ac FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3    My Application             0x10547aef4 __FIRCLSExceptionRecord_block_invoke + 218 (FIRCLSException.mm:218)
4  libdispatch.dylib              0x199d73524 _dispatch_client_callout + 16
5  libdispatch.dylib              0x199d571fc _dispatch_lane_barrier_sync_invoke_and_complete + 56
6    My Application             0x10547a68c FIRCLSExceptionRecord + 225 (FIRCLSException.mm:225)
7    My Application            0x10547a32c FIRCLSTerminateHandler() + 285 (FIRCLSException.mm:285)
8  libc++abi.dylib                0x199e7614c std::__terminate(void (*)()) + 16
9  libc++abi.dylib                0x199e78e58 __cxa_rethrow + 144
10 libobjc.A.dylib                0x199dcfd80 objc_exception_rethrow + 40
11 CoreFoundation                 0x19a025ca0 CFRunLoopRunSpecific + 532
12 GraphicsServices               0x1a416f38c GSEventRunModal + 160
13 UIKitCore                      0x19e15822c UIApplicationMain + 1932
14   My Application            0x104ce4604 main + 4311467524 (<compiler-generated>:4311467524)
15 libdyld.dylib                  0x199ead800 start + 4
samedson commented 4 years ago

@kumaresan can you post the other threads in the stacktrace?

google-oss-bot commented 4 years ago

Hey @kumaresan. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

kumaresan commented 4 years ago

The issue did not occur again, after moving to the stable version of Firebase/Crashlytics. Thanks for your assistance.