braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
52 stars 19 forks source link

[Bug]: Crash on com.braze.core.persistence (SIGABRT ABORT) reported by Crashlytics #23

Closed malcommac closed 1 year ago

malcommac commented 2 years ago

Platform

iOS

Platform Version

15.x and 16.x

Braze SDK Version

5.6.0

Xcode Version

14.1

Computer Processor

Apple (M1)

Repro Rate

-

Steps To Reproduce

We have some crashes reported related to the new braze SDK.
It happens just after the startup of the app (less than 1s).

failed to demangle superclass of Deferred from mangled name '�%': unknown error

Crashed: com.braze.core.persistence
0  libsystem_kernel.dylib         0x7b38 __pthread_kill + 8
1  libsystem_pthread.dylib        0x73bc pthread_kill + 268
2  libsystem_c.dylib              0x20524 abort + 168
3  libswiftCore.dylib             0x3995d0 swift::warningv(unsigned int, char const*, char*) + 142
4  libswiftCore.dylib             0x3a827c swift_initClassMetadata + 898
5  libswiftCore.dylib             0x3a82d8 _swift_initClassMetadataImpl(swift::TargetClassMetadata<swift::InProcess>*, swift::ClassLayoutFlags, unsigned long, swift::TypeLayout const* const*, unsigned long*, bool) + 84
6  Indomio                        0x4f262c type metadata completion function for Deferred + 4304217644
7  libswiftCore.dylib             0x3b1e04 swift::MetadataCacheEntryBase<(anonymous namespace)::GenericCacheEntry, void const*>::doInitialization(swift::MetadataWaitQueue::Worker&, swift::MetadataRequest) + 340
8  libswiftCore.dylib             0x3a4954 _swift_getGenericMetadata(swift::MetadataRequest, void const* const*, swift::TargetTypeContextDescriptor<swift::InProcess> const*) + 1860
9  Indomio                        0x11bc7c __swift_instantiateGenericMetadata + 4300192892
10 Indomio                        0x5000d4 static Effect.future(_:) + 4304273620
11 Indomio                        0x184714 specialized Persistence.Client.saveEffect(_:for:execute:) + 4300621588
12 Indomio                        0x189e78 partial apply for specialized closure #3 in Persistence.Client.saveEffect<A>(_:for:execute:) + 4300643960
13 Indomio                        0x189eb0 partial apply for specialized thunk for @escaping @callee_guaranteed (@in_guaranteed A.TopLevelEncoder.Output) -> (@owned Effect<Never, Persistence.Error>) + 4300644016
14 Indomio                        0x4e5560 closure #2 in closure #1 in PublisherType.innerFlatMap<A, B>(maxPublishers:_:) + 4304164192
15 Indomio                        0x4e5838 partial apply for closure #2 in closure #1 in PublisherType.innerFlatMap<A, B>(maxPublishers:_:) + 4304164920
16 Indomio                        0x4f741c Subscriber.receive(_:) + 4304237596
17 Indomio                        0x4e6f8c partial apply for closure #2 in closure #1 in PublisherType.handleEvents(ncombine_receiveSubscriber:ncombine_receiveSubscription:receiveOutput:receiveCompletion:receiveCancel:ncombine_receiveRequest:) + 4304170892
18 Indomio                        0x4f741c Subscriber.receive(_:) + 4304237596
19 Indomio                        0x4f741c Subscriber.receive(_:) + 4304237596
20 Indomio                        0x4f370c specialized Future.fulfill(subscriber:_:) + 4304221964
21 Indomio                        0x4f392c partial apply for closure #1 in Future.promise(_:) + 4304222508
22 Indomio                        0x4f5d00 thunk for @callee_guaranteed (@guaranteed Subscriber<A, B>) -> (@error @owned Error) + 4304231680
23 Indomio                        0x4f3968 partial apply for thunk for @callee_guaranteed (@guaranteed Subscriber<A, B>) -> (@error @owned Error) + 4304222568
24 libswiftCore.dylib             0xd93d8 Sequence.forEach(_:) + 748
25 Indomio                        0x4f3278 Future.promise(_:) + 4304220792
26 Indomio                        0x5017f8 partial apply for closure #1 in closure #1 in closure #1 in static Effect.future(_:) + 4304279544
27 Indomio                        0x184fe0 specialized closure #1 in Persistence.Client.encode<A>(_:completion:) + 4300623840
28 Indomio                        0x18ae10 partial apply for specialized closure #1 in Persistence.Client.encode<A>(_:completion:) + 4300647952
29 Indomio                        0x6ade8 thunk for @escaping @callee_guaranteed () -> () + 4299468264
30 libdispatch.dylib              0x12830 _dispatch_block_async_invoke2 + 148
31 libdispatch.dylib              0x3a30 _dispatch_client_callout + 20
32 libdispatch.dylib              0xb124 _dispatch_lane_serial_drain + 668
33 libdispatch.dylib              0xbc80 _dispatch_lane_invoke + 392
34 libdispatch.dylib              0x16500 _dispatch_workloop_worker_thread + 648
35 libsystem_pthread.dylib        0x10bc _pthread_wqthread + 288
36 libsystem_pthread.dylib        0xe5c start_wqthread + 8

Expected Behavior

it should not crash

Actual Incorrect Behavior

it crashes

Verbose Logs

No response

Additional Information

No response

hokstuff commented 2 years ago

Hi @malcommac,

The SDK version 5.6.0 was released with Xcode 13.2.1 / MacOS Ventura, which successfully built via CLI but is not officially supported according to Apple. We have released SDK version 5.6.2 which was released with Xcode 13.2.1 / MacOS Monterey which might address the root cause of this issue. Would you be able to try the latest version to see if you are still experiencing this crash?

Additionally, could you provide more context around how often you see this crash, if there is a ballpark repro rate, or if you have any steps to repro?

Thanks!

malcommac commented 2 years ago

Yes, I'll try this new release and post updates on this issue.
I have not so much; it seems happening on iOS 15 and 16 with no particular differences.
I've tried reproducing it, but it's happening at startup with no particular settings.

hokstuff commented 1 year ago

Hi @malcommac,

Are you still experiencing this issue with the latest Swift SDK version?

malcommac commented 1 year ago

No I've not experienced it anymore since update, you can close this issue. thank you