[SR-8980] Swift 4.2 runtime Segmentation Fault with release configuration #51484
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
Linux
Platform: Linux
optimized only
Flag: An issue whose reproduction requires optimized compilation
run-time crash
Bug → crash: Swift code crashed during execution
runtime
The Swift Runtime
Attachment: Download
Environment
Swift: 4.2
Ubuntu: 16.04
Additional Detail from JIRA
md5: c146b8eccd37e0dd9f848f4e6238e70d
Issue Description:
We have encountered an issue where Vapor 2.4.5 runs fine on the Swift 4.2 Ubuntu docker image in debug, but as soon as we change to building with the release configuration we get a Segmentation fault 19 out of 20 times we try to run the resulting executable. This doesn't happen when building with Xcode on macOS.
I have raised a bug on the Vapor Github repo (vapor/vapor#1829) informing them of this issue, but since it's a Swift runtime issue I thought it would be best to also raise a bug here so measures can be put in place to prevent it in future.
Reproduction Steps
Extract the example project (see attached) and navigate into the directory using terminal.
Run
Run
Run the resulting executable
Experience a Segmentation fault. (if it doesn't happen right away, stop the executable and run it again)
From a core dump it looks like there is some issue with the dynamic casting:
The text was updated successfully, but these errors were encountered: