google / gtm-session-fetcher

Google Toolbox for Mac - Session Fetcher
Apache License 2.0
247 stars 148 forks source link

Crash on CCTClearcutUploader #117

Closed bobvoorneveld closed 5 years ago

bobvoorneveld commented 6 years ago

On of the users off our app had a crash on CCTClearcutUploader. This was reported via Firebase Analytics. Here is the information regarding the crash:

Stacktrace:

Gecrasht: CCTClearcutUploader
SIGABRT ABORT 0x0000000181b4d2ec
0
libsystem_kernel.dylib
__pthread_kill + 8
1
libsystem_pthread.dylib
pthread_kill$VARIANT$mp + 376
2
libsystem_c.dylib
abort + 140
3
libsystem_malloc.dylib
szone_size + 634
4
CoreFoundation
mdict_rehashd + 288
5
CoreFoundation
-[__NSDictionaryM setObject:forKeyedSubscript:] + 352
arrow_right 6
Crewlink
+[FPRFeatureControl featureForceState:] + 4299811352
7
Crewlink
+[FPRFeatureControl featureEnabled:] + 4299809144
8
Crewlink
__InstrumentSessionWithConfigurationDelegateDelegateQueue_block_invoke + 4299878268
9
GTMSessionFetcher
GTMSessionFetcher.m - Regel 622
-[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:]
10
Crewlink
-[CCTClearcutUploader uploadNonBatch:] + 4299909992
11
Crewlink
-[CCTClearcutUploader uploadNext] + 4299909056
12
Crewlink
__66-[CCTClearcutUploader uploadWithCompletionHandler:isOnForeground:]_block_invoke + 4299904712
13
libdispatch.dylib
_dispatch_call_block_and_release + 24
14
libdispatch.dylib
_dispatch_client_callout + 16
15
libdispatch.dylib
_dispatch_queue_serial_drain$VARIANT$mp + 608
16
libdispatch.dylib
_dispatch_queue_invoke$VARIANT$mp + 336
17
libdispatch.dylib
_dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 340
18
libdispatch.dylib
_dispatch_workloop_worker_thread$VARIANT$mp + 668
19
libsystem_pthread.dylib
_pthread_wqthread + 860
20
libsystem_pthread.dylib
start_wqthread + 4
BKSAssertionClientMultiplexer
0
AssertionServices
-[BKSAssertion _clientQueue_acquireAssertion] + 10
9 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
com.apple.network.boringssl.metrics_queue
0
libsystem_kernel.dylib
mach_msg_trap + 8
16 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
Thread #1
0
libsystem_kernel.dylib
__workq_kernreturn + 8
2 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
com.apple.uikit.eventfetch-thread
0
libsystem_kernel.dylib
mach_msg_trap + 8
11 arrow_drop_down
libsystem_pthread.dylib
thread_start + 4
Thread #2
0
libsystem_pthread.dylib
start_wqthread + 122
com.twitter.crashlytics.ios.binary-images
0
libsystem_kernel.dylib
write + 8
1
Crewlink
CLSFile.m - Regel 244
__CLSFileWriteWithRetries_block_invoke
2
Crewlink
CLSFile.m - Regel 213
CLSFileLoopWithWriteBlock
3
Crewlink
CLSFile.m - Regel 190
CLSFileWriteToFileDescriptorOrBuffer
4
Crewlink
CLSFile.m - Regel 488
CLSFileWriteHashKey
5
Crewlink
CLSFile.m - Regel 512
CLSFileWriteHashEntryString
6
Crewlink
CLSBinaryImage.m - Regel 440
CLSBinaryImageRecordDetails
7
Crewlink
CLSBinaryImage.m - Regel 514
__CLSBinaryImageChanged_block_invoke
8
libdispatch.dylib
_dispatch_call_block_and_release + 24
15 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
FIRAnalyticsQueue
0
libsystem_kernel.dylib
__ulock_wake + 8
1 arrow_drop_down
libdispatch.dylib
_dispatch_unfair_lock_wake + 36
2
Crewlink
+[FIRAMeasurement monitor] + 4299362772
3
Crewlink
__55+[FIRAMeasurement initializeSharedInstanceWithOptions:]_block_invoke + 4299362428
4
libdispatch.dylib
_dispatch_client_callout + 16
5 arrow_drop_down
libdispatch.dylib
dispatch_once_f$VARIANT$mp + 60
6
Crewlink
+[FIRAMeasurement initializeSharedInstanceWithOptions:] + 4299362324
7
Crewlink
__47+[FIRAnalytics startWithConfiguration:options:]_block_invoke_2 + 4299466020
8
libdispatch.dylib
_dispatch_call_block_and_release + 24
15 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
Thread #3
0
libsystem_pthread.dylib
start_wqthread + 122
com.twitter.crashlytics.ios.MachExceptionServer
0
libsystem_kernel.dylib
mach_msg_trap + 8
1 arrow_drop_down
libsystem_kernel.dylib
mach_msg + 72
2
Crewlink
CLSMachException.c - Regel 180
CLSMachExceptionServer
3
libsystem_pthread.dylib
_pthread_body + 272
5 arrow_drop_down
libsystem_pthread.dylib
thread_start + 4
CCTClearcutUploader
0
libsystem_kernel.dylib
__open + 8
4 arrow_drop_down
Foundation
+[NSData(NSData) dataWithContentsOfURL:options:error:] + 68
5
Crewlink
-[CCTClearcutUploader logFiles] + 4299906700
6
Crewlink
__66-[CCTClearcutUploader uploadWithCompletionHandler:isOnForeground:]_block_invoke + 4299904272
7
libdispatch.dylib
_dispatch_call_block_and_release + 24
14 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
Thread #4
0
libsystem_kernel.dylib
__workq_kernreturn + 8
2 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
Thread #5
0
libsystem_pthread.dylib
start_wqthread + 122
com.apple.main-thread
0
libsystem_kernel.dylib
__open + 8
23 arrow_drop_down
UIKit
UIApplicationMain + 236
24
Crewlink
CrewlinkViewController.swift - Regel 16
main
25
libdyld.dylib
start + 4
Thread #6
0
libsystem_kernel.dylib
__workq_kernreturn + 8
2 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
phenotype.completionQueue
0
CoreFoundation
__CFSearchStringROM + 124
7 arrow_drop_down
CFNetwork
+[NSURLSession sessionWithConfiguration:delegate:delegateQueue:] + 508
8
Crewlink
__InstrumentSessionWithConfigurationDelegateDelegateQueue_block_invoke + 4299878464
9
GTMSessionFetcher
GTMSessionFetcher.m - Regel 622
-[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:]
10
Crewlink
-[PHTSyncOperation sendRequest:changeCount:] + 4300013944
11
Crewlink
__27-[PHTSyncOperation execute]_block_invoke + 4300013148
12
Crewlink
__63-[PHTPhenotypeDatabase performTransactionInsideQueue:onFinish:]_block_invoke.246 + 4300068572
13
libdispatch.dylib
_dispatch_call_block_and_release + 24
20 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
com.apple.network.connections
0
libboringssl.dylib
do_seal_record + 340
20 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
PHTPhenotypeSyncQueue
0
libsystem_kernel.dylib
semaphore_wait_trap + 8
2 arrow_drop_down
libdispatch.dylib
_dispatch_semaphore_wait_slow + 136
3
Crewlink
__50-[PHTPhenotype syncAllAccounts:syncType:callback:]_block_invoke + 4299957872
4
libdispatch.dylib
_dispatch_call_block_and_release + 24
11 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
Thread #7
0
libsystem_kernel.dylib
__workq_kernreturn + 8
2 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
com.apple.NSURLSession-work
0
libobjc.A.dylib
search_method_list(method_list_t const*, objc_selector*) + 80
18 arrow_drop_down
libsystem_pthread.dylib
start_wqthread + 4
com.apple.NSURLConnectionLoader
0
libsystem_kernel.dylib
mach_msg_trap + 8
9 arrow_drop_down
libsystem_pthread.dylib
thread_start + 4

KEYS:
crash_info_entry_0 -> abort() called
crash_info_entry_1 -> *** error for object 0x101c731b0: pointer being freed was not allocated

DEVICE INFO
Model: iPhone 6
Stand: Front up
Available RAM: 110.7 MB
diskspace: 35.91 GB

Versie: 11.3.0 (15E216)
Stand: Portrait
Jailbroken: No
Date: 19 apr. 2018 19:17:00
thomasvl commented 6 years ago

@bobvoorneveld - I edited your post to put what seems to be the pasted log in a fixed width block so it is a little easer to read.

At first glance, I would say this is likely in the Crewlink code or it's interactions with Firebase. I think this is saying -[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:] but from there the offsets get really large like there aren't good symbols in the other code to nail thing down. The one symbol is Crewlink __InstrumentSessionWithConfigurationDelegateDelegateQueue_block_invoke, give how large the offset it, is might not mean much. Do you have configuration block for your fetches that might be coming into play as it starts a fetch?

There are some firebase symbols in there +[FPRFeatureControl featureEnabled:] and +[FPRFeatureControl featureForceState:], but against the offsets seem overly large making them somewhat suspects.

Can you get a better crash report? Maybe use a dSYM to symbolicate this? Otherwise, it is really hard to say what's going on.

kam800 commented 6 years ago

Is it the manifestation of the same problem?

0  libsystem_kernel.dylib         0x183ae12ec __pthread_kill + 8
1  libsystem_pthread.dylib        0x183c82288 pthread_kill$VARIANT$mp + 376
2  libsystem_c.dylib              0x183a4fd0c abort + 140
3  libsystem_malloc.dylib         0x183b277d4 nano_ptr_in_use_enumerator + 330
4  libsystem_malloc.dylib         0x183b29bd4 _nano_malloc_check_clear + 416
5  libsystem_malloc.dylib         0x183b28a1c nano_calloc + 80
6  libsystem_malloc.dylib         0x183b1a02c malloc_zone_calloc + 168
7  libsystem_malloc.dylib         0x183b19f60 calloc + 40
8  libobjc.A.dylib                0x1832207d0 class_createInstance + 76
9  libdispatch.dylib              0x18394cb5c _os_object_alloc_realized + 40
10 libxpc.dylib                   0x183cc9584 _xpc_string_create + 36
11 libxpc.dylib                   0x183cb76e4 xpc_string_create + 44
12 libxpc.dylib                   0x183cb7690 xpc_dictionary_set_string + 32
13 Foundation                     0x18499e550 -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 1712
14 CoreFoundation                 0x184060280 ___forwarding___ + 540
15 CoreFoundation                 0x183f4641c _CF_forwarding_prep_0 + 92
16 MobileCoreServices             0x185f3b7c0 -[LSApplicationWorkspace deviceIdentifierForVendor] + 152
17 UIKit                          0x18dd141b8 -[UIDevice identifierForVendor] + 56
18 XXXXX                          0x100c85a28 +[FPRFeatureControl featureEnabled:] + 4345551400
19 XXXXX                          0x100c9597c __InstrumentSessionWithConfigurationDelegateDelegateQueue_block_invoke + 4345616764
20 GTMSessionFetcher              0x100e90960 -[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:] (GTMSessionFetcher.m:622)
21 XXXXX                          0x100c9d5dc -[CCTClearcutUploader uploadNonBatch:] + 4345648604
22 XXXXX                          0x100c9d230 -[CCTClearcutUploader uploadNext] + 4345647664
23 XXXXX                          0x100c9c168 __66-[CCTClearcutUploader uploadWithCompletionHandler:isOnForeground:]_block_invoke + 4345643368
24 libdispatch.dylib              0x18394cb24 _dispatch_call_block_and_release + 24
25 libdispatch.dylib              0x18394cae4 _dispatch_client_callout + 16
26 libdispatch.dylib              0x183956a38 _dispatch_queue_serial_drain$VARIANT$mp + 608
27 libdispatch.dylib              0x183957380 _dispatch_queue_invoke$VARIANT$mp + 336
28 libdispatch.dylib              0x183957d4c _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 340
29 libdispatch.dylib              0x18396011c _dispatch_workloop_worker_thread$VARIANT$mp + 668
30 libsystem_pthread.dylib        0x183c7fe70 _pthread_wqthread + 860
31 libsystem_pthread.dylib        0x183c7fb08 start_wqthread + 4
thomasvl commented 6 years ago

Looks like it would be. The offsets are rather large, so it the session fetcher symbol (and Firebase symbol) just seem to be the closest symbols you binary has to list as the base.

hanjt commented 6 years ago

@kam800 I met the same crash. Have you solved it?

hanjt commented 6 years ago

@kam800 I met the same crash. Have you solved it?

Ihernandezpi commented 5 years ago

Hello! I have the same crash only on release version. With this crashLog from crashlytics:

Crashed: CCTClearcutUploader
0  libdyld.dylib                  0x1afedd6c0 dyld3::closure::ObjCStringTable::hash(char const*, unsigned long) const
1  libdyld.dylib                  0x1afeddcd4 dyld3::closure::ObjCStringTable::getIndex(char const*) const
2  libdyld.dylib                  0x1afeddb54 dyld3::closure::ObjCClassOpt::forEachClass(char const*, dyld3::Array<std::__1::pair<unsigned long, unsigned long> > const&, void (void*, bool, bool*) block_pointer) const
3  libobjc.A.dylib                0x1afe1cb5c getPreoptimizedProtocol
4  libobjc.A.dylib                0x1afe09da0 getProtocol(char const*)
5  libobjc.A.dylib                0x1afe0dc10 objc_getProtocol
6  protobuf                       0x1064e9be4 (Missing)
7  protobuf                       0x1064e4584 (Missing)
8  libobjc.A.dylib                0x1afe0f7c0 resolveInstanceMethod(objc_object*, objc_selector*, objc_class*)
9  libobjc.A.dylib                0x1afe0f64c resolveMethod_locked(objc_object*, objc_selector*, objc_class*, int)
10 libobjc.A.dylib                0x1afe0f4c0 lookUpImpOrForward
11 libobjc.A.dylib                0x1afdfd4fc _objc_msgSend_uncached
----> 12 Eleonor                        0x1047783a8 -[CCTUploaderState(CCTCollectForDebug) isCollectForDebugEnabled:]
13 Eleonor                        0x10478027c -[CCTClearcutUploader checkCollectForDebug]
14 libdispatch.dylib              0x1afda6184 _dispatch_client_callout
15 libdispatch.dylib              0x1afd4ea9c _dispatch_continuation_pop$VARIANT$mp
16 libdispatch.dylib              0x1afd5f010 _dispatch_source_invoke$VARIANT$mp
17 libdispatch.dylib              0x1afd52330 _dispatch_lane_serial_drain$VARIANT$mp
18 libdispatch.dylib              0x1afd52e58 _dispatch_lane_invoke$VARIANT$mp
19 libdispatch.dylib              0x1afd5c340 _dispatch_workloop_worker_thread
20 libsystem_pthread.dylib        0x1afdf5fa4 _pthread_wqthread
21 libsystem_pthread.dylib        0x1afdf8ae0 start_wqthread

Thankyou in advance

thomasvl commented 5 years ago

I don't see the session fetcher in there at all, so I'd suggest reaching out to firebase/clearcut.

Ihernandezpi commented 5 years ago

I don't see the session fetcher in there at all, so I'd suggest reaching out to firebase/clearcut. I'll check firebase. Here is the full stack trace file with all threads: com.overcome.eleonor.ios_issue_crash_3eec3a133d5743489bf9dc78f2311d6f_DNE_0_v2.txt

thomasvl commented 5 years ago

I still don't see the session fetcher in there.

Ihernandezpi commented 5 years ago

I understand. Thanyou. I hope firebase engineers resolve this issue cause is not unique problem. Greattings