Incomplete crash reports when Swift generics are used

Originator:p4checo
Number:rdar://46576463 Date Originated:December 8 2018
Status:Closed Resolved:December 11, 2018
Product:Xcode Product Version:10.1 (10B61)
Classification: Reproducible:Always
 
Summary:
Crash reports of binaries generated with Xcode 10.1 using Swift generics have missing information, where the stack trace entries of specialized generic types contain "(<compiler-generated>:0)" as the symbol's type and location. 

It is obvious that this greatly limits the usefulness of crash reports, and makes analyzing and tracing issues much harder.

Please find attached an example of a raw crash report, its symbolicated version, the respective .ipa and zipped dSYM files.

Steps to Reproduce:
Force a crash on an app build with Xcode 10, where the stack trace uses Swift generics, and symbolicate it.

Expected Results:
The symbolicated crash report would contain correct type information and line number for all types (generic or not). Even though previously (Xcode 9) only the type name and line were reported (i.e. not the specialized generic types themselves), the ideal scenario would be that the base type and all specialized types were reported, together with the line number.

Actual Results:
The symbolicated crash report doesn't contain correct type information and line number for generic types (i.e. has "(<compiler-generated>:0)" entries on the stack).

Version/Build:
Version 10.1 (10B61)
iOS 12.1

Configuration:
macOS 10.14.1 (18B75)

Comments

"<compiler-generated>:0" means that this code was inserted by the Swift compiler and has no direct correspondence with any source code. This often happens for conversion functions of thunks injected by the Compiler.

Often symbolicating a crashlog with LLDB can better help understand what is going on, since LLDB an also decode inlined frames:

(lldb) script import lldb.macosx (lldb) crashlog "MyCrash.crash"

Currently only LLDB can do that.

Unfortunately, in it's current state the crashlog script also expects the original binary to be around, but you can trick it by copying the binary from inside the .dSYM/Contents/Resources/DWARF/ into the path it is looking for it. You can also edit the path in the crashlog before symbolicating.


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!