App crashed during realm access when app in background #7183
Labels
More-information-needed
More information is needed to progress. The issue will close automatically in 2 weeks.
O-Community
Goals
App should not crash when realm is accessed in background
Expected Results
App should not crash when realm is accessed in background
Actual Results
App crashed when randomly accessing realm in background
stack trace
Date/Time: 2021-03-19T14:35:10.999Z
Launch Time: 2021-03-19T14:14:19Z
OS Version: iPhone OS 14.2 (18B92)
Report Version: 104
Exception Type: SIGSEGV
Exception Codes: SEGV_MAPERR at 0x6dca45bc8894
Crashed Thread: 12
Thread 12 Crashed:
0 Realm 0x00000001037b56e4 realm::ArrayString::get(char const*, unsigned long, realm::Allocator&) + 16
1 Realm 0x00000001037b24c8 realm::StringData realm::Obj::getrealm::StringData(realm::ColKey::Idx) const + 348
2 Realm 0x00000001035bf570 ZN12_GLOBAL__N_115makeBoxedGetterIN5realm10StringDataEEEP11objc_objectm_block_invoke (RLMAccessor.mm:93)
3 myApp 0x00000001014123a0 function signature specialization <Arg[0] = Owned To Guaranteed> of myApp.PhoneModel.init(phone: myApp.Phone) -> myApp.PhoneModel (ContacmyAppdel.swift:23)
4 myApp 0x0000000101ca7e7c merged myApp.Phone.modelObject.getter : myApp.PhoneModel + 68
5 myApp 0x0000000101413fdc function signature specialization <Arg[0] = Owned To Guaranteed, Arg[1] = Owned To Guaranteed> of myApp.CNAMModel.init(contact: myApp.CNAM) -> myApp.CNAMModel (ContacmyAppdel.swift:524)
6 myApp 0x0000000101caa068 merged myApp.Contact.modelObject.getter : myApp.ContacmyAppdel + 68
7 myApp 0x000000010144be10 function signature specialization <Arg[3] = Dead> of generic specialization <myApp.CNAM> of myApp.UnifiedDatabase.fetch(predicate: __C.NSPredicate?, sortDescriptors: [RealmSwift.SortDescriptor]?, count: Swift.Int?)
> [A.ModelType] (<compilergenerated>:0)8 myApp 0x00000001013781d8 myApp.CNAMManager.clsearch(: Swift.String?, isEmail: Swift.Bool, line: Swift.String?)
> myApp.CallLogItems? (<compilergenerated>:0)9 myApp 0x00000001015dca18 function signature specialization <Arg[4] = Dead> of myApp.ContactManager.(searchItem in 4F209BFFF5A775A7FE9649E72A8E5957)(: Swift.String?, isEmail: Swift.Bool, line: Swift.String?, allowcnam: Swift.Bool) -> myApp.CallLogItems? (ContactManager.swift:285)
10 myApp 0x00000001015dcc88 function signature specialization <Arg[4] = Dead> of myApp.ContactManager.getContactNameAndType(: Swift.String?, isEmail: Swift.Bool, line: Swift.String?, allowcnam: Swift.Bool)
> myApp.CallLogItems (<compilergenerated>:0)11 myApp 0x0000000101543d04 myApp.CallLogItemViewModel.updateViewModelWithContact()
> () (<compilergenerated>:0)12 myApp 0x0000000101743a64 myApp.CallsPresenter.contactLoaded(myApp.CallLogItemViewModel) -> () (CallsPresenter.swift:567)
13 myApp 0x00000001017435f4 myApp.CallsPresenter.updateFilteredItems(myApp.CallLogItemViewModel?) -> () (CallsPresenter.swift:554)
14 myApp 0x00000001017412b0 myApp.CallsPresenter.updateViewModel(: myApp.CallLogModel, updateFilteredList: Swift.Bool) -> () (CallsPresenter.swift:425)
15 myApp 0x000000010173f110 closure #1 ()
> () in closure #1 (myApp.ItemResult<myApp.CallLogModel>)> () in closure #1 ()> () in myApp.CallsPresenter.initializeCallLogs()> () (CallsPresenter.swift:248)16 myApp 0x0000000100d40700 reabstraction thunk helper from @callee_guaranteed () -> () to @escaping @callee_guaranteed ()
> () (<compilergenerated>:0)17 myApp 0x0000000100d40720 reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @callee_unowned @convention(block) ()
> () (<compilergenerated>:0)18 libdispatch.dylib 0x00000001a5b00db0 dispatch_client_callout + 16
19 libdispatch.dylib 0x00000001a5b0f428 dispatch_lane_barrier_sync_invoke_and_complete + 56
20 myApp 0x000000010173e860 closure #1 (myApp.ItemResult<myApp.CallLogModel>) -> () in closure #1 ()
> () in myApp.CallsPresenter.initializeCallLogs()> () (CallsPresenter.swift:247)21 myApp 0x0000000101849f84 partial apply forwarder for closure #1 (myApp.ItemResult<myApp.CallLogModel>) ~~> () in myApp.CallsInterator.initializeCallLogs(: Swift.Bool, onCompletion: (myApp.ItemResult<myApp.CallLogModel>)~~ > (), onInitialLoadComplete: ()
> ())> () (CallsInterator.swift:0)22 myApp 0x000000010120c43c myApp.CallLogsDao.rx_initializeAllCallLogs(: Swift.Bool, completion: (myApp.ItemResult<myApp.CallLogModel>) -> (), onInitialLoadComplete: ()
> ())> () (CallLogsDao.swift:316)23 myApp 0x0000000101849324 myApp.CallsInterator.initializeCallLogs(: Swift.Bool, onCompletion: (myApp.ItemResult<myApp.CallLogModel>) -> (), onInitialLoadComplete: ()
> ())> () (CallsInterator.swift:260)24 myApp 0x0000000101849dec protocol witness for myApp.CallsUseCase.initializeCallLogs(_: Swift.Bool, onCompletion: (myApp.ItemResult<myApp.CallLogModel>)
> (), onInitialLoadComplete: ()> ())> () in conformance myApp.CallsInterator : myApp.CallsUseCase in myApp (<compilergenerated>:0)25 myApp 0x000000010173e6ec closure #1 ()
> () in myApp.CallsPresenter.initializeCallLogs()> () (CallsPresenter.swift:242)26 myApp 0x0000000100b6c374 reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) ()
> () (<compilergenerated>:0)27 libdispatch.dylib 0x00000001a5aff24c _dispatch_call_block_and_release + 28
28 libdispatch.dylib 0x00000001a5b00db0 _dispatch_client_callout + 16
29 libdispatch.dylib 0x00000001a5b11a68 _dispatch_root_queue_drain + 652
30 libdispatch.dylib 0x00000001a5b12120 _dispatch_worker_thread2 + 112
31 libsystem_pthread.dylib 0x00000001ef3247c8 _pthread_wqthread + 212
32 libsystem_pthread.dylib 0x00000001ef32b75c start_wqthread + 4
Steps for others to Reproduce
This is happens randomly. No specific steps. In this case app crashed in 8 sec after app moved to background
Version of Realm and Tooling
Realm framework version: 10.5.0
Realm Object Server version: N/A
Xcode version: 12.0.1
iOS/OSX version: iPhone OS 14.2 (18B92)
Dependency manager + version: Cocoapods 1.10.1
The text was updated successfully, but these errors were encountered: