Skip to content
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

Consistent Crash on App Launch with RealmSwift v10.48.1 in Production - realm::Exception::what() const EXC_BAD_ACCESS (KERN_PROTECTION_FAILURE) #8732

Open
Sandip3110 opened this issue Dec 16, 2024 · 2 comments

Comments

@Sandip3110
Copy link

How frequently does the bug occur?

Sometimes

Description

Hello,

I’m encountering a crash in my production app within the first 5 seconds of launch, with the following error message:
realm::Exception::what() const EXC_BAD_ACCESS (KERN_PROTECTION_FAILURE)

I’m unable to reproduce this issue during testing, but it occurs consistently in the production app.

I’m currently using RealmSwift v10.48.1.

Could you please help me understand the potential cause of this crash?
Additionally, has this issue been addressed in the latest release?

Thank you!

Stacktrace & log output

Realm
realm::Exception::what() const + 128
1
Realm
RLMError.mm - Line 198
makeError(realm::FileAccessError const&) + 198
2
Realm
RLMRealm.mm - Line 167
RLMRealmTranslateException(NSError* __autoreleasing*) + 167
3
Realm
RLMRealm.mm - Line 435
+[RLMRealm realmWithConfiguration:confinedTo:error:] + 435
4
Realm
RLMRealm.mm - Line 395
+[RLMRealm realmWithConfiguration:queue:error:] + 395
5
RealmSwift
Realm.swift - Line 95
Realm.init(configuration:queue:) + 95
6

PersistenceManager.swift - Line 140
specialized PersistenceManager.getRealm(with:) + 140
7

PersistenceManager.swift - Line 25
closure #1 in DBService.cacheData(key:value:version:) + 25
8

partial apply for closure #1 in DBService.cacheData(key:value:version:) + 108
9

partial apply for closure #1 in DBService.cacheData(key:value:version:) + 125396
10
RxSwift
<compiler-generated> - Line 24
partial apply for thunk for @escaping @callee_guaranteed (@in_guaranteed A.PrimitiveSequenceType.Element) -> (@owned PrimitiveSequence<CompletableTrait, Never>, @error @owned Error) + 24
11
RxSwift
MapSwitchSink.performMap(_:) + 32
12
RxSwift
FlatMapFirstSink.performMap(_:) + 12
13
RxSwift
Merge.swift - Line 443
MergeSink.on(_:) + 443
14
RxSwift
<compiler-generated> - Line 20
protocol witness for ObserverType.on(_:) in conformance MergeSink<A, B, C> + 20
15
RxSwift
Sink.swift - Line 35
Sink.forwardOn(_:) + 35
16
RxSwift
SubscribeOn.swift - Line 46
SubscribeOnSink.on(_:) + 46
17
RxSwift
<compiler-generated> - Line 20
protocol witness for ObserverType.on(_:) in conformance SubscribeOnSink<A, B> + 20
18
RxSwift
Just.swift - Line 83
Just.subscribe<A>(_:) + 83
19
RxSwift
<compiler-generated> - Line 28
protocol witness for ObservableType.subscribe<A>(_:) in conformance Observable<A> + 28
20
RxSwift
SubscribeOn.swift - Line 59
closure #1 in SubscribeOnSink.run() + 59
21
RxSwift
ConcurrentMainScheduler.swift - Line 58
closure #1 in DispatchQueueConfiguration.schedule<A>(_:action:) + 58
22
RxSwift
<compiler-generated> - Line 28
thunk for @escaping @callee_guaranteed () -> () + 28
23
libdispatch.dylib
_dispatch_call_block_and_release + 32
32
libsystem_pthread.dylib
start_wqthread + 8

Can you reproduce the bug?

No

Reproduction Steps

No response

Version

10.48.1

What Atlas Services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

All iOS devices

Build environment

Xcode version: 15.2
CocoaPods: 1.13.0

@SyedSaifAli
Copy link

Similar issue is happening with me as well on realm version 10.49.2
Although I am not able to reproduce it

realm::Exception::what() const
EXC_BAD_ACCESS (KERN_PROTECTION_FAILURE)

Below is the log from crashlytics.

Crashed: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out
0  app                          0x8bdac4 realm::Exception::what() const + 5086152
1  app                          0x4672d0 makeError(realm::Exception const&) + 188 (RLMError.mm:188)
2  app                          0x563cc0 RLMRealmTranslateException(NSError* __autoreleasing*) + 170 (RLMRealm.mm:170)
3  app                          0x5660c8 -[RLMRealm beginWriteTransactionWithError:] + 628 (RLMRealm.mm:628)
4  app                          0x36520 +[RealmHelper Write:] + 68 (RealmHelper.m:68)
5  app                          0x67f94 -[NotifManager setLatestReceivedWts:] + 254 (NotifManager.m:254)
6  app                          0x6712c __30-[NotifManager _publishNotif:]_block_invoke + 128 (NotifManager.m:128)
7  app                          0x677e0 __53-[NotifManager filterAndSortNotif:uniqueVehicles:cb:]_block_invoke + 184 (NotifManager.m:184)
8  libdispatch.dylib              0x2248 _dispatch_call_block_and_release + 32
9  libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
10 libdispatch.dylib              0xb5cc _dispatch_lane_serial_drain + 768
11 libdispatch.dylib              0xc158 _dispatch_lane_invoke + 432
12 libdispatch.dylib              0x1738c _dispatch_root_queue_drain_deferred_wlh + 288
13 libdispatch.dylib              0x16bd8 _dispatch_workloop_worker_thread + 540
14 libsystem_pthread.dylib        0x3680 _pthread_wqthread + 288
15 libsystem_pthread.dylib        0x1474 start_wqthread + 8

Any help on how to repro? or guide where to look?

@vpeschenkov
Copy link

I’m having the same issue with Realm (version 10.49.2):

Crashed: com.apple.main-thread
0  Realm                          0x1d9a30 realm::Exception::what() const + 128
1  Realm                          0x35fc4 makeError(realm::FileAccessError const&) + 198 (RLMError.mm:198)
2  Realm                          0x137800 RLMRealmTranslateException(NSError* __autoreleasing*) + 167 (RLMRealm.mm:167)
3  Realm                          0x139304 +[RLMRealm realmWithConfiguration:confinedTo:error:] + 435 (RLMRealm.mm:435)
4  Realm                          0x138398 +[RLMRealm realmWithConfiguration:error:] + 387 (RLMRealm.mm:387)
5  App                            0x3ee78 -[DICacheManager cache] + 141 (DICacheManager.m:141)
6  App                            0x3e624 __31+[DICacheManager sharedManager]_block_invoke + 34 (DICacheManager.m:34)
7  libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
8  libdispatch.dylib              0x57f4 _dispatch_once_callout + 32
9  App                            0x3e5f0 +[DICacheManager sharedManager] + 85 (once.h:85)
10 App                            0x416b0 -[AppDelegate configureSyncManager] + 223 (AppDelegate.m:223)
11 App                            0x40ae4 -[AppDelegate application:willFinishLaunchingWithOptions:] + 76 (AppDelegate.m:76)
12 ???                            0x196453a28 (Missing)
13 ???                            0x196450d64 (Missing)
14 ???                            0x19627264c (Missing)
15 ???                            0x1964241a8 (Missing)
16 ???                            0x196227680 (Missing)
17 ???                            0x1963c7114 (Missing)
18 ???                            0x1963c6e90 (Missing)
19 ???                            0x19618d874 (Missing)
20 ???                            0x19618d594 (Missing)
21 ???                            0x19618d04c (Missing)
22 ???                            0x19618c1f4 (Missing)
23 ???                            0x19618b82c (Missing)
24 ???                            0x19618b4dc (Missing)
25 ???                            0x196227430 (Missing)
26 ???                            0x196226d80 (Missing)
27 ???                            0x19621e7a4 (Missing)
28 ???                            0x196206a94 (Missing)
29 ???                            0x196204fa0 (Missing)
30 FrontBoardServices             0xc00c __95-[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:]_block_invoke + 288
31 FrontBoardServices             0x9834 -[FBSScene _callOutQueue_coalesceClientSettingsUpdates:] + 68
32 FrontBoardServices             0xb794 -[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:] + 436
33 FrontBoardServices             0x1fc94 __93-[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:]_block_invoke.197 + 276
34 FrontBoardServices             0x1f4c8 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168
35 FrontBoardServices             0x2eb90 -[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:] + 468
36 libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
37 libdispatch.dylib              0x79f0 _dispatch_block_invoke_direct + 284
38 FrontBoardServices             0x18378 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52
39 FrontBoardServices             0x182f8 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240
40 FrontBoardServices             0x181d0 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28
41 CoreFoundation                 0x73f3c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
42 CoreFoundation                 0x73ed0 __CFRunLoopDoSource0 + 176
43 CoreFoundation                 0x76b94 __CFRunLoopDoSources0 + 344
44 CoreFoundation                 0x75d2c __CFRunLoopRun + 840
45 CoreFoundation                 0xc8274 CFRunLoopRunSpecific + 588
46 GraphicsServices               0x14c0 GSEventRunModal + 164
47 ???                            0x1963c677c (Missing)
48 ???                            0x195fece64 (Missing)
49 App                            0x1011e8 main + 15 (main.m:15)
50 ???                            0x1b9a54de8 (Missing)

I'm not sure how to reproduce this issue, but I've noticed a significant number of reports in Crashlytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants