optimizely / swift-sdk

Swift SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
https://www.optimizely.com/products/full-stack/
Apache License 2.0
21 stars 30 forks source link

Intermittent crash when ProjectConfig is deinitialized #421

Closed hyperspacemark closed 2 years ago

hyperspacemark commented 3 years ago

We recently updated our SDK version to 3.8.0 to pick up #387 in order to fix a common crash. 3.8.0 has greatly reduced the crash rate but not entirely. In a relatively small number of cases, we're still seeing the following issue around ProjectConfig.

Crashed: AtomicProperty74567ProjectConfig
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000cf9dabc40

Crashed: AtomicProperty74567ProjectConfig
0  libobjc.A.dylib                0x1ae119020 objc_release + 16
1  Optimizely                     0x1079dcde8 outlined consume of Project? + 4394929640
2  Optimizely                     0x107a482a4 ProjectConfig.deinit + 19 (ProjectConfig.swift:19)
3  Optimizely                     0x107a48318 ProjectConfig.__deallocating_deinit + 19 (ProjectConfig.swift:19)
4  libswiftCore.dylib             0x19dadb420 _swift_release_dealloc + 40
5  Optimizely                     0x1079df700 thunk for @escaping @callee_guaranteed () -> () + 4394940160 (<compiler-generated>:4394940160)
6  libdispatch.dylib              0x19979724c _dispatch_call_block_and_release + 32
7  libdispatch.dylib              0x199798db0 _dispatch_client_callout + 20
8  libdispatch.dylib              0x1997a88c4 _dispatch_lane_concurrent_drain + 892
9  libdispatch.dylib              0x1997a0ccc _dispatch_lane_invoke + 520
10 libdispatch.dylib              0x19979bcb0 _dispatch_queue_override_invoke + 392
11 libdispatch.dylib              0x1997a993c _dispatch_root_queue_drain + 356
12 libdispatch.dylib              0x1997aa120 _dispatch_worker_thread2 + 116
13 libsystem_pthread.dylib        0x1e2fbc7c8 _pthread_wqthread + 216
14 libsystem_pthread.dylib        0x1e2fc375c start_wqthread + 8
jaeopt commented 3 years ago

@hyperspacemark Thanks for sharing the info. We'll take a look.

jaeopt commented 3 years ago

@hyperspacemark Can you share the OS version for the crash report?
Let us know if you see this issue for some specific iOS versions.

hyperspacemark commented 3 years ago

Hi @jaeopt, apologies for the late reply. 100% of these crashes occur on iOS 14.x.

jaeopt commented 3 years ago

@hyperspacemark We released v3.8.1 with a fix for this issue - https://github.com/optimizely/swift-sdk/releases/tag/v3.8.1 Let us know if it works for you.

hyperspacemark commented 3 years ago

@jaeopt Thanks! This just went out for us; will close this issue next week assuming the issue is resolved.

jaeopt commented 2 years ago

@hyperspacemark it'll be appreciated if you can give us an update on the issue, so we can close it