Skip to content

Firestore addSnapshotListener problems with address sanitizer  #8612

Closed
@girishw

Description

@girishw

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.5.1
  • Firebase SDK version: 8.6.1
  • Installation method: CocoaPods
  • Firebase Component: FireStore

`### [REQUIRED] Step 2: Describe the problem

When I turn on address sanitizer for my builds, I see the following crash with my calls to addSnapshotListener()

# *==45737==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d0002d1f08 at pc 0x00010f90ef45 bp 0x70000aed3510 sp 0x70000aed3508*
*READ of size 4 at 0x61d0002d1f08 thread T3*
*    #0 0x10f90ef44 in firebase::firestore::model::MutableDocument::is_found_document() const mutable_document.h:191*
*    #1 0x10f70ea59 in firebase::firestore::local::LevelDbRemoteDocumentCache::GetAllExisting(firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) leveldb_remote_document_cache.cc:178*
*    #2 0x10f7101ac in firebase::firestore::local::LevelDbRemoteDocumentCache::GetMatching(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) leveldb_remote_document_cache.cc:222*
*    #3 0x10f75d73c in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingCollectionQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:146*
*    #4 0x10f75c7cb in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:102*
*    #5 0x10f8d412a in firebase::firestore::local::QueryEngine::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&, firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) query_engine.cc:77*
*    #6 0x10f7b75b7 in std::__1::__function::__func<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’(), std::__1::allocator<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’()>, void ()>::operator()() functional:1727*
*    #7 0x10f705083 in firebase::firestore::local::LevelDbPersistence::RunInternal(absl::lts_2020_02_25::string_view, std::__1::function<void ()>) leveldb_persistence.cc:264*
*    #8 0x10f783105 in firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool) local_store.cc:473*
*    #9 0x10f9ba0af in firebase::firestore::core::SyncEngine::InitializeViewAndComputeSnapshot(firebase::firestore::core::Query const&, int) sync_engine.cc:127*
*    #10 0x10f9b95e8 in firebase::firestore::core::SyncEngine::Listen(firebase::firestore::core::Query) sync_engine.cc:113*
*    #11 0x10f4f871c in firebase::firestore::core::EventManager::AddQueryListener(std::__1::shared_ptr<firebase::firestore::core::QueryListener>) event_manager.cc:60*
*    #12 0x10f5ba4c6 in std::__1::__function::__func<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10, std::__1::allocator<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10>, void ()>::operator()() functional:1727*
*    #13 0x10f3d2f80 in firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) async_queue.cc:89*
*    #14 0x10fa296a3 in firebase::firestore::util::Task::ExecuteAndRelease() task.cc:102*
*    #15 0x10e0e2821 in asan_dispatch_call_block_and_release+0xf1 (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x3f821)*
*    #16 0x1136b174d in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x474d)*
*    #17 0x1136b7f99 in _dispatch_lane_serial_drain+0x31b (libdispatch.dylib:x86_64+0xaf99)*
*    #18 0x1136b8c66 in _dispatch_lane_invoke+0x1b3 (libdispatch.dylib:x86_64+0xbc66)*
*    #19 0x1136c4a79 in _dispatch_workloop_worker_thread+0x367 (libdispatch.dylib:x86_64+0x17a79)*
*    #20 0x7fff6034045c in _pthread_wqthread+0x139 (libsystem_pthread.dylib:x86_64+0x345c)*
*    #21 0x7fff6033f42e in start_wqthread+0xe (libsystem_pthread.dylib:x86_64+0x242e)*

*0x61d0002d1f08 is located 136 bytes inside of 2032-byte region [0x61d0002d1e80,0x61d0002d2670)*
*freed by thread T3 here:*
*    #0 0x10e0f165d in wrap__ZdlPv+0x7d (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x4e65d)*
*    #1 0x10f7cf79a in firebase::firestore::immutable::impl::ArraySortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >::operator=(firebase::firestore::immutable::impl::ArraySortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >&&) array_sorted_map.h:124*
*    #2 0x10f787549 in firebase::firestore::immutable::SortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >::operator=(firebase::firestore::immutable::SortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >&&) sorted_map.h:130*
*    #3 0x10f70ea92 in firebase::firestore::local::LevelDbRemoteDocumentCache::GetAllExisting(firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) leveldb_remote_document_cache.cc:179*
*    #4 0x10f7101ac in firebase::firestore::local::LevelDbRemoteDocumentCache::GetMatching(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) leveldb_remote_document_cache.cc:222*
*    #5 0x10f75d73c in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingCollectionQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:146*
*    #6 0x10f75c7cb in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:102*
*    #7 0x10f8d412a in firebase::firestore::local::QueryEngine::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&, firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) query_engine.cc:77*
*    #8 0x10f7b75b7 in std::__1::__function::__func<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’(), std::__1::allocator<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’()>, void ()>::operator()() functional:1727*
*    #9 0x10f705083 in firebase::firestore::local::LevelDbPersistence::RunInternal(absl::lts_2020_02_25::string_view, std::__1::function<void ()>) leveldb_persistence.cc:264*
*    #10 0x10f783105 in firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool) local_store.cc:473*
*    #11 0x10f9ba0af in firebase::firestore::core::SyncEngine::InitializeViewAndComputeSnapshot(firebase::firestore::core::Query const&, int) sync_engine.cc:127*
*    #12 0x10f9b95e8 in firebase::firestore::core::SyncEngine::Listen(firebase::firestore::core::Query) sync_engine.cc:113*
*    #13 0x10f4f871c in firebase::firestore::core::EventManager::AddQueryListener(std::__1::shared_ptr<firebase::firestore::core::QueryListener>) event_manager.cc:60*
*    #14 0x10f5ba4c6 in std::__1::__function::__func<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10, std::__1::allocator<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10>, void ()>::operator()() functional:1727*
*    #15 0x10f3d2f80 in firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) async_queue.cc:89*
*    #16 0x10fa296a3 in firebase::firestore::util::Task::ExecuteAndRelease() task.cc:102*
*    #17 0x10e0e2821 in asan_dispatch_call_block_and_release+0xf1 (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x3f821)*
*    #18 0x1136b174d in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x474d)*
*    #19 0x1136b7f99 in _dispatch_lane_serial_drain+0x31b (libdispatch.dylib:x86_64+0xaf99)*
*    #20 0x1136b8c66 in _dispatch_lane_invoke+0x1b3 (libdispatch.dylib:x86_64+0xbc66)*
*    #21 0x1136c4a79 in _dispatch_workloop_worker_thread+0x367 (libdispatch.dylib:x86_64+0x17a79)*
*    #22 0x7fff6034045c in _pthread_wqthread+0x139 (libsystem_pthread.dylib:x86_64+0x345c)*
*    #23 0x7fff6033f42e in start_wqthread+0xe (libsystem_pthread.dylib:x86_64+0x242e)*

*previously allocated by thread T3 here:*
*    #0 0x10e0f123d in wrap__Znwm+0x7d (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x4e23d)*
*    #1 0x10f71f97b in std::__1::enable_if<!(is_array<firebase::firestore::immutable::impl::FixedArray<std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> > >::value), std::__1::shared_ptr<firebase::firestore::immutable::impl::FixedArray<std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> > > >::type std::__1::make_shared<firebase::firestore::immutable::impl::FixedArray<std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> >, std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> const*, std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> const*&>(std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> const*&&, std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> const*&) memory:4037*
*    #2 0x10f71c713 in firebase::firestore::immutable::impl::ArraySortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >::insert(firebase::firestore::model::DocumentKey const&, firebase::firestore::model::MutableDocument const&) const array_sorted_map.h:194*
*    #3 0x10f3eacf7 in firebase::firestore::immutable::SortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >::insert(firebase::firestore::model::DocumentKey const&, firebase::firestore::model::MutableDocument const&) const sorted_map.h:196*
*    #4 0x10f70d587 in firebase::firestore::local::LevelDbRemoteDocumentCache::GetAll(firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) leveldb_remote_document_cache.cc:167*
*    #5 0x10f70e9c7 in firebase::firestore::local::LevelDbRemoteDocumentCache::GetAllExisting(firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) leveldb_remote_document_cache.cc:174*
*    #6 0x10f7101ac in firebase::firestore::local::LevelDbRemoteDocumentCache::GetMatching(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) leveldb_remote_document_cache.cc:222*
*    #7 0x10f75d73c in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingCollectionQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:146*
*    #8 0x10f75c7cb in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:102*
*    #9 0x10f8d412a in firebase::firestore::local::QueryEngine::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&, firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) query_engine.cc:77*
*    #10 0x10f7b75b7 in std::__1::__function::__func<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’(), std::__1::allocator<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’()>, void ()>::operator()() functional:1727*
*    #11 0x10f705083 in firebase::firestore::local::LevelDbPersistence::RunInternal(absl::lts_2020_02_25::string_view, std::__1::function<void ()>) leveldb_persistence.cc:264*
*    #12 0x10f783105 in firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool) local_store.cc:473*
*    #13 0x10f9ba0af in firebase::firestore::core::SyncEngine::InitializeViewAndComputeSnapshot(firebase::firestore::core::Query const&, int) sync_engine.cc:127*
*    #14 0x10f9b95e8 in firebase::firestore::core::SyncEngine::Listen(firebase::firestore::core::Query) sync_engine.cc:113*
*    #15 0x10f4f871c in firebase::firestore::core::EventManager::AddQueryListener(std::__1::shared_ptr<firebase::firestore::core::QueryListener>) event_manager.cc:60*
*    #16 0x10f5ba4c6 in std::__1::__function::__func<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10, std::__1::allocator<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10>, void ()>::operator()() functional:1727*
*    #17 0x10f3d2f80 in firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) async_queue.cc:89*
*    #18 0x10fa296a3 in firebase::firestore::util::Task::ExecuteAndRelease() task.cc:102*
*    #19 0x10e0e2821 in asan_dispatch_call_block_and_release+0xf1 (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x3f821)*
*    #20 0x1136b174d in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x474d)*
*    #21 0x1136b7f99 in _dispatch_lane_serial_drain+0x31b (libdispatch.dylib:x86_64+0xaf99)*
*    #22 0x1136b8c66 in _dispatch_lane_invoke+0x1b3 (libdispatch.dylib:x86_64+0xbc66)*
*    #23 0x1136c4a79 in _dispatch_workloop_worker_thread+0x367 (libdispatch.dylib:x86_64+0x17a79)*
*    #24 0x7fff6034045c in _pthread_wqthread+0x139 (libsystem_pthread.dylib:x86_64+0x345c)*
*    #25 0x7fff6033f42e in start_wqthread+0xe (libsystem_pthread.dylib:x86_64+0x242e)*

*Thread T3 created by T0 here:*
*    <empty stack>*

*SUMMARY: AddressSanitizer: heap-use-after-free mutable_document.h:191 in firebase::firestore::model::MutableDocument::is_found_document() const*
*Shadow bytes around the buggy address:*
*  0x0c3b1c0aa390: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa*
*  0x0c3b1c0aa3a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa*
*  0x0c3b1c0aa3b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa*
*  0x0c3b1c0aa3c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa*
*  0x0c3b1c0aa3d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*=>0x0c3b1c0aa3e0: fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*  0x0c3b1c0aa3f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*  0x0c3b1c0aa400: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*  0x0c3b1c0aa410: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*  0x0c3b1c0aa420: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*  0x0c3b1c0aa430: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*Shadow byte legend (one shadow byte represents 8 application bytes):*
*  Addressable:           00*
*  Partially addressable: 01 02 03 04 05 06 07 *
*  Heap left redzone:       fa*
*  Freed heap region:       fd*
*  Stack left redzone:      f1*
*  Stack mid redzone:       f2*
*  Stack right redzone:     f3*
*  Stack after return:      f5*
*  Stack use after scope:   f8*
*  Global redzone:          f9*
*  Global init order:       f6*
*  Poisoned by user:        f7*
*  Container overflow:      fc*
*  Array cookie:            ac*
*  Intra object redzone:    bb*
*  ASan internal:           fe*
*  Left alloca redzone:     ca*
*  Right alloca redzone:    cb*
*  Shadow gap:              cc*
*2021-09-01 13:27:14.586755-0700 ReSchedule[45737:1179125] =================================================================*
*2021-09-01 13:27:14.586941-0700 ReSchedule[45737:1179125] ==45737==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d0002d1f08 at pc 0x00010f90ef45 bp 0x70000aed3510 sp 0x70000aed3508*
*2021-09-01 13:27:14.587129-0700 ReSchedule[45737:1179125] READ of size 4 at 0x61d0002d1f08 thread T3*
*2021-09-01 13:27:14.587314-0700 ReSchedule[45737:1179125]     #0 0x10f90ef44 in firebase::firestore::model::MutableDocument::is_found_document() const mutable_document.h:191*
*2021-09-01 13:27:14.587471-0700 ReSchedule[45737:1179125]     #1 0x10f70ea59 in firebase::firestore::local::LevelDbRemoteDocumentCache::GetAllExisting(firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) leveldb_remote_document_cache.cc:178*
*2021-09-01 13:27:14.587622-0700 ReSchedule[45737:1179125]     #2 0x10f7101ac in firebase::firestore::local::LevelDbRemoteDocumentCache::GetMatching(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) leveldb_remote_document_cache.cc:222*
*2021-09-01 13:27:14.587779-0700 ReSchedule[45737:1179125]     #3 0x10f75d73c in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingCollectionQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:146*
*2021-09-01 13:27:14.587947-0700 ReSchedule[45737:1179125]     #4 0x10f75c7cb in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:102*
*2021-09-01 13:27:14.588145-0700 ReSchedule[45737:1179125]     #5 0x10f8d412a in firebase::firestore::local::QueryEngine::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&, firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) query_engine.cc:77*
*2021-09-01 13:27:14.588304-0700 ReSchedule[45737:1179125]     #6 0x10f7b75b7 in std::__1::__function::__func<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’(), std::__1::allocator<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’()>, void ()>::operator()() functional:1727*
*2021-09-01 13:27:14.588453-0700 ReSchedule[45737:1179125]     #7 0x10f705083 in firebase::firestore::local::LevelDbPersistence::RunInternal(absl::lts_2020_02_25::string_view, std::__1::function<void ()>) leveldb_persistence.cc:264*
*2021-09-01 13:27:14.588594-0700 ReSchedule[45737:1179125]     #8 0x10f783105 in firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool) local_store.cc:473*
*2021-09-01 13:27:14.588739-0700 ReSchedule[45737:1179125]     #9 0x10f9ba0af in firebase::firestore::core::SyncEngine::InitializeViewAndComputeSnapshot(firebase::firestore::core::Query const&, int) sync_engine.cc:127*
*2021-09-01 13:27:14.588851-0700 ReSchedule[45737:1179125]     #10 0x10f9b95e8 in firebase::firestore::core::SyncEngine::Listen(firebase::firestore::core::Query) sync_engine.cc:113*
*2021-09-01 13:27:14.588985-0700 ReSchedule[45737:1179125]     #11 0x10f4f871c in firebase::firestore::core::EventManager::AddQueryListener(std::__1::shared_ptr<firebase::firestore::core::QueryListener>) event_manager.cc:60*
*2021-09-01 13:27:14.589118-0700 ReSchedule[45737:1179125]     #12 0x10f5ba4c6 in std::__1::__function::__func<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10, std::__1::allocator<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10>, void ()>::operator()() functional:1727*
*2021-09-01 13:27:14.589415-0700 ReSchedule[45737:1179125]     #13 0x10f3d2f80 in firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) async_queue.cc:89*
*2021-09-01 13:27:14.589553-0700 ReSchedule[45737:1179125]     #14 0x10fa296a3 in firebase::firestore::util::Task::ExecuteAndRelease() task.cc:102*
*2021-09-01 13:27:14.589685-0700 ReSchedule[45737:1179125]     #15 0x10e0e2821 in asan_dispatch_call_block_and_release+0xf1 (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x3f821)*
*2021-09-01 13:27:14.589817-0700 ReSchedule[45737:1179125]     #16 0x1136b174d in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x474d)*
*2021-09-01 13:27:14.589954-0700 ReSchedule[45737:1179125]     #17 0x1136b7f99 in _dispatch_lane_serial_drain+0x31b (libdispatch.dylib:x86_64+0xaf99)*
*2021-09-01 13:27:14.590084-0700 ReSchedule[45737:1179125]     #18 0x1136b8c66 in _dispatch_lane_invoke+0x1b3 (libdispatch.dylib:x86_64+0xbc66)*
*2021-09-01 13:27:14.590202-0700 ReSchedule[45737:1179125]     #19 0x1136c4a79 in _dispatch_workloop_worker_thread+0x367 (libdispatch.dylib:x86_64+0x17a79)*
*2021-09-01 13:27:14.590334-0700 ReSchedule[45737:1179125]     #20 0x7fff6034045c in _pthread_wqthread+0x139 (libsystem_pthread.dylib:x86_64+0x345c)*
*2021-09-01 13:27:14.590452-0700 ReSchedule[45737:1179125]     #21 0x7fff6033f42e in start_wqthread+0xe (libsystem_pthread.dylib:x86_64+0x242e)*
*2021-09-01 13:27:14.590589-0700 ReSchedule[45737:1179125] *
*2021-09-01 13:27:14.590729-0700 ReSchedule[45737:1179125] 0x61d0002d1f08 is located 136 bytes inside of 2032-byte region [0x61d0002d1e80,0x61d0002d2670)*
*2021-09-01 13:27:14.590862-0700 ReSchedule[45737:1179125] freed by thread T3 here:*
*2021-09-01 13:27:14.591006-0700 ReSchedule[45737:1179125]     #0 0x10e0f165d in wrap__ZdlPv+0x7d (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x4e65d)*
*2021-09-01 13:27:14.591131-0700 ReSchedule[45737:1179125]     #1 0x10f7cf79a in firebase::firestore::immutable::impl::ArraySortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >::operator=(firebase::firestore::immutable::impl::ArraySortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >&&) array_sorted_map.h:124*
*2021-09-01 13:27:14.591276-0700 ReSchedule[45737:1179125]     #2 0x10f787549 in firebase::firestore::immutable::SortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >::operator=(firebase::firestore::immutable::SortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >&&) sorted_map.h:130*
*2021-09-01 13:27:14.591426-0700 ReSchedule[45737:1179125]     #3 0x10f70ea92 in firebase::firestore::local::LevelDbRemoteDocumentCache::GetAllExisting(firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) leveldb_remote_document_cache.cc:179*
*2021-09-01 13:27:14.591571-0700 ReSchedule[45737:1179125]     #4 0x10f7101ac in firebase::firestore::local::LevelDbRemoteDocumentCache::GetMatching(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) leveldb_remote_document_cache.cc:222*
*2021-09-01 13:27:14.591708-0700 ReSchedule[45737:1179125]     #5 0x10f75d73c in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingCollectionQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:146*
*2021-09-01 13:27:14.591841-0700 ReSchedule[45737:1179125]     #6 0x10f75c7cb in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:102*
*2021-09-01 13:27:14.591975-0700 ReSchedule[45737:1179125]     #7 0x10f8d412a in firebase::firestore::local::QueryEngine::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&, firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) query_engine.cc:77*
*2021-09-01 13:27:14.592108-0700 ReSchedule[45737:1179125]     #8 0x10f7b75b7 in std::__1::__function::__func<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’(), std::__1::allocator<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’()>, void ()>::operator()() functional:1727*
*2021-09-01 13:27:14.592653-0700 ReSchedule[45737:1179125]     #9 0x10f705083 in firebase::firestore::local::LevelDbPersistence::RunInternal(absl::lts_2020_02_25::string_view, std::__1::function<void ()>) leveldb_persistence.cc:264*
*2021-09-01 13:27:14.592797-0700 ReSchedule[45737:1179125]     #10 0x10f783105 in firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool) local_store.cc:473*
*2021-09-01 13:27:14.592910-0700 ReSchedule[45737:1179125]     #11 0x10f9ba0af in firebase::firestore::core::SyncEngine::InitializeViewAndComputeSnapshot(firebase::firestore::core::Query const&, int) sync_engine.cc:127*
*2021-09-01 13:27:14.593052-0700 ReSchedule[45737:1179125]     #12 0x10f9b95e8 in firebase::firestore::core::SyncEngine::Listen(firebase::firestore::core::Query) sync_engine.cc:113*
*2021-09-01 13:27:14.593336-0700 ReSchedule[45737:1179125]     #13 0x10f4f871c in firebase::firestore::core::EventManager::AddQueryListener(std::__1::shared_ptr<firebase::firestore::core::QueryListener>) event_manager.cc:60*
*2021-09-01 13:27:14.593482-0700 ReSchedule[45737:1179125]     #14 0x10f5ba4c6 in std::__1::__function::__func<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10, std::__1::allocator<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10>, void ()>::operator()() functional:1727*
*2021-09-01 13:27:14.593643-0700 ReSchedule[45737:1179125]     #15 0x10f3d2f80 in firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) async_queue.cc:89*
*2021-09-01 13:27:14.593788-0700 ReSchedule[45737:1179125]     #16 0x10fa296a3 in firebase::firestore::util::Task::ExecuteAndRelease() task.cc:102*
*2021-09-01 13:27:14.593927-0700 ReSchedule[45737:1179125]     #17 0x10e0e2821 in asan_dispatch_call_block_and_release+0xf1 (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x3f821)*
*2021-09-01 13:27:14.594065-0700 ReSchedule[45737:1179125]     #18 0x1136b174d in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x474d)*
*2021-09-01 13:27:14.594185-0700 ReSchedule[45737:1179125]     #19 0x1136b7f99 in _dispatch_lane_serial_drain+0x31b (libdispatch.dylib:x86_64+0xaf99)*
*2021-09-01 13:27:14.594325-0700 ReSchedule[45737:1179125]     #20 0x1136b8c66 in _dispatch_lane_invoke+0x1b3 (libdispatch.dylib:x86_64+0xbc66)*
*2021-09-01 13:27:14.594459-0700 ReSchedule[45737:1179125]     #21 0x1136c4a79 in _dispatch_workloop_worker_thread+0x367 (libdispatch.dylib:x86_64+0x17a79)*
*2021-09-01 13:27:14.594570-0700 ReSchedule[45737:1179125]     #22 0x7fff6034045c in _pthread_wqthread+0x139 (libsystem_pthread.dylib:x86_64+0x345c)*
*2021-09-01 13:27:14.594702-0700 ReSchedule[45737:1179125]     #23 0x7fff6033f42e in start_wqthread+0xe (libsystem_pthread.dylib:x86_64+0x242e)*
*2021-09-01 13:27:14.594847-0700 ReSchedule[45737:1179125] *
*2021-09-01 13:27:14.595003-0700 ReSchedule[45737:1179125] previously allocated by thread T3 here:*
*2021-09-01 13:27:14.595139-0700 ReSchedule[45737:1179125]     #0 0x10e0f123d in wrap__Znwm+0x7d (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x4e23d)*
*2021-09-01 13:27:14.595255-0700 ReSchedule[45737:1179125]     #1 0x10f71f97b in std::__1::enable_if<!(is_array<firebase::firestore::immutable::impl::FixedArray<std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> > >::value), std::__1::shared_ptr<firebase::firestore::immutable::impl::FixedArray<std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> > > >::type std::__1::make_shared<firebase::firestore::immutable::impl::FixedArray<std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> >, std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> const*, std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> const*&>(std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> const*&&, std::__1::pair<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument> const*&) memory:4037*
*2021-09-01 13:27:14.596004-0700 ReSchedule[45737:1179125]     #2 0x10f71c713 in firebase::firestore::immutable::impl::ArraySortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >::insert(firebase::firestore::model::DocumentKey const&, firebase::firestore::model::MutableDocument const&) const array_sorted_map.h:194*
*2021-09-01 13:27:14.596137-0700 ReSchedule[45737:1179125]     #3 0x10f3eacf7 in firebase::firestore::immutable::SortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::MutableDocument, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> >::insert(firebase::firestore::model::DocumentKey const&, firebase::firestore::model::MutableDocument const&) const sorted_map.h:196*
*2021-09-01 13:27:14.596275-0700 ReSchedule[45737:1179125]     #4 0x10f70d587 in firebase::firestore::local::LevelDbRemoteDocumentCache::GetAll(firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) leveldb_remote_document_cache.cc:167*
*2021-09-01 13:27:14.596385-0700 ReSchedule[45737:1179125]     #5 0x10f70e9c7 in firebase::firestore::local::LevelDbRemoteDocumentCache::GetAllExisting(firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) leveldb_remote_document_cache.cc:174*
*2021-09-01 13:27:14.597260-0700 ReSchedule[45737:1179125]     #6 0x10f7101ac in firebase::firestore::local::LevelDbRemoteDocumentCache::GetMatching(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) leveldb_remote_document_cache.cc:222*
*2021-09-01 13:27:14.597398-0700 ReSchedule[45737:1179125]     #7 0x10f75d73c in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingCollectionQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:146*
*2021-09-01 13:27:14.597535-0700 ReSchedule[45737:1179125]     #8 0x10f75c7cb in firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) local_documents_view.cc:102*
*2021-09-01 13:27:14.597668-0700 ReSchedule[45737:1179125]     #9 0x10f8d412a in firebase::firestore::local::QueryEngine::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&, firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) query_engine.cc:77*
*2021-09-01 13:27:14.598014-0700 ReSchedule[45737:1179125]     #10 0x10f7b75b7 in std::__1::__function::__func<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’(), std::__1::allocator<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::’lambda’()>, void ()>::operator()() functional:1727*
*2021-09-01 13:27:14.598161-0700 ReSchedule[45737:1179125]     #11 0x10f705083 in firebase::firestore::local::LevelDbPersistence::RunInternal(absl::lts_2020_02_25::string_view, std::__1::function<void ()>) leveldb_persistence.cc:264*
*2021-09-01 13:27:14.598320-0700 ReSchedule[45737:1179125]     #12 0x10f783105 in firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool) local_store.cc:473*
*2021-09-01 13:27:14.598455-0700 ReSchedule[45737:1179125]     #13 0x10f9ba0af in firebase::firestore::core::SyncEngine::InitializeViewAndComputeSnapshot(firebase::firestore::core::Query const&, int) sync_engine.cc:127*
*2021-09-01 13:27:14.598565-0700 ReSchedule[45737:1179125]     #14 0x10f9b95e8 in firebase::firestore::core::SyncEngine::Listen(firebase::firestore::core::Query) sync_engine.cc:113*
*2021-09-01 13:27:14.598696-0700 ReSchedule[45737:1179125]     #15 0x10f4f871c in firebase::firestore::core::EventManager::AddQueryListener(std::__1::shared_ptr<firebase::firestore::core::QueryListener>) event_manager.cc:60*
*2021-09-01 13:27:14.598822-0700 ReSchedule[45737:1179125]     #16 0x10f5ba4c6 in std::__1::__function::__func<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10, std::__1::allocator<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10>, void ()>::operator()() functional:1727*
*2021-09-01 13:27:14.599103-0700 ReSchedule[45737:1179125]     #17 0x10f3d2f80 in firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) async_queue.cc:89*
*2021-09-01 13:27:14.599214-0700 ReSchedule[45737:1179125]     #18 0x10fa296a3 in firebase::firestore::util::Task::ExecuteAndRelease() task.cc:102*
*2021-09-01 13:27:14.599318-0700 ReSchedule[45737:1179125]     #19 0x10e0e2821 in asan_dispatch_call_block_and_release+0xf1 (libclang_rt.asan_iossim_dynamic.dylib:x86_64+0x3f821)*
*2021-09-01 13:27:14.599454-0700 ReSchedule[45737:1179125]     #20 0x1136b174d in _dispatch_client_callout+0x7 (libdispatch.dylib:x86_64+0x474d)*
*2021-09-01 13:27:14.599564-0700 ReSchedule[45737:1179125]     #21 0x1136b7f99 in _dispatch_lane_serial_drain+0x31b (libdispatch.dylib:x86_64+0xaf99)*
*2021-09-01 13:27:14.599708-0700 ReSchedule[45737:1179125]     #22 0x1136b8c66 in _dispatch_lane_invoke+0x1b3 (libdispatch.dylib:x86_64+0xbc66)*
*2021-09-01 13:27:14.599845-0700 ReSchedule[45737:1179125]     #23 0x1136c4a79 in _dispatch_workloop_worker_thread+0x367 (libdispatch.dylib:x86_64+0x17a79)*
*2021-09-01 13:27:14.599972-0700 ReSchedule[45737:1179125]     #24 0x7fff6034045c in _pthread_wqthread+0x139 (libsystem_pthread.dylib:x86_64+0x345c)*
*2021-09-01 13:27:14.600100-0700 ReSchedule[45737:1179125]     #25 0x7fff6033f42e in start_wqthread+0xe (libsystem_pthread.dylib:x86_64+0x242e)*
*2021-09-01 13:27:14.600241-0700 ReSchedule[45737:1179125] *
*2021-09-01 13:27:14.600352-0700 ReSchedule[45737:1179125] Thread T3 created by T0 here:*
*2021-09-01 13:27:14.600483-0700 ReSchedule[45737:1179125]     <empty stack>*
*2021-09-01 13:27:14.600599-0700 ReSchedule[45737:1179125] *
*2021-09-01 13:27:14.600732-0700 ReSchedule[45737:1179125] SUMMARY: AddressSanitizer: heap-use-after-free mutable_document.h:191 in firebase::firestore::model::MutableDocument::is_found_document() const*
*2021-09-01 13:27:14.600859-0700 ReSchedule[45737:1179125] Shadow bytes around the buggy address:*
*2021-09-01 13:27:14.600992-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa390: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa*
*2021-09-01 13:27:14.601112-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa3a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa*
*2021-09-01 13:27:14.601222-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa3b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa*
*2021-09-01 13:27:14.601362-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa3c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa*
*2021-09-01 13:27:14.601501-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa3d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*2021-09-01 13:27:14.601619-0700 ReSchedule[45737:1179125] =>0x0c3b1c0aa3e0: fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*2021-09-01 13:27:14.601755-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa3f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*2021-09-01 13:27:14.601883-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa400: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*2021-09-01 13:27:14.602012-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa410: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*2021-09-01 13:27:14.602157-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa420: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*2021-09-01 13:27:14.602283-0700 ReSchedule[45737:1179125]   0x0c3b1c0aa430: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd*
*2021-09-01 13:27:14.602426-0700 ReSchedule[45737:1179125] Shadow byte legend (one shadow byte represents 8 application bytes):*
*2021-09-01 13:27:14.602548-0700 ReSchedule[45737:1179125]   Addressable:           00*
*2021-09-01 13:27:14.602690-0700 ReSchedule[45737:1179125]   Partially addressable: 01 02 03 04 05 06 07*
*2021-09-01 13:27:14.602823-0700 ReSchedule[45737:1179125]   Heap left redzone:       fa*
*2021-09-01 13:27:14.602967-0700 ReSchedule[45737:1179125]   Freed heap region:       fd*
*2021-09-01 13:27:14.603107-0700 ReSchedule[45737:1179125]   Stack left redzone:      f1*
*2021-09-01 13:27:14.603252-0700 ReSchedule[45737:1179125]   Stack mid redzone:       f2*
*2021-09-01 13:27:14.603400-0700 ReSchedule[45737:1179125]   Stack right redzone:     f3*
*2021-09-01 13:27:14.603544-0700 ReSchedule[45737:1179125]   Stack after return:      f5*
*2021-09-01 13:27:14.603685-0700 ReSchedule[45737:1179125]   Stack use after scope:   f8*
*2021-09-01 13:27:14.603817-0700 ReSchedule[45737:1179125]   Global redzone:          f9*
*2021-09-01 13:27:14.603956-0700 ReSchedule[45737:1179125]   Global init order:       f6*
*2021-09-01 13:27:14.604090-0700 ReSchedule[45737:1179125]   Poisoned by user:        f7*
*2021-09-01 13:27:14.604220-0700 ReSchedule[45737:1179125]   Container overflow:      fc*
*2021-09-01 13:27:14.604340-0700 ReSchedule[45737:1179125]   Array cookie:            ac*
*2021-09-01 13:27:14.604471-0700 ReSchedule[45737:1179125]   Intra object redzone:    bb*
*2021-09-01 13:27:14.604610-0700 ReSchedule[45737:1179125]   ASan internal:           fe*
*2021-09-01 13:27:14.604725-0700 ReSchedule[45737:1179125]   Left alloca redzone:     ca*
*2021-09-01 13:27:14.604870-0700 ReSchedule[45737:1179125]   Right alloca redzone:    cb*
*2021-09-01 13:27:14.605024-0700 ReSchedule[45737:1179125]   Shadow gap:              cc*
*==45737==ABORTING*
Warning: hit breakpoint while running function, skipping commands and conditions to prevent recursion.AddressSanitizer report breakpoint hit. Use ‘thread info -s’ to get extended information about the report.warning: `this’ is not accessible (substituting 0)

Activity

google-oss-bot

google-oss-bot commented on Sep 1, 2021

@google-oss-bot

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.
changed the title [-]Firestore addSnapshotListener problems with [/-] [+]Firestore addSnapshotListener problems with address sanitizer [/+] on Sep 1, 2021
self-assigned this
on Sep 1, 2021
var-const

var-const commented on Sep 1, 2021

@var-const
Contributor

Thank you for the report. It looks like this issue should be fixed by #8610. Can you please try out the fix from that PR and see if it resolves the error you're seeing? If using CocoaPods, you could get the Firestore pod from GitHub:

pod 'Firebase/Firestore', :git => 'https://github.com/firebase-ios-sdk/firebase-ios-sdk.git', :branch => 'ehsann/fix-remote-doc-cache'

(you would have to add the same :git and :branch attributes for any other Firebase pods you're using)

Alternatively, given that the fix is small, you could just apply the patch manually.

girishw

girishw commented on Sep 2, 2021

@girishw
Author

@var-const When I try to install using CocoaPods via GitHub, I get the following error:

Analyzing dependencies
Pre-downloading: Firebase from https://github.com/firebase-ios-sdk/firebase-ios-sdk.git, branch ehsann/fix-remote-doc-cache

[!] Error installing Firebase
[!] Failed to download 'Firebase': [!] /usr/local/bin/git clone https://github.com/firebase-ios-sdk/firebase-ios-sdk.git /var/folders/zd/v18qtk3n2h75gmmbpzc4bpkc0000gn/T/d20210901-9032-z83wjo --template= --single-branch --depth 1 --branch ehsann/fix-remote-doc-cache

Cloning into '/var/folders/zd/v18qtk3n2h75gmmbpzc4bpkc0000gn/T/d20210901-9032-z83wjo'...
remote: Repository not found.
fatal: repository 'https://github.com/firebase-ios-sdk/firebase-ios-sdk.git/' not found

dconeybe

dconeybe commented on Sep 2, 2021

@dconeybe
Contributor

Looks like there was a typo in the URL posted in the previous comment. Please replace the Git URL with the following:

https://github.com/firebase/firebase-ios-sdk.git
dconeybe

dconeybe commented on Sep 2, 2021

@dconeybe
Contributor

Also, the ehsann/fix-remote-doc-cache branch no longer exists (it was deleted when the fix was merged). You should just be able to replace it with the commit hash: 4cf4e7c5e2fec340a0008c75b5d5acae5c4bd765

So, with that, can you try this line instead:

pod 'Firebase/Firestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => '4cf4e7c5e2fec340a0008c75b5d5acae5c4bd765'
girishw

girishw commented on Sep 2, 2021

@girishw
Author

Still having problems:

Analyzing dependencies
Pre-downloading: Firebase from https://github.com/firebase/firebase-ios-sdk.git, branch 4cf4e7c5e2fec340a0008c75b5d5acae5c4bd765

[!] Error installing Firebase
[!] Failed to download 'Firebase': [!] /usr/local/bin/git clone https://github.com/firebase/firebase-ios-sdk.git /var/folders/zd/v18qtk3n2h75gmmbpzc4bpkc0000gn/T/d20210902-20371-17liun2 --template= --single-branch --depth 1 --branch 4cf4e7c

Cloning into '/var/folders/zd/v18qtk3n2h75gmmbpzc4bpkc0000gn/T/d20210902-20371-17liun2'...
warning: Could not find remote branch 4cf4e7c to clone.
fatal: Remote branch 4cf4e7c not found in upstream origin

12 remaining items

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Firestore addSnapshotListener problems with address sanitizer · Issue #8612 · firebase/firebase-ios-sdk