Runtime crash for build generated from Xcode 13.1 toolchain

Originator:madushan.rcg
Number:rdar://FB9963331 Date Originated:
Status:Open Resolved:
Product:iOS Product Version:
Classification:Compiler Reproducible:
 
Migrating to Xcode 13.1 toolchain has caused a crash on device builds. No crash happen on simulator builds. 
Some build settings for device builds
Optimised for size
wmo enabled
LTO - incremental

We didn't manage to reproduce the crash on a example app after multiple attempts. 

```
Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libswiftCore.dylib            	0x00000001a6e16c3c swift_getAssociatedTypeWitnessSlowImpl+ 3767356 (swift::MetadataRequest, swift::TargetWitnessTable<swift::InProcess>*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolRequirement<swift::InProcess> const*, swift::TargetProtocolRequirement<swift::InProcess> const*) + 352
1   libswiftCore.dylib            	0x00000001a6e16c34 swift_getAssociatedTypeWitnessSlowImpl+ 3767348 (swift::MetadataRequest, swift::TargetWitnessTable<swift::InProcess>*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolRequirement<swift::InProcess> const*, swift::TargetProtocolRequirement<swift::InProcess> const*) + 344
2   libswiftCore.dylib            	0x00000001a6e14b3c swift_getAssociatedTypeWitness + 236
3   libswiftCore.dylib            	0x00000001a6bff6cc _SwiftNewtypeWrapper<>._rawHashValue+ 1574604 (seed:) + 72
4   <redacted>                          	0x0000000104f22e5c protocol witness for Hashable._rawHashValue(seed:) in conformance AVMetadataObjectType + 13102684 (<compiler-generated>:0)
5   libswiftCore.dylib            	0x00000001a6b46968 __RawDictionaryStorage.find<A>+ 817512 (_:) + 56
6   libswiftCore.dylib            	0x00000001a6d9d688 specialized Dictionary.init+ 3270280 (dictionaryLiteral:) + 796
7   libswiftCore.dylib            	0x00000001a6ad6d54 Dictionary.init+ 359764 (dictionaryLiteral:) + 24
8   <redacted>                          	0x000000010a76a090 specialized <redacted>.<redacted>() + 105668752 (<redacted>.swift:38)
9   <redacted>                          	0x000000010a76984c one-time initialization function for headline + 32
10  libdispatch.dylib             	0x00000001a2b0381c _dispatch_client_callout + 20
11  libdispatch.dylib             	0x00000001a2b050b4 _dispatch_once_callout + 32
12  libswiftCore.dylib            	0x00000001a6e3397c swift_once + 48
13  <redacted>                          	0x000000010a7696a8 <redacted>.caption.unsafeMutableAddressor + 105666216 (<redacted>Font.swift:103)
14  <redacted>                          	0x00000001044069b4 <redacted>().init() + 1452468 (<redacted>swift:58)
15  <redacted>                          	0x0000000104406f84 @objc <redacted>().init() + 1453956 (<compiler-generated>:0)
16  <redacted>                          	0x00000001044061d4 one-time initialization function for shared + 1450452 (<redacted>swift:65)
17  libdispatch.dylib             	0x00000001a2b0381c _dispatch_client_callout + 20
18  libdispatch.dylib             	0x00000001a2b050b4 _dispatch_once_callout + 32
19  libswiftCore.dylib            	0x00000001a6e3397c swift_once + 48
20  <redacted>                          	0x000000010442d444 closure #1 in <redacted> + 1610820 (AppDelegate.swift:117)
21  <redacted>                          	0x000000010442ba80 <redacted> + 1604224 (<compiler-generated>:0)
22  <redacted>                          	0x0000000104495a1c specialized <redacted>.init(<redacted>::) + 2038300 (<redacted>.swift:246)
23  <redacted>                          	0x0000000104493248 one-time initialization function for shared + 2028104 (<redacted>.swift:216)
24  libdispatch.dylib             	0x00000001a2b0381c _dispatch_client_callout + 20
25  libdispatch.dylib             	0x00000001a2b050b4 _dispatch_once_callout + 32
26  libswiftCore.dylib            	0x00000001a6e3397c swift_once + 48
27  <redacted>                          	0x00000001042f40d4 AppDelegate.<redacted>() + 327892 (<redacted>.swift:800)
28  <redacted>                          	0x00000001042f40f0 @objc AppDelegate.<redacted>() + 327920 (<compiler-generated>:0)
```

Comments


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!