statsig-io / ios-sdk

Statsig's SDK for client-side iOS applications.
ISC License
15 stars 8 forks source link

Crash in 1.18.0 update #3

Closed ba01ei closed 1 year ago

ba01ei commented 1 year ago

After statsig-io library updated from 1.17.1 to 1.18.0, we found a new crash with the following stacktrace:

Crashed: com.apple.main-thread
0  libswiftCore.dylib             0x3da11c _swift_release_dealloc + 32
1  AppName                        0x5777d4 outlined release of StatsigValuesCache + 4334761940 (<compiler-generated>:4334761940)
2  AppName                        0x592808 StatsigClient.fetchAndScheduleSyncing(completion:) + 4334872584 (<compiler-generated>:4334872584)
3  AppName                        0x593600 StatsigClient.updateUserImpl(_:completion:) + 4334876160 (<compiler-generated>:4334876160)
4  AppName                        0x594254 partial apply for closure #2 in StatsigClient.updateUser(_:completion:) + 4334879316 (<compiler-generated>:4334879316)
5  AppName                        0x589f74 thunk for @escaping @callee_guaranteed () -> () + 4334837620 (<compiler-generated>:4334837620)
6  libdispatch.dylib              0x24b4 _dispatch_call_block_and_release + 32
7  libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
8  libdispatch.dylib              0x127f4 _dispatch_main_queue_drain + 928
9  libdispatch.dylib              0x12444 _dispatch_main_queue_callback_4CF + 44
10 CoreFoundation                 0x9a6d8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
11 CoreFoundation                 0x7c03c __CFRunLoopRun + 2036
12 CoreFoundation                 0x80ec0 CFRunLoopRunSpecific + 612
13 GraphicsServices               0x1368 GSEventRunModal + 164
14 UIKitCore                      0x3a186c -[UIApplication _run] + 888
15 UIKitCore                      0x3a14d0 UIApplicationMain + 340
16 AppName                        0x36b5c main + 41 (AppDelegate.swift:41)
17 ???                            0x1f21f6960 (Missing)

(73% iOS 16, 25% iPadOS 16, 2% iPadOS 15)

We couldn't reproduce the crash, and only saw it from crash logs.

tore-statsig commented 1 year ago

Heads up @daniel-statsig

daniel-statsig commented 1 year ago

https://github.com/statsig-io/ios-sdk/releases/tag/v1.18.2 Has been published to try address this.

I am also unable to repro, are you able to update and share if this version fixes the issue?

jtbergman commented 1 year ago

Hi @daniel-statsig this specific crash in v1.18.0 was fixed by updating to v1.18.2, but a new crash was introduced. I put up a PR with the details here: https://github.com/statsig-io/ios-sdk/pull/4. I believe this new crash exists from v1.18.2 through the latest release.

daniel-statsig commented 1 year ago

Glad to hear. I will follow up on https://github.com/statsig-io/ios-sdk/pull/4