firebase / firebase-ios-sdk

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

Crashlytics [CLIEventComponents buildCoordinatesArray:size:] NSRangeException #8318

Closed markshiz closed 3 years ago

markshiz commented 3 years ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur?

Fatal Exception: NSRangeException
0  CoreFoundation                 0x1868a99d4 __exceptionPreprocess
1  libobjc.A.dylib                0x19a25ab54 objc_exception_throw
2  CoreFoundation                 0x186913d98 -[__NSCFString characterAtIndex:].cold.1
3  CoreFoundation                 0x1867a2444 -[__NSDictionaryI objectForKeyedSubscript:]
4  App                            0x102e89d0c -[CLIEventComponents buildCoordinatesArray:size:]
5  App                            0x102e88da8 -[CLIEventComponents build]
6  App                            0x102ebdec0 -[CLIApplicationEventsCoordinator buildEvent:]
7  App                            0x102ebce18 -[CLIApplicationEventsCoordinator writeEvents:]
8  App                            0x102ebcc5c -[CLIApplicationEventsCoordinator syncFetchAndWrite]
9  App                            0x102ebbff4 __52-[CLIApplicationEventsCoordinator eventsForDispatch]_block_invoke
10 libdispatch.dylib              0x1864e2280 _dispatch_client_callout
11 libdispatch.dylib              0x1864c50ec _dispatch_lane_barrier_sync_invoke_and_complete
12 App                            0x102ed4b4c -[CLIAsyncRunner dispatchQueueTaskAndWait:]
13 App                            0x102ebbe68 -[CLIApplicationEventsCoordinator eventsForDispatch]
14 App                           0x102e958b4 -[CLIServiceProxy serviceReadyToDispatchTask]
15 Foundation                     0x187b9e430 __NSFireTimer
16 CoreFoundation                 0x18682a3d0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
17 CoreFoundation                 0x186829fd4 __CFRunLoopDoTimer
18 CoreFoundation                 0x1868294b4 __CFRunLoopDoTimers
19 CoreFoundation                 0x186823840 __CFRunLoopRun
20 CoreFoundation                 0x186822b90 CFRunLoopRunSpecific
21 Foundation                     0x187a407f8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
22 Foundation                     0x187a71964 -[NSRunLoop(NSRunLoop) run]
23 App                            0x102ed4f3c -[CLIRunLoop main]
24 Foundation                     0x187b9d4bc __NSThread__start__
25 libsystem_pthread.dylib        0x1ccf44b3c _pthread_start
26 libsystem_pthread.dylib        0x1ccf49880 thread_start
Crashed: com.google.firebase.crashlytics.ios.exception
0  App                            0x102d69b74 FIRCLSProcessRecordAllThreads + 4341783412
1  App                            0x102d69f54 FIRCLSProcessRecordAllThreads + 4341784404
2  App                            0x102d62ce4 FIRCLSHandler + 4341755108
3  App                            0x102d5d46c __FIRCLSExceptionRecord_block_invoke + 4341732460
4  libdispatch.dylib              0x1864e2280 _dispatch_client_callout + 16
5  libdispatch.dylib              0x1864c50ec _dispatch_lane_barrier_sync_invoke_and_complete + 56
6  App                            0x102d5cc0c FIRCLSExceptionRecord + 4341730316
7  App                            0x102d5cf04 FIRCLSExceptionRecordNSException + 4341731076
8  App                            0x102d5c7ec FIRCLSTerminateHandler() + 4341729260
9  libc++abi.dylib                0x19a356154 std::__terminate(void (*)()) + 16
10 libc++abi.dylib                0x19a3560ec std::terminate() + 44
11 libobjc.A.dylib                0x19a25ad88 _objc_terminate() + 10
12 libdispatch.dylib              0x1864e2294 _dispatch_client_callout + 36
13 libdispatch.dylib              0x1864c50ec _dispatch_lane_barrier_sync_invoke_and_complete + 56
14 App                            0x102ed4b4c -[CLIAsyncRunner dispatchQueueTaskAndWait:] + 4343270220
15 App                            0x102ebbe68 -[CLIApplicationEventsCoordinator eventsForDispatch] + 4343168616
16 App                           0x102e958b4 -[CLIServiceProxy serviceReadyToDispatchTask] + 4343011508
17 Foundation                     0x187b9e430 __NSFireTimer + 64
18 CoreFoundation                 0x18682a3d0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
19 CoreFoundation                 0x186829fd4 __CFRunLoopDoTimer + 1004
20 CoreFoundation                 0x1868294b4 __CFRunLoopDoTimers + 324
21 CoreFoundation                 0x186823840 __CFRunLoopRun + 1912
22 CoreFoundation                 0x186822b90 CFRunLoopRunSpecific + 572
23 Foundation                     0x187a407f8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
24 Foundation                     0x187a71964 -[NSRunLoop(NSRunLoop) run] + 88
25 App                            0x102ed4f3c -[CLIRunLoop main] + 4343271228
26 Foundation                     0x187b9d4bc __NSThread__start__ + 848
27 libsystem_pthread.dylib        0x1ccf44b3c _pthread_start + 288
28 libsystem_pthread.dylib        0x1ccf49880 thread_start + 8

Relevant Code:

Here is our use case:

guard let _ = FirebaseApp.app() else {
    FirebaseApp.configure()
    return
}

// LATER
Crashlytics.crashlytics().setUserID(id)

// LATER
Crashlytics.crashlytics().record(error: error)
rizafran commented 3 years ago

Thanks for reporting this, @markshiz. I tried to reproduce the issue, but I wasn't able to get the same stack trace. Could you provide an MCVE that I can run locally? Also, you could try using the latest SDK version and see if it is reproducible.

morganchen12 commented 3 years ago

CLIEventComponents is not a class defined in Firebase Crashlytics afaik.

markshiz commented 3 years ago

@morganchen12 Ok, I see that the firebase thread was capturing this other exception. I identified the problem in another third party component. Thank you for your help.