bizz84 / bizz84/SwiftyStoreKit
Urgent: PaymentQueueController crash in IOS 12
- Dominant language
- Swift
- Stars
- 6.7k
- Forks
- 801
- PR merge metrics
- No merged PRs in 30d
Description
### Platform
- iOS 12
### In app purchase type
- Auto-Renewable Subscription
### Environment
- Production
### Version
0.13.2
### Issue summary
Sometime application crashes on restore and startPayment. Repoduced on IOS 12. Looks like
`unowned let paymentQueue: PaymentQueue` in PaymentQueueController.swift deallocated when we trying to read it.
## Report
#0. Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1c7c83104 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1c7cff020 pthread_kill$VARIANT$mp + 380
2 libsystem_c.dylib 0x1c7bdad78 abort + 140
3 libswiftCore.dylib 0x10139d9d0 swift_vasprintf(char**, char const*, char*) + 54
4 libswiftCore.dylib 0x10139db0c swift::swift_abortRetainUnowned(void const*) + 32
5 libswiftCore.dylib 0x1013d7b2c swift_unknownUnownedTakeStrong + 70
6 SwiftyStoreKit 0x100fca854 PaymentQueueController.startPayment(_:) (PaymentQueueController.swift:131)
7 SwiftyStoreKit 0x100fd7cd4 closure #1 in SwiftyStoreKit.purchaseProduct(_:quantity:atomically:applicationUsername:simulatesAskToBuyInSandbox:completion:) ()
8 SwiftyStoreKit 0x100fddbe0 partial apply for closure #1 in SwiftyStoreKit.purchaseProduct(_:quantity:atomically:applicationUsername:simulatesAskToBuyInSandbox:completion:) ()
9 SwiftyStoreKit 0x100fd1238 partial apply for thunk for @escaping @callee_guaranteed (@guaranteed RetrieveResults) -> () ()
10 SwiftyStoreKit 0x100fcf114 closure #1 in ProductsInfoController.retrieveProductsInfo(_:completion:) (ProductsInfoController.swift:68)
11 SwiftyStoreKit 0x100fbfc40 partial apply for closure #1 in InAppProductQueryRequest.performCallback(_:) ()
12 SwiftyStoreKit 0x100fc8e98 thunk for @escaping @callee_guaranteed () -> () ()
13 libdispatch.dylib 0x1c7b256c8 _dispatch_call_block_and_release + 24
14 libdispatch.dylib 0x1c7b26484 _dispatch_client_callout + 16
15 libdispatch.dylib 0x1c7ad29a4 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068
16 CoreFoundation 0x1c807dce4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
17 CoreFoundation 0x1c8078bac __CFRunLoopRun + 1964
18 CoreFoundation 0x1c80780e0 CFRunLoopRunSpecific + 436
19 GraphicsServices 0x1ca2f1584 GSEventRunModal + 100
20 UIKitCore 0x1f5288c00 UIApplicationMain + 212
21 MyApplication 0x1003a5d38 main (main.m:14)
22 libdyld.dylib 0x1c7b36bb4 start + 4
#Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1aeb1f104 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1aeb9b020 pthread_kill$VARIANT$mp + 380
2 libsystem_c.dylib 0x1aea76d78 abort + 140
3 libswiftCore.dylib 0x1017399d0 swift_vasprintf(char**, char const*, char*) + 54
4 libswiftCore.dylib 0x101739b0c swift::swift_abortRetainUnowned(void const*) + 32
5 libswiftCore.dylib 0x101773b2c swift_unknownUnownedTakeStrong + 70
6 SwiftyStoreKit 0x101374e98 static SwiftyStoreKit.restorePurchases(atomically:applicationUsername:completion:) (PaymentQueueController.swift:143)
7 MyApplication 0x1009ad060 protocol witness for Store.restorePurchases(completion:) in conformance SwiftyStoreAdapter ()
8 MyApplication 0x10099ff40 closure #1 in PurchaseController.restorePurchases(completion:) ()
9 MyApplication 0x1008a7bb4 thunk for @escaping @callee_guaranteed () -> () ()
10 libdispatch.dylib 0x1ae9c16c8 _dispatch_call_block_and_release + 24
11 libdispatch.dylib 0x1ae9c2484 _dispatch_client_callout + 16
12 libdispatch.dylib 0x1ae96e9a4 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068
13 CoreFoundation 0x1aef19ce4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
14 CoreFoundation 0x1aef14bac __CFRunLoopRun + 1964
15 CoreFoundation 0x1aef140e0 CFRunLoopRunSpecific + 436
16 GraphicsServices 0x1b118d584 GSEventRunModal + 100
17 UIKitCore 0x1dc274c00 UIApplicationMain + 212
18 MyApplication 0x1007f36f0 main (main.m:14)
19 libdyld.dylib 0x1ae9d2bb4 start + 4
Contributor guide
Assessment
This issue has not been assessed yet.