Saturday, October 14, 2023
HomeiOS DevelopmentHow one can repair EXC_BAD_ACCESS KERN_INVALID_ADDRESS crash?

How one can repair EXC_BAD_ACCESS KERN_INVALID_ADDRESS crash?


Description

  1. This can be a crash that happens inside seconds of a person opening the app.

  2. This crash happens randomly, it isn’t reproducible.

  3. This crash happens in a single place solely, within the technique that queries the entire person’s posts

  4. I’ve a number of strategies which are structured equally to this technique that question completely different units of information and the crash doesn’t happen in these strategies.

  5. I’ve checked the information being queried and it’s completely okay.

  6. It seems that the crash happens when the FIRDocumentSnapshot’s information is making an attempt for use. (doc.information)

  7. The strive, catch block surrounding the strategy doesn’t forestall the crash.

I’m all out of concepts of what to do.

Crashed: com.apple.main-thread 
0  FirebaseFirestore              0x905a4 -[FSTUserDataWriter convertedValue:] + 268 
1  FirebaseFirestore              0x906cc -[FSTUserDataWriter convertedObject:] + 120 
2  FirebaseFirestore              0x90610 -[FSTUserDataWriter convertedValue:] + 376 
3  FirebaseFirestore              0x5865c -[FIRDocumentSnapshot dataWithServerTimestampBehavior:] + 200 
4  FirebaseFirestore              0x58b14 -[FIRQueryDocumentSnapshot dataWithServerTimestampBehavior:] + 44 
5  FirebaseFirestore              0x58a70 -[FIRQueryDocumentSnapshot data] + 44 
6  WeDivvy                        0x1189c __125-[GetDataObject GetDataGetItemsInSpecificHome:collection:keyArray:currentViewController:crashlyticsString:completionHandler:]_block_invoke + 1408 (GetDataObject.m:1408) 
7  FirebaseFirestore              0x87db0 -[FIRQuery wrapQuerySnapshotBlock:]::Converter::OnEvent(firebase::firestore::util::StatusOr<firebase::firestore::api::QuerySnapshot>) + 128 
8  FirebaseFirestore              0x11ce0c firebase::firestore::api::Question::GetDocuments(firebase::firestore::api::Supply, std::__1::unique_ptr<firebase::firestore::core::EventListener<firebase::firestore::api::QuerySnapshot>, std::__1::default_delete<firebase::firestore::core::EventListener<firebase::firestore::api::QuerySnapshot> > >&&)::ListenOnce::OnEvent(firebase::firestore::util::StatusOr<firebase::firestore::api::QuerySnapshot>) + 352 
9  FirebaseFirestore              0x11d3b8 firebase::firestore::api::Question::AddSnapshotListener(firebase::firestore::core::ListenOptions, std::__1::unique_ptr<firebase::firestore::core::EventListener<firebase::firestore::api::QuerySnapshot>, std::__1::default_delete<firebase::firestore::core::EventListener<firebase::firestore::api::QuerySnapshot> > >&&)::Converter::OnEvent(firebase::firestore::util::StatusOr<firebase::firestore::core::ViewSnapshot>) + 756 
10 FirebaseFirestore              0x3d15c void std::__1::__invoke_void_return_wrapper<void, true>::__call<firebase::firestore::core::AsyncEventListener<firebase::firestore::core::ViewSnapshot>::OnEvent(firebase::firestore::util::StatusOr<firebase::firestore::core::ViewSnapshot>)::'lambda'()&>(firebase::firestore::core::AsyncEventListener<firebase::firestore::core::ViewSnapshot>::OnEvent(firebase::firestore::util::StatusOr<firebase::firestore::core::ViewSnapshot>)::'lambda'()&) + 104 
11 FirebaseFirestore              0x151604 firebase::firestore::util::Job::ExecuteAndRelease() + 184 
12 libdispatch.dylib              0x647c8 _dispatch_client_callout + 16 
13 libdispatch.dylib              0x45f18 _dispatch_main_queue_drain + 888 
14 libdispatch.dylib              0x45b90 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 36 
15 CoreFoundation                 0x93848 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 
16 CoreFoundation                 0x774d4 __CFRunLoopRun + 2096 
17 CoreFoundation                 0x7bb7c CFRunLoopRunSpecific + 584 
18 GraphicsServices               0x1984 GSEventRunModal + 160 
19 UIKitCore                      0x3753c8 -[UIApplication _run] + 868 
20 UIKitCore                      0x375040 UIApplicationMain + 312 
21 WeDivvy                        0x1af38 principal + 18 (principal.m:18) 22 ???                            0x1d7bc4df0 (Lacking) 

x

-(void)GetDataGetItemsInSpecificHome:(NSString *)homeID assortment:(NSString *)assortment keyArray:(NSArray *)keyArray currentViewController:(UIViewController *)currentViewController crashlyticsString:(NSString *)crashlyticsString completionHandler:(void (^)(BOOL completed, NSMutableDictionary *returningDataDict))finishBlock {

    @strive {          

        [[FIRCrashlytics crashlytics] logWithFormat:@"GetDataGetItemsInSpecificHome %@ Processing(1)", assortment];          

        __block NSMutableDictionary *dataDict = [NSMutableDictionary dictionary];          

        FIRFirestore *defaultFirestore = [FIRFirestore firestore];          

        [[[defaultFirestore collectionWithPath:collection] queryWhereField:@"ItemHomeID" isEqualTo:homeID] getDocumentsWithCompletion:^(FIRQuerySnapshot * _Nullable snapshot, NSError * _Nullable error) {    

            [[FIRCrashlytics crashlytics] logWithFormat:@"GetDataGetItemsInSpecificHome %@ Processing(2)", assortment];                  

            for (FIRDocumentSnapshot *doc in snapshot.paperwork) {                          

            [[FIRCrashlytics crashlytics] logWithFormat:@"GetDataGetItemsInSpecificHome Processing(3)"];                     

            for (NSString *key in keyArray) {                                  

                [[FIRCrashlytics crashlytics] logWithFormat:@"GetDataGetItemsInSpecificHome:%@ key:%@ Processing(4)", crashlyticsString, key];                                  

                NSMutableArray *arr = dataDict[key] ? [dataDict[key] mutableCopy] : [NSMutableArray array];                                  

******************************CRASH OCCURS HERE**********************************

                NSDictionary *docData = doc.information ? doc.information : [Dictionary dictionary];

******************************CRASH OCCURS HERE**********************************

                id object = doc.information[key] ? doc.information[key] : [[[GeneralObject alloc] init] GenerateDefaultValueBasedOnKey:key];                                                                              [arr addObject:object];                                                                             [dataDict setObject:arr forKey:key];  
   
            }

        }

        finishBlock(YES, dataDict); 
                                                                                                 
    } @catch (NSException *exception) {   

        finishBlock(YES, [NSMutableDictionary dictionary]);   

    } 

}



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments