firebase / firebase-ios-sdk

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

Crashed: com.google.firebase.firestore SIGABRT ABORT 0x0000000206340200 #10957

Closed sspogra closed 1 year ago

sspogra commented 1 year ago

Description

Crashed: com.google.firebase.firestore
0  libsystem_kernel.dylib         0x7200 __pthread_kill + 8
1  libsystem_pthread.dylib        0x71ac pthread_kill + 268
2  libsystem_c.dylib              0x20c8c abort + 180
3  libsystem_malloc.dylib         0x1df2c malloc_vreport + 908
4  libsystem_malloc.dylib         0x1e1d0 malloc_zone_error + 100
5  libsystem_malloc.dylib         0x186b0 nanov2_guard_corruption_detected + 44
6  libsystem_malloc.dylib         0x16acc nanov2_free_definite_size + 386
7  libc++abi.dylib                0x138b0 operator new(unsigned long) + 32
8  FirebaseFirestore              0xf0b4 std::__1::vector<firebase::firestore::core::OrderBy, std::__1::allocator<firebase::firestore::core::OrderBy>>::__vallocate(unsigned long) + 1015 (vector:1015)
9  FirebaseFirestore              0xf028 std::__1::vector<firebase::firestore::core::OrderBy, std::__1::allocator<firebase::firestore::core::OrderBy>>::vector(std::__1::vector<firebase::firestore::core::OrderBy, std::__1::allocator<firebase::firestore::core::OrderBy>> const&) + 1281 (vector:1281)
10 FirebaseFirestore              0x110bfc std::__1::__function::__func<firebase::firestore::core::Query::Comparator() const::$_1, std::__1::allocator<firebase::firestore::core::Query::Comparator() const::$_1>, firebase::firestore::util::ComparisonResult (firebase::firestore::model::Document const&, firebase::firestore::model::Document const&)>::__clone() const + 321 (function.h:321)
11 FirebaseFirestore              0x93f8 std::__1::function<void ()>::function(std::__1::function<void ()> const&) + 440 (function.h:440)
12 FirebaseFirestore              0x3a774 firebase::firestore::immutable::SortedMap<firebase::firestore::model::Document, firebase::firestore::util::Empty, firebase::firestore::model::DocumentComparator>::SortedMap(firebase::firestore::immutable::SortedMap<firebase::firestore::model::Document, firebase::firestore::util::Empty, firebase::firestore::model::DocumentComparator> const&) + 1102 (function.h:1102)
13 FirebaseFirestore              0x157050 firebase::firestore::core::View::ApplyChanges(firebase::firestore::core::ViewDocumentChanges const&, absl::lts_20211102::optional<firebase::firestore::remote::TargetChange> const&) + 76 (sorted_map.h:76)
14 FirebaseFirestore              0x13e784 firebase::firestore::core::SyncEngine::EmitNewSnapshotsAndNotifyLocalStore(firebase::firestore::immutable::SortedMap<firebase::firestore::model::DocumentKey, firebase::firestore::model::Document, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey>> const&, absl::lts_20211102::optional<firebase::firestore::remote::RemoteEvent> const&) + 1273 (vector:1273)
15 FirebaseFirestore              0x13f7e0 firebase::firestore::core::SyncEngine::ApplyRemoteEvent(firebase::firestore::remote::RemoteEvent const&) + 313 (sync_engine.cc:313)
16 FirebaseFirestore              0x128608 firebase::firestore::remote::RemoteStore::RaiseWatchSnapshot(firebase::firestore::model::SnapshotVersion const&) + 48 (model_fwd.h:48)
17 FirebaseFirestore              0x162788 firebase::firestore::remote::WatchStream::NotifyStreamResponse(grpc::ByteBuffer const&) + 51 (compressed_pair.h:51)
18 FirebaseFirestore              0x138654 firebase::firestore::remote::Stream::OnStreamRead(grpc::ByteBuffer const&) + 303 (unique_ptr.h:303)
19 FirebaseFirestore              0x8e598 std::__1::__function::__func<firebase::firestore::remote::GrpcCompletion::Complete(bool)::$_0, std::__1::allocator<firebase::firestore::remote::GrpcCompletion::Complete(bool)::$_0>, void ()>::operator()() + 352 (function.h:352)
20 FirebaseFirestore              0x8784 firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) + 997 (atomic:997)
21 FirebaseFirestore              0x14a880 firebase::firestore::util::Task::ExecuteAndRelease() + 491 (function.h:491)
22 libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
23 libdispatch.dylib              0xb694 _dispatch_lane_serial_drain + 672
24 libdispatch.dylib              0xc1e0 _dispatch_lane_invoke + 384
25 libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread + 652
26 libsystem_pthread.dylib        0xdf8 _pthread_wqthread + 288
27 libsystem_pthread.dylib        0xb98 start_wqthread + 8

Reproducing the issue

No response

Firebase SDK Version

10.3.0

Xcode Version

14.2

Installation Method

CocoaPods

Firebase Product(s)

Analytics, App Distribution, Authentication, Crashlytics, Database, Firestore, Messaging, Performance

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 - FirebaseABTesting (10.3.0): - FirebaseCore (~> 10.0) - FirebaseAnalytics (10.3.0): - FirebaseAnalytics/AdIdSupport (= 10.3.0) - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/MethodSwizzler (~> 7.8) - GoogleUtilities/Network (~> 7.8) - "GoogleUtilities/NSData+zlib (~> 7.8)" - nanopb (< 2.30910.0, >= 2.30908.0) - FirebaseAnalytics/AdIdSupport (10.3.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleAppMeasurement (= 10.3.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/MethodSwizzler (~> 7.8) - GoogleUtilities/Network (~> 7.8) - "GoogleUtilities/NSData+zlib (~> 7.8)" - nanopb (< 2.30910.0, >= 2.30908.0) - FirebaseAuth (10.3.0): - FirebaseCore (~> 10.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/Environment (~> 7.8) - GTMSessionFetcher/Core (< 4.0, >= 2.1) - FirebaseCore (10.3.0): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Logger (~> 7.8) - FirebaseCoreInternal (10.3.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - FirebaseCrashlytics (10.3.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleDataTransport (~> 9.2) - GoogleUtilities/Environment (~> 7.8) - nanopb (< 2.30910.0, >= 2.30908.0) - PromisesObjC (~> 2.1) - FirebaseDatabase (10.3.0): - FirebaseCore (~> 10.0) - leveldb-library (~> 1.22) - FirebaseFirestore (10.3.0): - abseil/algorithm (~> 1.20211102.0) - abseil/base (~> 1.20211102.0) - abseil/container/flat_hash_map (~> 1.20211102.0) - abseil/memory (~> 1.20211102.0) - abseil/meta (~> 1.20211102.0) - abseil/strings/strings (~> 1.20211102.0) - abseil/time (~> 1.20211102.0) - abseil/types (~> 1.20211102.0) - FirebaseCore (~> 10.0) - "gRPC-C++ (~> 1.44.0)" - leveldb-library (~> 1.22) - nanopb (< 2.30910.0, >= 2.30908.0) - FirebaseInstallations (10.3.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - PromisesObjC (~> 2.1) - FirebaseMessaging (10.3.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleDataTransport (~> 9.2) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Reachability (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - nanopb (< 2.30910.0, >= 2.30908.0) - FirebasePerformance (10.3.0): - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - FirebaseRemoteConfig (~> 10.0) - GoogleDataTransport (~> 9.2) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/ISASwizzler (~> 7.8) - GoogleUtilities/MethodSwizzler (~> 7.8) - nanopb (< 2.30910.0, >= 2.30908.0) - FirebaseRemoteConfig (10.3.0): - FirebaseABTesting (~> 10.0) - FirebaseCore (~> 10.0) - FirebaseInstallations (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - "GoogleUtilities/NSData+zlib (~> 7.8)" - FlagPhoneNumber (0.7.8): - FlagPhoneNumber/libPhoneNumberiOS (= 0.7.8) - FlagPhoneNumber/libPhoneNumberiOS (0.7.8) - GoogleAppMeasurement (10.3.0): - GoogleAppMeasurement/AdIdSupport (= 10.3.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/MethodSwizzler (~> 7.8) - GoogleUtilities/Network (~> 7.8) - "GoogleUtilities/NSData+zlib (~> 7.8)" - nanopb (< 2.30910.0, >= 2.30908.0) - GoogleAppMeasurement/AdIdSupport (10.3.0): - GoogleAppMeasurement/WithoutAdIdSupport (= 10.3.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/MethodSwizzler (~> 7.8) - GoogleUtilities/Network (~> 7.8) - "GoogleUtilities/NSData+zlib (~> 7.8)" - nanopb (< 2.30910.0, >= 2.30908.0) - GoogleAppMeasurement/WithoutAdIdSupport (10.3.0): - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/MethodSwizzler (~> 7.8) - GoogleUtilities/Network (~> 7.8) - "GoogleUtilities/NSData+zlib (~> 7.8)" - nanopb (< 2.30910.0, >= 2.30908.0) - GoogleDataTransport (9.2.0): - GoogleUtilities/Environment (~> 7.7) - nanopb (< 2.30910.0, >= 2.30908.0) - PromisesObjC (< 3.0, >= 1.2) - GoogleUtilities/AppDelegateSwizzler (7.11.0): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - GoogleUtilities/Environment (7.11.0): - PromisesObjC (< 3.0, >= 1.2) - GoogleUtilities/ISASwizzler (7.11.0) - GoogleUtilities/Logger (7.11.0): - GoogleUtilities/Environment - GoogleUtilities/MethodSwizzler (7.11.0): - GoogleUtilities/Logger - GoogleUtilities/Network (7.11.0): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - "GoogleUtilities/NSData+zlib (7.11.0)" - GoogleUtilities/Reachability (7.11.0): - GoogleUtilities/Logger - GoogleUtilities/UserDefaults (7.11.0): - GoogleUtilities/Logger - "gRPC-C++ (1.44.0)": - "gRPC-C++/Implementation (= 1.44.0)" - "gRPC-C++/Interface (= 1.44.0)" - "gRPC-C++/Implementation (1.44.0)": - abseil/base/base (= 1.20211102.0) - abseil/base/core_headers (= 1.20211102.0) - abseil/container/flat_hash_map (= 1.20211102.0) - abseil/container/inlined_vector (= 1.20211102.0) - abseil/functional/bind_front (= 1.20211102.0) - abseil/hash/hash (= 1.20211102.0) - abseil/memory/memory (= 1.20211102.0) - abseil/random/random (= 1.20211102.0) - abseil/status/status (= 1.20211102.0) - abseil/status/statusor (= 1.20211102.0) - abseil/strings/cord (= 1.20211102.0) - abseil/strings/str_format (= 1.20211102.0) - abseil/strings/strings (= 1.20211102.0) - abseil/synchronization/synchronization (= 1.20211102.0) - abseil/time/time (= 1.20211102.0) - abseil/types/optional (= 1.20211102.0) - abseil/types/variant (= 1.20211102.0) - abseil/utility/utility (= 1.20211102.0) - "gRPC-C++/Interface (= 1.44.0)" - gRPC-Core (= 1.44.0) - "gRPC-C++/Interface (1.44.0)" - gRPC-Core (1.44.0): - gRPC-Core/Implementation (= 1.44.0) - gRPC-Core/Interface (= 1.44.0) - gRPC-Core/Implementation (1.44.0): - abseil/base/base (= 1.20211102.0) - abseil/base/core_headers (= 1.20211102.0) - abseil/container/flat_hash_map (= 1.20211102.0) - abseil/container/inlined_vector (= 1.20211102.0) - abseil/functional/bind_front (= 1.20211102.0) - abseil/hash/hash (= 1.20211102.0) - abseil/memory/memory (= 1.20211102.0) - abseil/random/random (= 1.20211102.0) - abseil/status/status (= 1.20211102.0) - abseil/status/statusor (= 1.20211102.0) - abseil/strings/cord (= 1.20211102.0) - abseil/strings/str_format (= 1.20211102.0) - abseil/strings/strings (= 1.20211102.0) - abseil/synchronization/synchronization (= 1.20211102.0) - abseil/time/time (= 1.20211102.0) - abseil/types/optional (= 1.20211102.0) - abseil/types/variant (= 1.20211102.0) - abseil/utility/utility (= 1.20211102.0) - BoringSSL-GRPC (= 0.0.24) - gRPC-Core/Interface (= 1.44.0) - Libuv-gRPC (= 0.0.10) - gRPC-Core/Interface (1.44.0) - GTMSessionFetcher/Core (3.1.0) ```
google-oss-bot commented 1 year ago

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

rizafran commented 1 year ago

Thanks for reaching out, @sspogra. Could you provide the detailed steps and mcve for us to investigate the issue?

sspogra commented 1 year ago

As per the log last function called before the crash is -

let subscription = firestore.collection("users")
            .document(String(userId))
            .collection(TABLE_COMPANIES)
            .document(String(id))
            .addSnapshotListener({ (snapshot, error) in
                let company = Mapper<CompanyModel>().map(JSONObject: snapshot?.data())
                callback(company)
            })
cherylEnkidu commented 1 year ago

Hi @sspogra ,

Can you provide the repo steps to reproduce this crash? The code above seems not directly relate to crash.

sspogra commented 1 year ago

@cherylEnkidu We are getting this crash on only live app so we don't have too much info.

cherylEnkidu commented 1 year ago

From the stack trace I can only tell the crash happened when do some inner sorting of the data. A suggestion would be verify the input data when crash happens and try to use that data set to reproduce problems. After you successfully reproduce the crash, we can start investigation from there.

google-oss-bot commented 1 year ago

Hey @sspogra. 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!

google-oss-bot commented 1 year ago

Since there haven't been any recent updates here, I am going to close this issue.

@sspogra if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

sspogra commented 1 year ago

Is this crash same as above? Its getting on same scenario.

Crashed: com.apple.root.background-qos
0  libsystem_kernel.dylib         0x7200 __pthread_kill + 8
1  libsystem_pthread.dylib        0x71ac pthread_kill + 268
2  libsystem_c.dylib              0x20c8c abort + 180
3  libsystem_malloc.dylib         0x1df2c malloc_vreport + 908
4  libsystem_malloc.dylib         0x1e1d0 malloc_zone_error + 100
5  libsystem_malloc.dylib         0x186b0 nanov2_guard_corruption_detected + 44
6  libsystem_malloc.dylib         0x16acc nanov2_free_definite_size + 386
7  libdispatch.dylib              0x38174 _dispatch_continuation_alloc_from_heap + 116
8  libdispatch.dylib              0x842c _dispatch_async_f_slow + 48
9  FirebaseFirestore              0x89ac firebase::firestore::util::AsyncQueue::EnqueueRelaxed(std::__1::function<void ()> const&) + 463 (function.h:463)
10 FirebaseFirestore              0x6af78 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>>&&) + 463 (function.h:463)
11 FirebaseFirestore              0x37e78 firebase::firestore::api::DocumentReference::AddSnapshotListener(firebase::firestore::core::ListenOptions, std::__1::unique_ptr<firebase::firestore::core::EventListener<firebase::firestore::api::DocumentSnapshot>, std::__1::default_delete<firebase::firestore::core::EventListener<firebase::firestore::api::DocumentSnapshot>>>&&) + 958 (shared_ptr.h:958)
12 FirebaseFirestore              0x55580 -[FIRDocumentReference addSnapshotListenerInternalWithOptions:listener:] + 315 (unique_ptr.h:315)
13 FirebaseFirestore              0x55538 -[FIRDocumentReference addSnapshotListenerWithIncludeMetadataChanges:listener:] + 212 (FIRDocumentReference.mm:212)
14 FirebaseFirestore              0x55508 -[FIRDocumentReference addSnapshotListener:] + 205 (FIRDocumentReference.mm:205)
15 App Name                  0x2b510c getCompanyById(id:callback:) + 173 (CompanyDao.swift:173)
16 App Name                    0x336720 closure #1 in ReportViewController.addCompanyListener() + 4336396064
17App Name                    0x19124c thunk for @escaping @callee_guaranteed () -> () + 4334670412 (<compiler-generated>:4334670412)
18 libdispatch.dylib              0x24b4 _dispatch_call_block_and_release + 32
19 libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
20 libdispatch.dylib              0x15b8c _dispatch_root_queue_drain + 684
21 libdispatch.dylib              0x16284 _dispatch_worker_thread2 + 164
22 libsystem_pthread.dylib        0xdbc _pthread_wqthread + 228
23 libsystem_pthread.dylib        0xb98 start_wqthread + 8