New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-8980] Swift 4.2 runtime Segmentation Fault with release configuration #51484
Comments
Attached is a somewhat more detailed trace and associated info accessible from LLDB that was generated by reproducing the same crash with a Swift built in |
Comment by Dale Buckley (JIRA) @gwynne thats a great log, I'll be digging in how you managed to get something so detailed so I can use that method in future, thanks! |
It wasn't that magical ^^; No one in their right mind would actually try building an entire RelWithDebInfo Swift in a low-powered Docker container! (Fortunately, I'm not in my right mind |
(Wow. TIL that Jira can't handle emoji in its comment form. C'mon Atlassian!) |
Comment by Dale Buckley (JIRA) To be perfectly honest it didn't even occur to me to to build swift in release mode with debug configuration and then try to run vapor on that. I've only ever built swift once from scratch so it's not something I think about doing much. But lets face it, it's not ever day (in normal use cases for swift usage) you encounter a runtime bug that only happens on one platform and not the other, normally it's excellent people like yourself who have forged and smoothed out that path before I even get there. Learn something new every day |
Honestly I probably should have just built Swift in debug mode outright rather than mucking with release-debuginfo (which is actually much slower to build), so it's questionable whether I did anything too brilliant |
@swift-ci create |
Is this still relevant? |
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: