realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.28k stars 2.15k forks source link

RLMClassInfo::propertyForTableColumn crash #4638

Closed kharmabum closed 7 years ago

kharmabum commented 7 years ago

Realm version: v2.2.0 Xcode version: 8.2.1 iOS/OSX version: 10.3

screen shot 2017-02-06 at 1 31 40 am
karagraysen commented 7 years ago

Hi @kharmabum. Thanks for reaching out. Would you be able to provide us with a sample project demonstrating the issue and any other information you can provide? From there, we'll be able to get one of our engineers to look into this.

karagraysen commented 7 years ago

Just bringing attention back to this issue. @kharmabum: Would you be able to provide us with a sample project demonstrating the issue and any other information you can provide? From there, we'll be able to get one of our engineers to look into this. Thanks.

karagraysen commented 7 years ago

Just bringing attention back to this issue. @kharmabum: Would you be able to provide us with a sample project demonstrating the issue and any other information you can provide? From there, we'll be able to get one of our engineers to look into this. Thanks.

jpsim commented 7 years ago

Hey @kharmabum, what makes you think the crash is happening inside RLMClassInfo::propertyForTableColumn()? The screenshot you posted doesn't appear to indicate an exception being thrown or null pointer being dereferenced, or anything else indicating that that function is crashing...

Perhaps another thread was the culprit and you misattributed the main thread as the source of the crash?

In any case, we can't move on this until we get more information from you, as @istx25 has requested.

In the future, invoking bt from the lldb console is much better than screenshots: it can help us textually search for similar issues and will include information that you may have otherwise omitted, which is likely the case here.

kharmabum commented 7 years ago

Sorry for the delay in responses. I've been low on bandwidth the past few weeks.

@jpsim will do in the future, here are a few full stack traces courtesy of sentry: https://gist.github.com/kharmabum/feb5b3a8e7fe405faede857157ca76f6

jpsim commented 7 years ago

@kharmabum thanks for sharing that. I'm re-including it here so it can come up when we search for similar stack traces in the future:

Stack Traces ``` OS Version: iOS 10.2.1 (14D27) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGBUS) Crashed Thread: 0 Application Specific Information: Attempted to dereference garbage pointer 0xb000000000000093. Thread 0 name: Thread 0 Crashed: 0 Realm 0xb0f44c RLMClassInfo::propertyForTableColumn(unsigned long) const (RLMClassInfo.mm:47) 1 Realm 0xb1f3a0 RLMObservationInfo::columnName(unsigned long) const (RLMObservation.mm:104) 2 Realm 0xb1f3a0 RLMObservationInfo::columnName(unsigned long) const (RLMObservation.mm:104) 3 Realm 0xb20b40 RLMDidChange(std::__1::vector > const&, std::__1::vector > const&) (RLMObservation.mm:492) 4 Realm 0xb20b40 forEach<(lambda at /Users/realm/workspace/create_github_release_cocoa/realm-cocoa/Realm/RLMObservation.mm:492:24)> (RLMObservation.mm:418) 5 Realm 0xb20b40 operator() (RLMObservation.mm:493) 6 Realm 0xb8fb14 (anonymous namespace)::RLMNotificationHelper::did_change(std::__1::vector > const&, std::__1::vector > const&, bool) (RLMRealmUtil.mm:116) 7 Realm 0xbb0594 realm::_impl::transaction::advance(realm::SharedGroup&, realm::BindingContext*, realm::_impl::NotifierPackage&) (transact_log_handler.cpp:792) 8 Realm 0xbb0594 TransactLogObserver<(lambda at /Users/realm/workspace/create_github_release_cocoa/realm-cocoa/Realm/ObjectStore/src/impl/transact_log_handler.cpp:792:38)> (transact_log_handler.cpp:227) 9 Realm 0xbb0594 TransactLogObserver<(lambda at /Users/realm/workspace/create_github_release_cocoa/realm-cocoa/Realm/ObjectStore/src/impl/transact_log_handler.cpp:792:38)> (transact_log_handler.cpp:253) 10 Realm 0xaf453c realm::_impl::RealmCoordinator::advance_to_ready(realm::Realm&) (realm_coordinator.cpp:691) 11 Realm 0xbac350 realm::Realm::notify() (shared_realm.cpp:585) 12 Realm 0xbbe6e0 realm::_impl::WeakRealmNotifier::Callback::operator()() const (weak_realm_notifier.cpp:41) 13 Realm 0xbbe6e0 lock (memory:5340) 14 CoreFoundation 0x107ff3b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 15 CoreFoundation 0x107ff34a4 __CFRunLoopDoSources0 16 CoreFoundation 0x107ff10a4 __CFRunLoopRun 17 CoreFoundation 0x107f1f2b8 CFRunLoopRunSpecific 18 GraphicsServices 0x10b484198 GSEventRunModal 19 UIKit 0x113f3c7fc -[UIApplication _run] 20 UIKit 0x113f37534 UIApplicationMain 21 Other Chat 0xa87e0 main (VideoView.swift:81) 22 libdyld.dylib 0x105eea5b8 start Thread 1 name: 0 libsystem_kernel.dylib 0x1060f3a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x106299344 _pthread_wqthread Thread 2 name: 0 libsystem_kernel.dylib 0x1060f3a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x106299344 _pthread_wqthread Thread 3 name: 0 libsystem_kernel.dylib 0x1060f3a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x106299160 _pthread_wqthread Thread 4 name: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x1060d5188 mach_msg_trap 1 libsystem_kernel.dylib 0x1060d4ff8 mach_msg 2 CoreFoundation 0x107ff35d0 __CFRunLoopServiceMachPort 3 CoreFoundation 0x107ff11ec __CFRunLoopRun 4 CoreFoundation 0x107f1f2b8 CFRunLoopRunSpecific 5 Foundation 0x10959626c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 6 Foundation 0x1095b6dd0 -[NSRunLoop(NSRunLoop) runUntilDate:] 7 UIKit 0x1148b0c38 -[UIEventFetcher threadMain] 8 Foundation 0x109693e68 __NSThread__start__ 9 libsystem_pthread.dylib 0x10629b850 _pthread_body 10 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 5 name: 0 libsystem_kernel.dylib 0x1060f3a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x106299344 _pthread_wqthread Thread 6 name: KSCrash Exception Handler (Secondary) 0 libsystem_kernel.dylib 0x1060d5188 mach_msg_trap 1 libsystem_kernel.dylib 0x1060d4ff8 mach_msg 2 KSCrash 0x12d294c handleExceptions (KSCrashMonitor_MachException.c:279) 3 libsystem_pthread.dylib 0x10629b850 _pthread_body 4 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 8 name: RLMRealm notification listener 0 libsystem_kernel.dylib 0x1060d964c kevent 1 Realm 0xadc7c0 realm::_impl::ExternalCommitHelper::listen() (external_commit_helper.cpp:202) 2 Realm 0xadd880 std::__1::__async_func::operator()() (future:2341) 3 Realm 0xadd880 __execute<> (future:2348) 4 Realm 0xadd880 __invoke<(lambda at /Users/realm/workspace/create_github_release_cocoa/realm-cocoa/Realm/ObjectStore/src/impl/apple/external_commit_helper.cpp:157:47)> (__functional_base:416) 5 Realm 0xadd808 std::__1::__async_assoc_state >::__execute() (future:1031) 6 Realm 0xadd9d0 void* std::__1::__thread_proxy >::*)(), std::__1::__async_assoc_state >*> >(void*) (thread:357) 7 Realm 0xadd9d0 __thread_execute >::*)(), std::__1::__async_a... (thread:347) 8 Realm 0xadd9d0 __invoke >::*)(), std::__1::__async_assoc_sta... (__functional_base:383) 9 libsystem_pthread.dylib 0x10629b850 _pthread_body 10 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 9 name: 0 libsystem_kernel.dylib 0x1060f3a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x106299344 _pthread_wqthread Thread 10 name: 0 libsystem_kernel.dylib 0x1060f3a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x106299344 _pthread_wqthread Thread 11 name: AVAudioSession Notify Thread 0 libsystem_kernel.dylib 0x1060d5188 mach_msg_trap 1 libsystem_kernel.dylib 0x1060d4ff8 mach_msg 2 CoreFoundation 0x107ff35d0 __CFRunLoopServiceMachPort 3 CoreFoundation 0x107ff11ec __CFRunLoopRun 4 CoreFoundation 0x107f1f2b8 CFRunLoopRunSpecific 5 AVFAudio 0x13b4bdd24 GenericRunLoopThread::Entry(void*) 6 AVFAudio 0x13b4e3d9c CAPThread::Entry(CAPThread*) 7 libsystem_pthread.dylib 0x10629b850 _pthread_body 8 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 12 name: com.apple.NSURLConnectionLoader 0 libsystem_kernel.dylib 0x1060d5188 mach_msg_trap 1 libsystem_kernel.dylib 0x1060d4ff8 mach_msg 2 CoreFoundation 0x107ff35d0 __CFRunLoopServiceMachPort 3 CoreFoundation 0x107ff11ec __CFRunLoopRun 4 CoreFoundation 0x107f1f2b8 CFRunLoopRunSpecific 5 CFNetwork 0x108e53a70 +[NSURLConnection(Loader) _resourceLoadLoop:] 6 Foundation 0x109693e68 __NSThread__start__ 7 libsystem_pthread.dylib 0x10629b850 _pthread_body 8 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 13 name: com.apple.CFStream.LegacyThread 0 libsystem_kernel.dylib 0x1060d5188 mach_msg_trap 1 libsystem_kernel.dylib 0x1060d4ff8 mach_msg 2 CoreFoundation 0x107ff35d0 __CFRunLoopServiceMachPort 3 CoreFoundation 0x107ff11ec __CFRunLoopRun 4 CoreFoundation 0x107f1f2b8 CFRunLoopRunSpecific 5 CoreFoundation 0x1080010ec _legacyStreamRunLoop_workThread 6 libsystem_pthread.dylib 0x10629b850 _pthread_body 7 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 14 name: 0 libsystem_kernel.dylib 0x1060f3a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x106299344 _pthread_wqthread Thread 15 name: 0 libsystem_kernel.dylib 0x1060f2e1c __psynch_cvwait 1 libsystem_pthread.dylib 0x10629a9c0 _pthread_cond_wait 2 libc++.1.dylib 0x1054e73ec std::__1::condition_variable::wait(std::__1::unique_lock&) 3 JavaScriptCore 0x1108575d0 void std::__1::condition_variable_any::wait >(std::__1::unique_lock&) 4 JavaScriptCore 0x110857544 bmalloc::AsyncTask::threadRunLoop() 5 JavaScriptCore 0x110857424 bmalloc::AsyncTask::threadEntryPoint(bmalloc::AsyncTask*) 6 JavaScriptCore 0x1108576d4 void* std::__1::__thread_proxy*), bmalloc::AsyncTask*> >(void*) 7 libsystem_pthread.dylib 0x10629b850 _pthread_body 8 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 16 name: 0 CoreFoundation 0x10807a034 __CFBasicHashRehash 1 CoreFoundation 0x108079a64 __CFBasicHashRehash 2 CoreFoundation 0x10807ae14 __CFBasicHashAddValue 3 CoreFoundation 0x107f1ab6c CFDictionarySetValue 4 ImageIO 0x10baf3c4c IIOImagePlus::setImageBlockProc(void*, unsigned int, CGImageBlockSet* (*)(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*), __IOSurface* (*)(void*, CGImageProvider*, __CFDictionary const*), CGImageIOSurfaceSet* (*)(void*, CGImageProvider*... 5 ImageIO 0x10bb7ba74 IIOReadPlugin::setupImageProviderCallback_V1(InfoRec*, CGImageBlockSet* (*)(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*)) 6 ImageIO 0x10bc9470c GIFReadPlugin::init() 7 ImageIO 0x10bc96738 GIFReadPlugin::InitProc(CGImagePlugin*, unsigned long, unsigned long) 8 ImageIO 0x10bacdcd0 IIOImageSource::makeImagePlus(unsigned long, __CFDictionary const*) 9 ImageIO 0x10bacef30 IIOImageSource::getPropertiesAtIndexInternal(unsigned long, __CFDictionary const*) 10 ImageIO 0x10baceeb0 IIOImageSource::copyPropertiesAtIndex(unsigned long, __CFDictionary const*) 11 ImageIO 0x10bad1b04 CGImageSourceCopyPropertiesAtIndex 12 Gifu 0x5c3e44 CGImageSource.properties(at : Int) -> [String : Double]? (ImageSourceHelpers.swift:67) 13 Gifu 0x5c4e70 specialized CGImageFrameDuration(with : CGImageSource, atIndex : Int) -> Double (ImageSourceHelpers.swift:14) 14 Gifu 0x5c3848 specialized FrameStore.((setupAnimatedFrames in _B674B76AD677690831D75B061DDD0E33)() -> ()).(closure #1) (FrameStore.swift:244) 15 Gifu 0x5c3848 CGImageFrameDuration 16 Gifu 0x5c3abc specialized FrameStore.(prepareFrames(() -> ()?) -> ()).(closure #1) (FrameStore.swift:100) 17 Gifu 0x5c3abc setupAnimatedFrames (FrameStore.swift:250) 18 Gifu 0x5c3abc specialized Sequence.forEach((A.Iterator.Element) throws -> ()) throws -> () 19 Gifu 0x5c37f4 partial apply for FrameStore.(prepareFrames(() -> ()?) -> ()).(closure #1) 20 libdispatch.dylib 0x105e871fc _dispatch_call_block_and_release 21 libdispatch.dylib 0x105e871bc _dispatch_client_callout 22 libdispatch.dylib 0x105e953dc _dispatch_queue_serial_drain 23 libdispatch.dylib 0x105e8a9a4 _dispatch_queue_invoke 24 libdispatch.dylib 0x105e958d8 _dispatch_queue_override_invoke 25 libdispatch.dylib 0x105e9734c _dispatch_root_queue_drain 26 libdispatch.dylib 0x105e970ac _dispatch_worker_thread3 27 libsystem_pthread.dylib 0x1062992a0 _pthread_wqthread Thread 17 name: 0 libsystem_kernel.dylib 0x1060f3a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x106299344 _pthread_wqthread Thread 18 name: com.apple.CFSocket.private 0 libsystem_kernel.dylib 0x1060f323c __select 1 CoreFoundation 0x107ffa468 __CFSocketManager 2 libsystem_pthread.dylib 0x10629b850 _pthread_body 3 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 19 name: JIT Worklist Worker Thread 0 libsystem_kernel.dylib 0x1060f2e1c __psynch_cvwait 1 libsystem_pthread.dylib 0x10629a9c0 _pthread_cond_wait 2 libc++.1.dylib 0x1054e73ec std::__1::condition_variable::wait(std::__1::unique_lock&) 3 JavaScriptCore 0x11083fd64 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, std::__1::chrono::time_point... 4 JavaScriptCore 0x110617a5c JSC::JITWorklist::runThread() 5 JavaScriptCore 0x110617eac std::__1::__function::__func, void ()>::operator()() 6 JavaScriptCore 0x10ff8800c WTF::threadEntryPoint(void*) 7 JavaScriptCore 0x10ff87f1c WTF::wtfThreadEntryPoint(void*) 8 libsystem_pthread.dylib 0x10629b850 _pthread_body 9 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 20 name: WTF Parallel Helper Thread 0 libsystem_kernel.dylib 0x1060f2e1c __psynch_cvwait 1 libsystem_pthread.dylib 0x10629a9c0 _pthread_cond_wait 2 libc++.1.dylib 0x1054e73ec std::__1::condition_variable::wait(std::__1::unique_lock&) 3 JavaScriptCore 0x11083fd64 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, std::__1::chrono::time_point... 4 JavaScriptCore 0x11083f2e8 WTF::ParallelHelperPool::waitForClientWithTask(WTF::Locker const&) 5 JavaScriptCore 0x11083f088 WTF::ParallelHelperPool::helperThreadBody() 6 JavaScriptCore 0x10ff8800c WTF::threadEntryPoint(void*) 7 JavaScriptCore 0x10ff87f1c WTF::wtfThreadEntryPoint(void*) 8 libsystem_pthread.dylib 0x10629b850 _pthread_body 9 libsystem_pthread.dylib 0x10629b760 _pthread_start Thread 21 name: 0 libsystem_kernel.dylib 0x1060f3a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x106299344 _pthread_wqthread EOF OS Version: iOS 10.2.1 (14D27) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGBUS) Crashed Thread: 0 Application Specific Information: Attempted to dereference garbage pointer 0x4b. Thread 0 name: Thread 0 Crashed: 0 Realm 0xee4de8 RLMClassInfo::propertyForTableColumn(unsigned long) const (RLMClassInfo.mm:48) 1 Realm 0xef4d38 RLMObservationInfo::columnName(unsigned long) const (RLMObservation.mm:104) 2 Realm 0xef4d38 RLMObservationInfo::columnName(unsigned long) const (RLMObservation.mm:104) 3 Realm 0xef64d8 RLMDidChange(std::__1::vector > const&, std::__1::vector > const&) (RLMObservation.mm:492) 4 Realm 0xef64d8 void (anonymous namespace)::forEach > const&, std::__1::vector > const&)::$_7>(realm::BindingContext::ObserverState const&, RLMDidChange(std::__1::vector > const&, std::__1::vector > const&)::$_7&&) (RLMObservation.mm:418) 5 Realm 0xef64d8 _ZZ12RLMDidChangeRKNSt3__16vectorIN5realm14BindingContext13ObserverStateENS_9allocatorIS3_EEEERKNS0_IPvNS4_IS9_EEEEENK3$_7clINS2_10ColumnInfoEEEDamRKT_P18RLMObservationInfo (RLMObservation.mm:493) 6 Realm 0xf654b0 (anonymous namespace)::RLMNotificationHelper::did_change(std::__1::vector > const&, std::__1::vector > const&, bool) (RLMRealmUtil.mm:116) 7 Realm 0xf85f30 realm::_impl::transaction::advance(realm::SharedGroup&, realm::BindingContext*, realm::_impl::NotifierPackage&) (transact_log_handler.cpp:792) 8 Realm 0xf85f30 (anonymous namespace)::TransactLogObserver::TransactLogObserver(realm::BindingContext*, realm::SharedGroup&, realm::_impl::transaction::advance(realm::SharedGroup&, realm::BindingContext*, realm::_impl::NotifierPackage&)::$_1&&, realm::_impl::NotifierPackage&, bool) (transact_log_handler.cpp:227) 9 Realm 0xf85f30 (anonymous namespace)::TransactLogObserver::TransactLogObserver(realm::BindingContext*, realm::SharedGroup&, realm::_impl::transaction::advance(realm::SharedGroup&, realm::BindingContext*, realm::_impl::NotifierPackage&)::$_1&&, realm::_impl::NotifierPackage&, bool) (transact_log_handler.cpp:253) 10 Realm 0xec9ed4 realm::_impl::RealmCoordinator::advance_to_ready(realm::Realm&) (realm_coordinator.cpp:691) 11 Realm 0xf81cec realm::Realm::notify() (shared_realm.cpp:585) 12 Realm 0xf9407c realm::_impl::WeakRealmNotifier::Callback::operator()() const (weak_realm_notifier.cpp:41) 13 Realm 0xf9407c std::__1::weak_ptr::lock() const (memory:5340) 14 CoreFoundation 0x113a6fb5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 15 CoreFoundation 0x113a6f4a4 __CFRunLoopDoSources0 16 CoreFoundation 0x113a6d0a4 __CFRunLoopRun 17 CoreFoundation 0x11399b2b8 CFRunLoopRunSpecific 18 GraphicsServices 0x116f00198 GSEventRunModal 19 UIKit 0x11f9b87fc -[UIApplication _run] 20 UIKit 0x11f9b3534 UIApplicationMain 21 Other Chat 0xd87e0 main (AppDelegate.swift:81) 22 libdyld.dylib 0x1119665b8 Thread 1 name: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x111b51188 mach_msg_trap 1 libsystem_kernel.dylib 0x111b50ff8 mach_msg 2 CoreFoundation 0x113a6f5d0 __CFRunLoopServiceMachPort 3 CoreFoundation 0x113a6d1ec __CFRunLoopRun 4 CoreFoundation 0x11399b2b8 CFRunLoopRunSpecific 5 Foundation 0x11501226c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 6 Foundation 0x115032dd0 -[NSRunLoop(NSRunLoop) runUntilDate:] 7 UIKit 0x12032cc38 -[UIEventFetcher threadMain] 8 Foundation 0x11510fe68 __NSThread__start__ 9 libsystem_pthread.dylib 0x111d17850 10 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 2 name: KSCrash Exception Handler (Secondary) 0 libsystem_kernel.dylib 0x111b51188 mach_msg_trap 1 libsystem_kernel.dylib 0x111b50ff8 mach_msg 2 KSCrash 0x1ac694c handleExceptions (KSCrashMonitor_MachException.c:279) 3 libsystem_pthread.dylib 0x111d17850 4 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 4 name: RLMRealm notification listener 0 libsystem_kernel.dylib 0x111b5564c kevent 1 Realm 0xeb2158 realm::_impl::ExternalCommitHelper::listen() (external_commit_helper.cpp:202) 2 Realm 0xeb3218 std::__1::__async_func::operator()() (future:2341) 3 Realm 0xeb3218 void std::__1::__async_func::__execute<>(std::__1::__tuple_indices<>) (future:2348) 4 Realm 0xeb3218 _ZNSt3__18__invokeIZN5realm5_impl20ExternalCommitHelperC1ERNS2_16RealmCoordinatorEE3$_0JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS7_DpOS8_ (__functional_base:416) 5 Realm 0xeb31a0 std::__1::__async_assoc_state >::__execute() (future:1031) 6 Realm 0xeb3368 void* std::__1::__thread_proxy >::*)(), std::__1::__async_assoc_state >*> >(void*) (thread:357) 7 Realm 0xeb3368 void std::__1::__thread_execute >::*)(), std::__1::__async_assoc_state >*, 1ul>(std::__1::tuple >::*)(), std::__1::__async_assoc_state >*>&, std::__1::__tuple_indices<1ul>) (thread:347) 8 Realm 0xeb3368 _ZNSt3__18__invokeIMNS_19__async_assoc_stateIvNS_12__async_funcIZN5realm5_impl20ExternalCommitHelperC1ERNS4_16RealmCoordinatorEE3$_0JEEEEEFvvEPSA_JEvEEDTcldsdeclsr3std3__1E7forwardIT0_Efp0_Efp_spclsr3std3__1E7forwardIT1_Efp1_EEEOT_OSE_DpOSF_ (__functional_base:383) 9 libsystem_pthread.dylib 0x111d17850 10 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 5 name: AVAudioSession Notify Thread 0 libsystem_kernel.dylib 0x111b51188 mach_msg_trap 1 libsystem_kernel.dylib 0x111b50ff8 mach_msg 2 CoreFoundation 0x113a6f5d0 __CFRunLoopServiceMachPort 3 CoreFoundation 0x113a6d1ec __CFRunLoopRun 4 CoreFoundation 0x11399b2b8 CFRunLoopRunSpecific 5 AVFAudio 0x1470f9d24 GenericRunLoopThread::Entry(void*) 6 AVFAudio 0x14711fd9c CAPThread::Entry(CAPThread*) 7 libsystem_pthread.dylib 0x111d17850 8 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 6 name: com.apple.NSURLConnectionLoader 0 libsystem_kernel.dylib 0x111b51188 mach_msg_trap 1 libsystem_kernel.dylib 0x111b50ff8 mach_msg 2 CoreFoundation 0x113a6f5d0 __CFRunLoopServiceMachPort 3 CoreFoundation 0x113a6d1ec __CFRunLoopRun 4 CoreFoundation 0x11399b2b8 CFRunLoopRunSpecific 5 CFNetwork 0x1148cfa70 6 Foundation 0x11510fe68 __NSThread__start__ 7 libsystem_pthread.dylib 0x111d17850 8 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 7 name: com.apple.CFStream.LegacyThread 0 libsystem_kernel.dylib 0x111b51188 mach_msg_trap 1 libsystem_kernel.dylib 0x111b50ff8 mach_msg 2 CoreFoundation 0x113a6f5d0 __CFRunLoopServiceMachPort 3 CoreFoundation 0x113a6d1ec __CFRunLoopRun 4 CoreFoundation 0x11399b2b8 CFRunLoopRunSpecific 5 CoreFoundation 0x113a7d0ec _legacyStreamRunLoop_workThread 6 libsystem_pthread.dylib 0x111d17850 7 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 8 name: com.apple.CFSocket.private 0 libsystem_kernel.dylib 0x111b6f23c select$DARWIN_EXTSN 1 CoreFoundation 0x113a76468 __CFSocketManager 2 libsystem_pthread.dylib 0x111d17850 3 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 9 name: 0 libsystem_kernel.dylib 0x111b6ee1c __psynch_cvwait 1 libsystem_pthread.dylib 0x111d169c0 2 libc++.1.dylib 0x110f633ec std::__1::condition_variable::wait(std::__1::unique_lock&) 3 JavaScriptCore 0x11c2d35d0 4 JavaScriptCore 0x11c2d3544 5 JavaScriptCore 0x11c2d3424 6 JavaScriptCore 0x11c2d36d4 7 libsystem_pthread.dylib 0x111d17850 8 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 10 name: JIT Worklist Worker Thread 0 libsystem_kernel.dylib 0x111b6ee1c __psynch_cvwait 1 libsystem_pthread.dylib 0x111d169c0 2 libc++.1.dylib 0x110f633ec std::__1::condition_variable::wait(std::__1::unique_lock&) 3 JavaScriptCore 0x11c2bbd64 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, std::__1::chrono::time_point... 4 JavaScriptCore 0x11c093a5c 5 JavaScriptCore 0x11c093eac 6 JavaScriptCore 0x11ba0400c 7 JavaScriptCore 0x11ba03f1c 8 libsystem_pthread.dylib 0x111d17850 9 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 11 name: WTF Parallel Helper Thread 0 libsystem_kernel.dylib 0x111b6ee1c __psynch_cvwait 1 libsystem_pthread.dylib 0x111d169c0 2 libc++.1.dylib 0x110f633ec std::__1::condition_variable::wait(std::__1::unique_lock&) 3 JavaScriptCore 0x11c2bbd64 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, std::__1::chrono::time_point... 4 JavaScriptCore 0x11c2bb2e8 5 JavaScriptCore 0x11c2bb088 6 JavaScriptCore 0x11ba0400c 7 JavaScriptCore 0x11ba03f1c 8 libsystem_pthread.dylib 0x111d17850 9 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 12 name: 0 libsystem_kernel.dylib 0x111b511dc semaphore_timedwait_trap 1 libdispatch.dylib 0x111915770 _dispatch_semaphore_wait_slow 2 libdispatch.dylib 0x111914808 _dispatch_worker_thread 3 libsystem_pthread.dylib 0x111d17850 4 libsystem_pthread.dylib 0x111d17760 _pthread_start Thread 13 name: 0 libsystem_kernel.dylib 0x111b6fa88 __workq_kernreturn 1 libsystem_pthread.dylib 0x111d15344 _pthread_wqthread Thread 14 name: 0 libsystem_kernel.dylib 0x111b6fa88 __workq_kernreturn 1 libsystem_pthread.dylib 0x111d15344 _pthread_wqthread Thread 15 name: 0 libsystem_kernel.dylib 0x111b6fa88 __workq_kernreturn 1 libsystem_pthread.dylib 0x111d15344 _pthread_wqthread Thread 16 name: 0 libsystem_kernel.dylib 0x111b6fa88 __workq_kernreturn 1 libsystem_pthread.dylib 0x111d15344 _pthread_wqthread Thread 17 name: 0 libsystem_pthread.dylib 0x111d14d88 pthread_workqueue_addthreads_np Thread 18 name: 0 libsystem_kernel.dylib 0x111b6fa88 __workq_kernreturn 1 libsystem_pthread.dylib 0x111d15344 _pthread_wqthread Thread 19 name: 0 libsystem_kernel.dylib 0x111b6fa88 __workq_kernreturn 1 libsystem_pthread.dylib 0x111d15160 _pthread_wqthread Thread 20 name: 0 libsystem_kernel.dylib 0x111b51188 mach_msg_trap 1 libsystem_kernel.dylib 0x111b50ff8 mach_msg 2 MediaToolbox 0x121986f24 3 MediaToolbox 0x1219869b8 4 MediaToolbox 0x121abcb0c 5 MediaToolbox 0x121a5d688 6 MediaToolbox 0x121a5dfa0 7 libdispatch.dylib 0x1119031bc _dispatch_client_callout 8 libdispatch.dylib 0x1119113dc _dispatch_queue_serial_drain 9 libdispatch.dylib 0x1119069a4 _dispatch_queue_invoke 10 libdispatch.dylib 0x1119118d8 _dispatch_queue_override_invoke 11 libdispatch.dylib 0x11191334c _dispatch_root_queue_drain 12 libdispatch.dylib 0x1119130ac _dispatch_worker_thread3 13 libsystem_pthread.dylib 0x111d152a0 _pthread_wqthread EOF Download OS Version: iOS 10.2 (14C92) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGBUS) Crashed Thread: 0 Application Specific Information: Attempted to dereference garbage pointer 0x10. Thread 0 name: Thread 0 Crashed: 0 Realm 0xee8de4 RLMClassInfo::propertyForTableColumn(unsigned long) const (RLMClassInfo.mm:48) 1 Realm 0xef8d38 RLMObservationInfo::columnName(unsigned long) const (RLMObservation.mm:104) 2 Realm 0xef8d38 RLMObservationInfo::columnName(unsigned long) const (RLMObservation.mm:104) 3 Realm 0xefa4d8 RLMDidChange(std::__1::vector > const&, std::__1::vector > const&) (RLMObservation.mm:493) 4 Realm 0xf694b0 (anonymous namespace)::RLMNotificationHelper::did_change(std::__1::vector > const&, std::__1::vector > const&, bool) (RLMRealmUtil.mm:116) 5 Realm 0xf89f30 realm::_impl::transaction::advance(realm::SharedGroup&, realm::BindingContext*, realm::_impl::NotifierPackage&) (transact_log_handler.cpp:254) 6 Realm 0xecded4 realm::_impl::RealmCoordinator::advance_to_ready(realm::Realm&) (realm_coordinator.cpp:691) 7 Realm 0xf85cec realm::Realm::notify() (shared_realm.cpp:585) 8 Realm 0xf9807c realm::_impl::WeakRealmNotifier::Callback::operator()() const (memory:4593) 9 CoreFoundation 0x10df07b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 10 CoreFoundation 0x10df074a4 __CFRunLoopDoSources0 11 CoreFoundation 0x10df050a4 __CFRunLoopRun 12 CoreFoundation 0x10de332b8 CFRunLoopRunSpecific 13 GraphicsServices 0x111398198 GSEventRunModal 14 UIKit 0x119e507fc -[UIApplication _run] 15 UIKit 0x119e4b534 UIApplicationMain 16 Other Chat 0xec7e0 main (AppDelegate.swift:81) 17 libdyld.dylib 0x10bdfe5b8 start Thread 1 name: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x10bfe9188 mach_msg_trap 1 libsystem_kernel.dylib 0x10bfe8ff8 mach_msg 2 CoreFoundation 0x10df075d0 __CFRunLoopServiceMachPort 3 CoreFoundation 0x10df051ec __CFRunLoopRun 4 CoreFoundation 0x10de332b8 CFRunLoopRunSpecific 5 Foundation 0x10f4aa26c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 6 Foundation 0x10f4cadd0 -[NSRunLoop(NSRunLoop) runUntilDate:] 7 UIKit 0x11a7c4c38 -[UIEventFetcher threadMain] 8 Foundation 0x10f5a7e68 __NSThread__start__ 9 libsystem_pthread.dylib 0x10c1af850 _pthread_body 10 libsystem_pthread.dylib 0x10c1af760 _pthread_body Thread 2 name: KSCrash Exception Handler (Secondary) 0 libsystem_kernel.dylib 0x10bfe9188 mach_msg_trap 1 libsystem_kernel.dylib 0x10bfe8ff8 mach_msg 2 KSCrash 0x1aca94c handleExceptions (KSCrashMonitor_MachException.c:279) 3 libsystem_pthread.dylib 0x10c1af850 _pthread_body 4 libsystem_pthread.dylib 0x10c1af760 _pthread_body Thread 4 name: RLMRealm notification listener 0 libsystem_kernel.dylib 0x10bfed64c kevent 1 Realm 0xeb6158 realm::_impl::ExternalCommitHelper::listen() (external_commit_helper.cpp:202) 2 Realm 0xeb7218 std::__1::__async_func::operator()() (future:2341) 3 Realm 0xeb71a0 std::__1::__async_assoc_state >::__execute() (future:1032) 4 Realm 0xeb7368 void* std::__1::__thread_proxy >::*)(), std::__1::__async_assoc_state&) 3 JavaScriptCore 0x11676b5b0 void std::__1::condition_variable_any::wait >(std::__1::unique_lock&) 4 JavaScriptCore 0x11676b524 bmalloc::AsyncTask::threadRunLoop() 5 JavaScriptCore 0x11676b404 std::__1::__shared_ptr_emplace >::~__shared_ptr_emplace() 6 JavaScriptCore 0x11676b6b4 void* std::__1::__thread_proxy*), bmalloc::AsyncTask*> >(void*) 7 libsystem_pthread.dylib 0x10c1af850 _pthread_body 8 libsystem_pthread.dylib 0x10c1af760 _pthread_body Thread 10 name: JIT Worklist Worker Thread 0 libsystem_kernel.dylib 0x10c006e1c __psynch_cvwait 1 libsystem_pthread.dylib 0x10c1ae9c0 _pthread_cond_wait 2 libc++.1.dylib 0x10b3fb3ec std::__1::condition_variable::wait(std::__1::unique_lock&) 3 JavaScriptCore 0x116753d44 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, std::__1::chrono::time_point... 4 JavaScriptCore 0x11652ba38 JSC::JITWorklist::runThread() 5 JavaScriptCore 0x11652be88 WTF::Vector, 32ul, WTF::CrashOnOverflow, 16ul>::expandCapacity(unsigned long, WTF::RefPtr*) 6 JavaScriptCore 0x115e9c09c WTF::threadEntryPoint(void*) 7 JavaScriptCore 0x115e9bfac WTF::wtfThreadEntryPoint(void*) 8 libsystem_pthread.dylib 0x10c1af850 _pthread_body 9 libsystem_pthread.dylib 0x10c1af760 _pthread_body Thread 11 name: WTF Parallel Helper Thread 0 libsystem_kernel.dylib 0x10c006e1c __psynch_cvwait 1 libsystem_pthread.dylib 0x10c1ae9c0 _pthread_cond_wait 2 libc++.1.dylib 0x10b3fb3ec std::__1::condition_variable::wait(std::__1::unique_lock&) 3 JavaScriptCore 0x116753d44 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda const&, WTF::ScopedLambda const&, std::__1::chrono::time_point... 4 JavaScriptCore 0x1167532c8 WTF::ParallelHelperPool::waitForClientWithTask(WTF::Locker const&) 5 JavaScriptCore 0x116753068 WTF::ParallelHelperPool::helperThreadBody() 6 JavaScriptCore 0x115e9c09c WTF::threadEntryPoint(void*) 7 JavaScriptCore 0x115e9bfac WTF::wtfThreadEntryPoint(void*) 8 libsystem_pthread.dylib 0x10c1af850 _pthread_body 9 libsystem_pthread.dylib 0x10c1af760 _pthread_body Thread 12 name: 0 libsystem_kernel.dylib 0x10c007a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x10c1ad344 _pthread_wqthread Thread 13 name: 0 libsystem_pthread.dylib 0x10c1acd88 start_wqthread Thread 14 name: 0 libsystem_pthread.dylib 0x10c1acd88 start_wqthread Thread 15 name: 0 libsystem_kernel.dylib 0x10c007a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x10c1ad160 _pthread_wqthread Thread 16 name: 0 libsystem_kernel.dylib 0x10c007a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x10c1ad344 _pthread_wqthread Thread 17 name: 0 libsystem_kernel.dylib 0x10c007a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x10c1ad344 _pthread_wqthread Thread 18 name: 0 libsystem_kernel.dylib 0x10bfe91dc semaphore_timedwait_trap 1 libdispatch.dylib 0x10bdad770 _dispatch_semaphore_wait_slow 2 libdispatch.dylib 0x10bdac808 _dispatch_worker_thread 3 libsystem_pthread.dylib 0x10c1af850 _pthread_body 4 libsystem_pthread.dylib 0x10c1af760 _pthread_body Thread 19 name: 0 libsystem_kernel.dylib 0x10bfe9188 mach_msg_trap 1 libsystem_kernel.dylib 0x10bfe8ff8 mach_msg 2 MediaToolbox 0x11be1ef24 FigPlayerRemoteClient_SetPlayerPropertyFixedSize 3 MediaToolbox 0x11be1e9b8 playerremote_SetProperty 4 MediaToolbox 0x11bf54b0c playerremote_SetRateWithOptions 5 MediaToolbox 0x11bef5688 playerasync_runOneCommand 6 MediaToolbox 0x11bef5fa0 playerasync_runAsynchronousCommandOnQueue 7 libdispatch.dylib 0x10bd9b1bc _dispatch_client_callout 8 libdispatch.dylib 0x10bda93dc _dispatch_queue_serial_drain 9 libdispatch.dylib 0x10bd9e9a4 _dispatch_queue_invoke 10 libdispatch.dylib 0x10bda98d8 _dispatch_queue_override_invoke 11 libdispatch.dylib 0x10bdab34c _dispatch_root_queue_drain 12 libdispatch.dylib 0x10bdab0ac _dispatch_worker_thread3 13 libsystem_pthread.dylib 0x10c1ad2a0 _pthread_wqthread Thread 20 name: 0 libsystem_kernel.dylib 0x10bfe9188 mach_msg_trap 1 libsystem_kernel.dylib 0x10bfe8ff8 mach_msg 2 MediaToolbox 0x11be1ef24 FigPlayerRemoteClient_SetPlayerPropertyFixedSize 3 MediaToolbox 0x11be1e9b8 playerremote_SetProperty 4 MediaToolbox 0x11bf54b0c playerremote_SetRateWithOptions 5 MediaToolbox 0x11bef5688 playerasync_runOneCommand 6 MediaToolbox 0x11bef5fa0 playerasync_runAsynchronousCommandOnQueue 7 libdispatch.dylib 0x10bd9b1bc _dispatch_client_callout 8 libdispatch.dylib 0x10bda93dc _dispatch_queue_serial_drain 9 libdispatch.dylib 0x10bd9e9a4 _dispatch_queue_invoke 10 libdispatch.dylib 0x10bda98d8 _dispatch_queue_override_invoke 11 libdispatch.dylib 0x10bdab34c _dispatch_root_queue_drain 12 libdispatch.dylib 0x10bdab0ac _dispatch_worker_thread3 13 libsystem_pthread.dylib 0x10c1ad2a0 _pthread_wqthread Thread 21 name: 0 libsystem_kernel.dylib 0x10c007a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x10c1ad344 _pthread_wqthread Thread 22 name: 0 libsystem_kernel.dylib 0x10c007a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x10c1ad344 _pthread_wqthread Thread 23 name: 0 libsystem_kernel.dylib 0x10c007a88 __workq_kernreturn 1 libsystem_pthread.dylib 0x10c1ad344 _pthread_wqthread EOF ```

@kharmabum could you please post the full model definitions that are being observed? If you could also share the notification block code, that'd be helpful.

karagraysen commented 7 years ago

Hi @kharmabum. Just echoing @jpsim's request. Would you please post the full model definitions that are being observed? As well as the notification block code too (if possible). Thanks!

jpsim commented 7 years ago

@kharmabum are you still seeing this with the current master branch? Thanks!

kharmabum commented 7 years ago

@jpsim I have not. Both this crash and another crash I reported via email (trace included below) have ceased since I made a few changes:

(1) Avoid frequently removing and immediately re-adding a KVO observer (I was doing this a lot) (2) Instead of deleting all objects in a realm (this is usually the point at which the crash would surface) I am deleting the entire realm file

Even if I removed all observers prior to deleting all objects I would encounter this crash.

Stack trace for the other possibly relevant crash:

/Users/realm/workspace/create_github_release_cocoa/realm-cocoa/Realm/ObjectStore/src/impl/transact_log_handler.cpp:147: [realm-core-2.3.0] Assertion failed: list.col < list.observer->changes.size()
0   Realm                               0x0000000103b68898 _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 40
1   Realm                               0x0000000103b68b9a _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 506
2   Realm                               0x0000000103af3d7c _ZN12_GLOBAL__N_122KVOTransactLogObserver14parse_completeEv + 1512
3   Realm                               0x0000000103af2ab6 _ZN5realm11SharedGroup15do_advance_readIN12_GLOBAL__N_122KVOTransactLogObserverEEEbPT_NS_9VersionIDERNS_5_impl7HistoryE + 388
4   Realm                               0x0000000103ae97ba _ZN5realm5_impl11transaction7advanceERNS_11SharedGroupEPNS_14BindingContextERNS0_15NotifierPackageE + 422
5   Realm                               0x0000000103a1a005 _ZN5realm5_impl16RealmCoordinator16advance_to_readyERNS_5RealmE + 271
6   Realm                               0x0000000103ae5e4f _ZN5realm5Realm6notifyEv + 189
7   Realm                               0x0000000103af8653 _ZNK5realm5_impl17WeakRealmNotifier8CallbackclEv + 45
8   CoreFoundation                      0x0000000106fd0761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
9   CoreFoundation                      0x0000000106fb598c __CFRunLoopDoSources0 + 556
10  CoreFoundation                      0x0000000106fb4e76 __CFRunLoopRun + 918
11  CoreFoundation                      0x0000000106fb4884 CFRunLoopRunSpecific + 420
12  GraphicsServices                    0x000000010b835a6f GSEventRunModal + 161
13  UIKit                               0x0000000104993c68 UIApplicationMain + 159
14  Other Chat                          0x0000000100f346df main + 111
15  libdyld.dylib                       0x000000010c1b068d start + 1
16  ???                                 0x0000000000000001 0x0 + 1
IMPORTANT: if you see this error, please send this log to help@realm.io
jpsim commented 7 years ago

That last stack trace could be relevant. We appear to be tracking a similar crash in #4694. Any chance you can share more about that? Thanks!

kharmabum commented 7 years ago

@jpsim looking around, can't find anything, but will keep an eye out.

TimOliver commented 7 years ago

Hi @kharmabum! I'm just doing a pass of some of our older issues and am wondering if it's worth closing this issue at this point. Have you seen anything since your last post?

kharmabum commented 7 years ago

Feel free to close. Will reopen if I see it again.