-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watchdog crash during realm write transaction #7146
Comments
@dheeraj-singh511 Thank you for submitting this issue. Can you show us a bit more about your start up? Especially what you do with your Realm? Maybe you can even provide a code sample / repository that reproduces this (even if it's just random)? |
@DominicFrei - Here are some details I noticed during this crash based on our app logs and crash log. Hope it helps
Thread 4 name: Dispatch queue: com.example.myappSDKRegistrationAdapter |
Thanks for sharing this information. @dheeraj-singh511 Since you already narrowed done which parts of the code might be responsible for the problem, can you show us this part of the code as an example so that I can better understand what is going on? |
@dheeraj-singh511 are you using |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
Goals
OS watchdog is killing app as realm write transaction is taking time during app launch.
Expected Results
Realm write transaction during app launch should not crash app.
Actual Results
The stack trace shows , app is performing a realm write transaction during app launch. It seems the transaction is blocking main thread causing the app to crash.
{"app_cohort":"2|date=1614024000000&sf=143441&tid=38aa64d5d1f674bb0d049eb028f44033741bfc87ef1f5246bf0596462b6879c5&ttype=i","app_name":"myApp","app_version":"4.0.992","timestamp":"2021-02-25 11:45:02.00 -0800","slice_uuid":"27d2728f-ba41-30c0-afbe-fbcb0347c6fb","adam_id":1097606585,"build_version":"4.0.992","platform":2,"bundleID":"com.myOrg.phone2","share_with_app_devs":1,"is_first_party":0,"bug_type":"109","os_version":"iPhone OS 14.4 (18D52)","incident_id":"CD40286A-7B1E-4173-9B80-00807C3544DF","name":"myApp","is_beta":1}
Incident Identifier: CD40286A-7B1E-4173-9B80-00807C3544DF
Beta Identifier: 390D9356-0692-4704-988F-242EFD58C7A6
Hardware Model: iPhone10,4
Process: myApp [3525]
Path: /private/var/containers/Bundle/Application/5BF0C934-A486-4A63-8E62-5B193866FD9D/myApp.app/myApp
Identifier: com.myOrg.phone2
Version: 4.0.992 (4.0.992)
AppStoreTools: 12D4d
AppVariant: 1:iPhone10,4:14
Beta: YES
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.myOrg.phone2 [398]
Date/Time: 2021-02-25 11:45:02.2995 -0800
Launch Time: 2021-02-25 11:44:40.9363 -0800
OS Version: iPhone OS 14.4 (18D52)
Release Type: User
Baseband Version: 4.02.01
Report Version: 104
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-update watchdog transgression: application<com.myOrg.phone2>:3525 exhausted real (wall clock) time allowance of 10.00 seconds | ProcessVisibility: Background | ProcessState: Running | WatchdogEvent: scene-update | WatchdogVisibility: Background | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 7.030 (user 7.030, system 0.000), 12% CPU", | "Elapsed application CPU time (seconds): 0.009, 0% CPU" | ) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001b9319c5c 0x1b92f1000 + 167004
1 Realm 0x0000000102ed5ca8 realm::util::File::lock+ 3054760 (bool, bool) + 104
2 Realm 0x0000000102d5c39c realm::DB::do_begin_write+ 1508252 () + 88
3 Realm 0x000000010302d958 realm::impl::transaction::begin+ 4462936 (std::__1::shared_ptrrealm::Transaction const&, realm::BindingContext*, realm::impl::NotifierPackage&) + 356
4 Realm 0x0000000103023bb8 realm::impl::RealmCoordinator::promote_to_write+ 4422584 (realm::Realm&) + 268
5 Realm 0x0000000103080538 realm::Realm::begin_transaction+ 4801848 () + 404
6 Realm 0x0000000102c95914 -[RLMRealm beginWriteTransactionWithError:] + 694548 (RLMRealm.mm:0)
7 RealmSwift 0x00000001035f1484 Realm.write(withoutNotifying::) + 251012 (:0)
8 myApp 0x00000001013115d4 specialized closure #1 in UnifiedDatabase.save(item:) + 17323476 (:0)
9 myApp 0x000000010059c108 thunk for @callee_guaranteed ()
> (@error @owned Error) + 3211528 (<compilergenerated>:0)10 myApp 0x0000000100750bd8 partial apply for thunk for @callee_guaranteed ()
> (@error @owned Error) + 5000152 (<compilergenerated>:0)11 myApp 0x0000000100750dfc thunk for @callee_guaranteed () -> + 5000700 (@error @owned Error)partial apply + 12
12 libswiftObjectiveC.dylib 0x00000001b1d7af40 0x1b1d79000 + 8000
13 myApp 0x000000010074cb98 AppLogTracesDao.setDevicePushToken(devicePushToken:) + 4983704 (:0)
14 myApp 0x0000000101428538 specialized PushNotificationManager.pushRegistry(:didUpdate:for:) + 18466104 (PushNotificationManager.swift:104)
15 myApp 0x0000000101426370 @objc PushNotificationManager.pushRegistry(:didUpdate:for:) + 18457456 (:0)
Steps for others to Reproduce
This is a random issue that happens during app lauch.
Version of Realm and Tooling
Realm framework version: 10.5.0
Realm Object Server version: N/A
Xcode version: Version 12.0.1
iOS/OSX version: iPhone OS 14.4
Dependency manager + version: Cocoapods
The text was updated successfully, but these errors were encountered: