firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.28k stars 1.4k forks source link

Random Crash Firestore in simulator #12857

Open jesus-mg-ios opened 1 week ago

jesus-mg-ios commented 1 week ago

Description

Thread 30: "FIRESTORE INTERNAL ASSERTION FAILED: Failed to commit transaction:\n<LevelDbTransaction Locally write mutations: 6 changes (662 bytes):\n  - Put [document_mutation: user_id=USERID path=collection/USERID batch_id=5] (0 bytes)\n  - Put [document_overlays: user_id= USERID path=collection/USERID batch_id=5] (322 bytes)\n  - Put [document_overlays_collection_group_index: user_id= USERID collection_group=collection batch_id=5 path=collection/USERID] (0 bytes)\n  - Put [document_overlays_collection_index: user_id=ReJddTaJKGUn1GiTPUSqzztAALV2 path=collection batch_id=5 document_id= USERID] (0 bytes)\n  - Put [document_overlays_largest_batch_id_index: user_id= USERID batch_id=5 path=collection/USERID] (0 bytes)\n  - Put [mutation: user_id= USERID b"

Thread 30 Queue : com.google.firebase.firestore (serial)
#0  0x0000000107730a4c in __pthread_kill ()
#1  0x000000010783b1d0 in pthread_kill ()
#2  0x0000000180160648 in __abort ()
#3  0x00000001801605d8 in abort ()
#4  0x000000018028ec78 in abort_message ()
#5  0x0000000180280198 in demangling_terminate_handler() ()
#6  0x000000018005fbf0 in _objc_terminate() ()
#7  0x000000018028e150 in std::__terminate(void (*)()) ()
#8  0x000000018028e100 in std::terminate() ()
#9  0x00000001800842d4 in objc_terminate ()
#10 0x0000000106f41950 in _dispatch_client_callout ()
#11 0x0000000106f49bd8 in _dispatch_lane_serial_drain ()
#12 0x0000000106f4a91c in _dispatch_lane_invoke ()
#13 0x0000000106f572f8 in _dispatch_root_queue_drain_deferred_wlh ()
#14 0x0000000106f56754 in _dispatch_workloop_worker_thread ()
#15 0x0000000107837924 in _pthread_wqthread ()
Enqueued from com.apple.root.user-initiated-qos.cooperative (Thread 28) Queue : com.apple.root.user-initiated-qos.cooperative (serial)
#0  0x0000000106f46858 in dispatch_async_f ()
#1  0x00000001015d3ee4 in firebase::firestore::util::AsyncQueue::EnqueueRelaxed(std::__1::function<void ()> const&) ()
#2  0x000000010163c3a0 in firebase::firestore::core::FirestoreClient::WriteMutations(std::__1::vector<firebase::firestore::model::Mutation, std::__1::allocator<firebase::firestore::model::Mutation>>&&, std::__1::function<void (firebase::firestore::util::Status)>) ()
#3  0x0000000101606a64 in firebase::firestore::api::DocumentReference::SetData(firebase::firestore::core::ParsedSetData&&, std::__1::function<void (firebase::firestore::util::Status)>) ()
#4  0x0000000101624d80 in -[FIRDocumentReference setData:merge:completion:] ()
#5  0x0000000101624c94 in -[FIRDocumentReference setData:completion:] ()
#6  0x0000000100aa1758 in FIRDocumentReference.setData<τ_0_0>(from:encoder:completion:) at ATH/SourcePackages/checkouts/firebase-ios-sdk/Firestore/Swift/Source/Codable/DocumentReference+WriteEncodable.swift:42
#7  0x000000010029b544 in PROTOCL.update(_:) at PATH/FILE:39
#8  0x000000010029b948 in protocol witness for caller.update(_:) in conformance PROTOCL ()
#9  0x0000000100300978 in closure #1 in CLOSURE at PATH/FILE2.swift
#10 0x00000001e45269ec in swift::runJobInEstablishedExecutorContext(swift::Job*) ()
#11 0x00000001e45278e4 in swift_job_runImpl(swift::Job*, swift::ExecutorRef) ()
#12 0x0000000106f554bc in _dispatch_root_queue_drain ()
#13 0x0000000106f56068 in _dispatch_worker_thread2 ()
#14 0x00000001078378e8 in _pthread_wqthread ()
#15 0x00000001078366e4 in start_wqthread ()

=============
Thread#0    0x000000018049111c in __exceptionPreprocess ()
#1  0x000000018008412c in objc_exception_throw ()
#2  0x0000000180d11770 in -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] ()
#3  0x0000000101618458 in firebase::firestore::util::ObjcThrowHandler(firebase::firestore::util::ExceptionType, char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) ()
#4  0x0000000101617f28 in firebase::firestore::util::Throw(firebase::firestore::util::ExceptionType, char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) ()
#5  0x000000010166dc20 in firebase::firestore::util::internal::FailAssertion(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) ()
#6  0x000000010166dcb0 in firebase::firestore::util::internal::FailAssertion(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, char const*) ()
#7  0x00000001016a9640 in firebase::firestore::local::LevelDbTransaction::Commit() ()
#8  0x000000010169d2ac in firebase::firestore::local::LevelDbPersistence::RunInternal(absl::lts_20220623::string_view, std::__1::function<void ()>) ()
#9  0x00000001016b67ac in firebase::firestore::local::LocalStore::WriteLocally(std::__1::vector<firebase::firestore::model::Mutation, std::__1::allocator<firebase::firestore::model::Mutation>>&&) ()
#10 0x000000010171bca4 in firebase::firestore::core::SyncEngine::WriteMutations(std::__1::vector<firebase::firestore::model::Mutation, std::__1::allocator<firebase::firestore::model::Mutation>>&&, std::__1::function<void (firebase::firestore::util::Status)>) ()
#11 0x00000001016431c4 in std::__1::__function::__func<firebase::firestore::core::FirestoreClient::WriteMutations(std::__1::vector<firebase::firestore::model::Mutation, std::__1::allocator<firebase::firestore::model::Mutation>>&&, std::__1::function<void (firebase::firestore::util::Status)>)::$_17, std::__1::allocator<firebase::firestore::core::FirestoreClient::WriteMutations(std::__1::vector<firebase::firestore::model::Mutation, std::__1::allocator<firebase::firestore::model::Mutation>>&&, std::__1::function<void (firebase::firestore::util::Status)>)::$_17>, void ()>::operator()() ()
#12 0x00000001015d3cbc in firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) ()
#13 0x000000010172b3d8 in firebase::firestore::util::Task::ExecuteAndRelease() ()
#14 0x0000000106f4193c in _dispatch_client_callout ()
#15 0x0000000106f49bd8 in _dispatch_lane_serial_drain ()
#16 0x0000000106f4a91c in _dispatch_lane_invoke ()
#17 0x0000000106f572f8 in _dispatch_root_queue_drain_deferred_wlh ()
#18 0x0000000106f56754 in _dispatch_workloop_worker_thread ()
#19 0x0000000107837924 in _pthread_wqthread ()
#20 0x00000001078366e4 in start_wqthread ()

Reproducing the issue

No response

Firebase SDK Version

10.22.1

Xcode Version

15.2

Installation Method

Swift Package Manager

Firebase Product(s)

Firestore

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
```json Replace this line with the contents of your Package.resolved. ```

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
```yml Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 1 week ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

milaGGL commented 1 week ago

Hi @jesus-mg-ios, thank you for reporting this issue. How often does this happen? Would it be possible to provide a minimal reproduction code?

jesus-mg-ios commented 1 week ago

It is related to devices with no free storage space. Do you think it makes sense?
Minimal reproduction code is not available to share right now.

milaGGL commented 1 week ago

Could you please try re-creating a new simulator? If the issue persists, try downgrading to Xcode 14.3.1 and/or SDK version 10.20.0.

google-oss-bot commented 1 day ago

Hey @jesus-mg-ios. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!