App crashes with EXC_BAD_ACCESS when trying to read description of SKProduct.priceLocale property.

Originator:s.pankevich
Number:rdar://33428237 Date Originated:
Status:Closed Resolved:
Product:Xcode/StoreKit Product Version:Version 9.0 beta 3 (9M174d)
Classification:Other bug Reproducible:Sometimes
 
Area:
StoreKit

Summary:
We have the following helper to describe the contents of SKProduct object:

  public static func describe(product: SKProduct) -> String {
    var components: [String] = []

    components.append("productIdentifier = \(product.productIdentifier)")
    components.append("localizedTitle = \(product.localizedTitle)")
    components.append("price = \(product.price)")
    components.append("priceLocale = \(product.priceLocale)")

    return "<SKProduct (\n\t\(components.joined(separator: ";\n\t"))\n)>"
  }

In Xcode Beta this method crashes on one of our products when we just try to print() to console a string that is based on the helper above. I am attaching all I can.

Steps to Reproduce:
Unfortunately, due to the nature of the bug I cannot know what are the exact details of our SKProduct that cause this crash to happen.

Expected Results:
We expect the app to not crash and the product to be described in the console.

Observed Results:
The app crashes with EXC_BAD_ACCESS.

Version:
Version 9.0 beta 3 (9M174d)

iPhone SE with iOS 11.0 (15A5318g)

Notes:
If I change this
"   
components.append("priceLocale = \(product.priceLocale)")
"
to
"
components.append("priceLocale.identifier = \(product.priceLocale.identifier)")
"

the app does not crash and prints expected identifier like 

"
(lldb) po product.priceLocale.identifier
"en_DE@currency=EUR"
"

Configuration:

Comments

This has been fixed in Xcode 9 beta 6.

By s.pankevich at Sept. 1, 2017, 12:57 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!