realm-swift
realm-swift copied to clipboard
RN App Getting Crashed Randomly
How frequently does the bug occur?
Sometimes
Description
We're using realm swift in our react-native mobile app, and getting below crash in on BugSnag.
runtimeVersions: { "clangVersion": "13.0.0 (clang-1300.0.29.3)", "osBuild": "16H62", "reactNative": "0.66.4", "reactNativeJsEngine": "hermes" }
Stacktrace & log output
CrashReporter Key: 722bbaef3c0b3fc651091ae12563c277632e8a9a
Hardware Model: iPhone7,1
Process: FarEye
Identifier: com.roboticwares.fareye.ios
Version: 37.2.0
Role: Background
OS Version: iOS 12.5.5
SIGABRT:
0 libsystem_kernel.dylib ___pthread_kill
1 libsystem_pthread.dylib _pthread_kill$VARIANT$mp
2 libsystem_c.dylib _abort
3 Realm please_report_this_issue_in_github_realm_realm_core
4 Realm realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)
5 Realm realm::util::terminate_with_info(char const*, char const*, long, char const*, std::initializer_list<realm::util::Printable>&&)
6 Realm void realm::util::terminate_with_info<unsigned long&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(char const*, int, char const*, char const*, unsigned long&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&)
7 Realm realm::SlabAlloc::attach_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::SlabAlloc::Config&)
8 Realm realm::DB::open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, realm::DBOptions)
9 Realm realm::DB::open(realm::Replication&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::DBOptions)
10 Realm realm::DB::create(std::__1::unique_ptr<realm::Replication, std::__1::default_delete<realm::Replication> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::DBOptions)
11 Realm realm::_impl::RealmCoordinator::open_db()
12 Realm realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptr<realm::Realm>&, realm::util::Optional<realm::VersionID>, realm::util::CheckedUniqueLock&)
13 Realm realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>)
14 Realm realm::Realm::get_shared_realm(realm::Realm::Config)
15 Realm +[RLMRealm realmWithConfiguration:queue:error:]
16 Realm +[RLMRealm realmWithConfiguration:error:]
17 Realm +[RLMRealm defaultRealm]
18 Realm +[RLMObject allObjects]
19 FarEye RealmModule.getRealmQuery(tableName:query:sortProperty:reverse:arguments:) (RealmModule.swift:300:59)
20 FarEye closure #1 in closure #1 in RealmModule.findAll(_:query:sortProperty:reverse:limit:arguments:resolve:reject:) (RealmModule.swift:203:36)
21 FarEye thunk for @callee_guaranteed () -> (@error @owned Error) (<compiler-generated>)
22 libswiftObjectiveC.dylib autoreleasepool<A>(invoking:)
23 FarEye closure #1 in RealmModule.findAll(_:query:sortProperty:reverse:limit:arguments:resolve:reject:) (RealmModule.swift:202:13)
24 FarEye thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
25 libdispatch.dylib __dispatch_call_block_and_release
26 libdispatch.dylib __dispatch_client_callout
27 libdispatch.dylib __dispatch_lane_serial_drain$VARIANT$mp
28 libdispatch.dylib __dispatch_lane_invoke$VARIANT$mp
29 libdispatch.dylib __dispatch_workloop_worker_thread
30 libsystem_pthread.dylib __pthread_wqthread
Can you reproduce the bug?
Not yet
Reproduction Steps
No response
Version
10.20.0
What SDK flavour are you using?
Local Database only
Are you using encryption?
Yes, using encryption
Platform OS and version(s)
iOS: 12.5.5, 15.5, 15.4.1
Build environment
Xcode version: 13.0 Dependency manager and version:
- Cocoapods: 1.11.2
- React-Native: 0.66.4
- Hermes Enabled: True
Hi @vikas-singh-fareye Can you provide the exception message for that crash? As you cannot reproduce it at the moment, maybe you can provide a sample code for that?
We've received around 162 instances of this same issue as of now, though we've not witnessed any impact in any functionality, just getting these crash reports in our BugSnag dashboard.

STACKTRACE:
CrashReporter Key: 722bbaef3c0b3fc651091ae12563c277632e8a9a
Hardware Model: iPhone7,1
Process: FarEye
Identifier: com.roboticwares.fareye.ios
Version: 37.2.0
Role: Background
OS Version: iOS 12.5.5
SIGABRT:
0 libsystem_kernel.dylib ___pthread_kill
1 libsystem_pthread.dylib _pthread_kill$VARIANT$mp
2 libsystem_c.dylib _abort
3 Realm please_report_this_issue_in_github_realm_realm_core
4 Realm realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)
5 Realm realm::util::terminate_with_info(char const*, char const*, long, char const*, std::initializer_list<realm::util::Printable>&&)
6 Realm void realm::util::terminate_with_info<unsigned long&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(char const*, int, char const*, char const*, unsigned long&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&)
7 Realm realm::SlabAlloc::attach_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::SlabAlloc::Config&)
8 Realm realm::DB::open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, realm::DBOptions)
9 Realm realm::DB::open(realm::Replication&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::DBOptions)
10 Realm realm::DB::create(std::__1::unique_ptr<realm::Replication, std::__1::default_delete<realm::Replication> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::DBOptions)
11 Realm realm::_impl::RealmCoordinator::open_db()
12 Realm realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptr<realm::Realm>&, realm::util::Optional<realm::VersionID>, realm::util::CheckedUniqueLock&)
13 Realm realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>)
14 Realm realm::Realm::get_shared_realm(realm::Realm::Config)
15 Realm +[RLMRealm realmWithConfiguration:queue:error:]
16 Realm +[RLMRealm realmWithConfiguration:error:]
17 Realm +[RLMRealm defaultRealm]
18 Realm +[RLMObject allObjects]
19 FarEye RealmModule.getRealmQuery(tableName:query:sortProperty:reverse:arguments:) (RealmModule.swift:300:59)
20 FarEye closure #1 in closure #1 in RealmModule.findAll(_:query:sortProperty:reverse:limit:arguments:resolve:reject:) (RealmModule.swift:203:36)
21 FarEye thunk for @callee_guaranteed () -> (@error @owned Error) (<compiler-generated>)
22 libswiftObjectiveC.dylib autoreleasepool<A>(invoking:)
23 FarEye closure #1 in RealmModule.findAll(_:query:sortProperty:reverse:limit:arguments:resolve:reject:) (RealmModule.swift:202:13)
24 FarEye thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
25 libdispatch.dylib __dispatch_call_block_and_release
26 libdispatch.dylib __dispatch_client_callout
27 libdispatch.dylib __dispatch_lane_serial_drain$VARIANT$mp
28 libdispatch.dylib __dispatch_lane_invoke$VARIANT$mp
29 libdispatch.dylib __dispatch_workloop_worker_thread
30 libsystem_pthread.dylib __pthread_wqthread
THREADS:
Thread 0
0 libsystem_kernel.dylib _mach_msg_trap
1 libsystem_kernel.dylib _mach_msg
2 CoreFoundation ___CFRunLoopServiceMachPort
3 CoreFoundation ___CFRunLoopRun
4 CoreFoundation _CFRunLoopRunSpecific
5 GraphicsServices _GSEventRunModal
6 UIKitCore _UIApplicationMain
7 FarEye main (main.m:16:12)
8 libdyld.dylib _start
Thread 1
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 2
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 3
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 4
0 libsystem_kernel.dylib _mach_msg_trap
1 libsystem_kernel.dylib _mach_msg
2 CoreFoundation ___CFRunLoopServiceMachPort
3 CoreFoundation ___CFRunLoopRun
4 CoreFoundation _CFRunLoopRunSpecific
5 Foundation -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Foundation -[NSRunLoop(NSRunLoop) runUntilDate:]
7 UIKitCore -[UIEventFetcher threadMain]
8 Foundation ___NSThread__start__
9 libsystem_pthread.dylib __pthread_body
10 libsystem_pthread.dylib __pthread_start
Thread 5
0 libsystem_kernel.dylib _mach_msg_trap
1 libsystem_kernel.dylib _mach_msg
2 CoreFoundation ___CFRunLoopServiceMachPort
3 CoreFoundation ___CFRunLoopRun
4 CoreFoundation _CFRunLoopRunSpecific
5 FarEye +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:367:12)
6 Foundation ___NSThread__start__
7 libsystem_pthread.dylib __pthread_body
8 libsystem_pthread.dylib __pthread_start
Thread 6
0 FarEye folly::detail::function::FunctionTraits<void (facebook::hermes::debugger::ProgramState const&)>::uninitCall(facebook::hermes::debugger::ProgramState const&, folly::detail::function::Data&) (FarEye)
1 FarEye -[BugsnagStackframe toDictionary] (BugsnagStackframe.m:226:34)
2 FarEye -[BugsnagThread toDictionary] (BugsnagThread.m:81:26)
3 FarEye +[BugsnagThread serializeThreads:] (BugsnagThread.m:93:32)
4 FarEye -[BugsnagEvent toJsonWithRedactedKeys:] (BugsnagEvent.m:548:28)
5 FarEye -[BSGEventUploadOperation runWithDelegate:completionHandler:] (BSGEventUploadOperation.m:92:24)
6 FarEye -[BSGEventUploadOperation start] (BSGEventUploadOperation.m:177:5)
7 Foundation ___NSOQSchedule_f
8 libdispatch.dylib __dispatch_call_block_and_release
9 libdispatch.dylib __dispatch_client_callout
10 libdispatch.dylib __dispatch_continuation_pop$VARIANT$mp
11 libdispatch.dylib __dispatch_async_redirect_invoke
12 libdispatch.dylib __dispatch_root_queue_drain
13 libdispatch.dylib __dispatch_worker_thread2
14 libsystem_pthread.dylib __pthread_wqthread
Thread 7
0 libsystem_kernel.dylib ___psynch_cvwait
1 libsystem_pthread.dylib __pthread_cond_wait$VARIANT$mp
2 libc++.1.dylib std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)
3 hermes facebook::jsi::JSError::~JSError()
4 hermes facebook::jsi::JSError::~JSError()
5 libsystem_pthread.dylib __pthread_body
6 libsystem_pthread.dylib __pthread_start
Thread 8
0 libsystem_kernel.dylib ___psynch_cvwait
1 libsystem_pthread.dylib __pthread_cond_wait$VARIANT$mp
2 libc++.1.dylib std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)
3 FarEye facebook::hermes::inspector::detail::SerialExecutor::runLoop() (__mutex_base:406:9)
4 FarEye _ZNSt3__1L8__invokeIPFvNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_8functionIFvvEEEEJS6_S9_EEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSC_DpOSD_ (type_traits:3694:1)
5 libsystem_pthread.dylib __pthread_body
6 libsystem_pthread.dylib __pthread_start
Thread 9
0 libsystem_kernel.dylib ___psynch_cvwait
1 libsystem_pthread.dylib __pthread_cond_wait$VARIANT$mp
2 libc++.1.dylib std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)
3 FarEye facebook::hermes::inspector::detail::SerialExecutor::runLoop() (__mutex_base:406:9)
4 FarEye _ZNSt3__1L8__invokeIPFvNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_8functionIFvvEEEEJS6_S9_EEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSC_DpOSD_ (type_traits:3694:1)
5 libsystem_pthread.dylib __pthread_body
6 libsystem_pthread.dylib __pthread_start
Thread 10
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 11
0 libsystem_kernel.dylib ___psynch_cvwait
1 libsystem_pthread.dylib __pthread_cond_wait$VARIANT$mp
2 libc++.1.dylib std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)
3 hermes facebook::jsi::JSError::~JSError()
4 hermes facebook::jsi::JSError::~JSError()
5 libsystem_pthread.dylib __pthread_body
6 libsystem_pthread.dylib __pthread_start
Thread 12
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 13
0 libsystem_kernel.dylib _mach_msg_trap
1 libsystem_kernel.dylib _mach_msg
2 libsystem_kernel.dylib _thread_suspend
3 FarEye ksmachexc_i_handleExceptions (BSG_KSCrashSentry_MachException.c:221:9)
4 libsystem_pthread.dylib __pthread_body
5 libsystem_pthread.dylib __pthread_start
Thread 14
0 libsystem_kernel.dylib _mach_msg_trap
1 libsystem_kernel.dylib _mach_msg
2 FarEye ksmachexc_i_handleExceptions (BSG_KSCrashSentry_MachException.c:228:28)
3 libsystem_pthread.dylib __pthread_body
4 libsystem_pthread.dylib __pthread_start
Thread 15
0 libsystem_kernel.dylib ___pthread_kill
1 libsystem_pthread.dylib _pthread_kill$VARIANT$mp
2 libsystem_c.dylib _abort
3 Realm please_report_this_issue_in_github_realm_realm_core
4 Realm realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)
5 Realm realm::util::terminate_with_info(char const*, char const*, long, char const*, std::initializer_list<realm::util::Printable>&&)
6 Realm void realm::util::terminate_with_info<unsigned long&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(char const*, int, char const*, char const*, unsigned long&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&)
7 Realm realm::SlabAlloc::attach_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::SlabAlloc::Config&)
8 Realm realm::DB::open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, realm::DBOptions)
9 Realm realm::DB::open(realm::Replication&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::DBOptions)
10 Realm realm::DB::create(std::__1::unique_ptr<realm::Replication, std::__1::default_delete<realm::Replication> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, realm::DBOptions)
11 Realm realm::_impl::RealmCoordinator::open_db()
12 Realm realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptr<realm::Realm>&, realm::util::Optional<realm::VersionID>, realm::util::CheckedUniqueLock&)
13 Realm realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>)
14 Realm realm::Realm::get_shared_realm(realm::Realm::Config)
15 Realm +[RLMRealm realmWithConfiguration:queue:error:]
16 Realm +[RLMRealm realmWithConfiguration:error:]
17 Realm +[RLMRealm defaultRealm]
18 Realm +[RLMObject allObjects]
19 FarEye RealmModule.getRealmQuery(tableName:query:sortProperty:reverse:arguments:) (RealmModule.swift:300:59)
20 FarEye closure #1 in closure #1 in RealmModule.findAll(_:query:sortProperty:reverse:limit:arguments:resolve:reject:) (RealmModule.swift:203:36)
21 FarEye thunk for @callee_guaranteed () -> (@error @owned Error) (<compiler-generated>)
22 libswiftObjectiveC.dylib autoreleasepool<A>(invoking:)
23 FarEye closure #1 in RealmModule.findAll(_:query:sortProperty:reverse:limit:arguments:resolve:reject:) (RealmModule.swift:202:13)
24 FarEye thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
25 libdispatch.dylib __dispatch_call_block_and_release
26 libdispatch.dylib __dispatch_client_callout
27 libdispatch.dylib __dispatch_lane_serial_drain$VARIANT$mp
28 libdispatch.dylib __dispatch_lane_invoke$VARIANT$mp
29 libdispatch.dylib __dispatch_workloop_worker_thread
30 libsystem_pthread.dylib __pthread_wqthread
Thread 16
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 17
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 18
0 unknown file unknown method
Thread 19
0 libsystem_kernel.dylib _mach_msg_trap
1 libsystem_kernel.dylib _mach_msg
2 CoreFoundation ___CFRunLoopServiceMachPort
3 CoreFoundation ___CFRunLoopRun
4 CoreFoundation _CFRunLoopRunSpecific
5 CoreFoundation _CFRunLoopRun
6 libsystem_pthread.dylib __pthread_body
7 libsystem_pthread.dylib __pthread_start
Thread 20
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 21
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 22
0 libsystem_kernel.dylib ___workq_kernreturn
1 libsystem_pthread.dylib __pthread_wqthread
Thread 23
0 unknown file unknown method
Thread 24
0 unknown file unknown method
Thread 25
0 libsystem_kernel.dylib _mach_msg_trap
1 libsystem_kernel.dylib _mach_msg
2 CoreFoundation ___CFRunLoopServiceMachPort
3 CoreFoundation ___CFRunLoopRun
4 CoreFoundation _CFRunLoopRunSpecific
5 Foundation -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 libAXSpeechManager.dylib -[AXSpeechThread main]
7 Foundation ___NSThread__start__
8 libsystem_pthread.dylib __pthread_body
9 libsystem_pthread.dylib __pthread_start
Thread 26
0 libsystem_kernel.dylib _mach_msg_trap
1 libsystem_kernel.dylib _mach_msg
2 CoreFoundation ___CFRunLoopServiceMachPort
3 CoreFoundation ___CFRunLoopRun
4 CoreFoundation _CFRunLoopRunSpecific
5 AVFAudio GenericRunLoopThread::Entry(void*)
6 AVFAudio CAPThread::Entry(CAPThread*)
7 libsystem_pthread.dylib __pthread_body
8 libsystem_pthread.dylib __pthread_start
@kneth would you have any ideas on this? @vikas-singh-fareye have you checked out our JS SDK which might suit your needs better for React Native?
Hello @leemaguire. We have recently ran into this issue with an old version of Realm. Did you root-cause and fix this problem?