swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.57k stars 10.36k forks source link

[SR-11709] Crash on build test target #54117

Closed krzyzanowskim closed 4 years ago

krzyzanowskim commented 5 years ago
Previous ID SR-11709
Radar None
Original Reporter @krzyzanowskim
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment Xcode 11.2 Xcode 11.1
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | @slavapestov | |Priority | Medium | md5: 02ac57564f6a8988bdbc07c01af2af8f

Issue Description:

1. clone https://github.com/krzyzanowskim/CryptoSwift/tree/3e911edb36b57de4fa37ecbb989fd3a0bc8c59b9

  1. Open CryptoSwift.xcodeproj in Xcode
  2. Select iPhone 11 as a Device
  3. Build test: Product -> Test

look at 76 `Abort trap: 6` errors. See attached build log.

slavapestov commented 5 years ago

The problem appears to be triggered by a combination of -enable-testing, -enable-library-evolution and -O. Here is a reduced test case:

public struct ResilientWrapper { 
  public let rawValue: Int
  static let foo = ResilientWrapper(rawValue: 0)
}

Reproduces on master as well. I'll have a fix shortly.

slavapestov commented 4 years ago

https://github.com/apple/swift/pull/28074