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-3446] Implement in the driver a state dumper when a crash is detected #46034
Comments
@belkadan Thoughts? |
Okay, let's see. I ignored this when Michael first filed it because I figured it was intractable or at least impractical, but Clang being able to do this even in the presence of modules means that a bunch of the worst problems have been solved. Let's take just the simplest approach: a crash during type-checking or SIL optimization, where re-running the same compiler will very likely end up with the same crash. What information do we need to collect/modify?
I think that's all you'd need to handle regular frontend crashes. For crashes in the merge-modules phase, we'd go a bit further and add the partial modules into the mix, which shouldn't be hard because they're inputs of the merge-modules frontend invocation. |
@belkadan Thanks for looking at this. Being able to do this automagically would make it significantly easier for us to improve the quality of the compiler and make our users happy that they do not need to "construct" a test case. That being said, I think we would need to have some sort of modal dialog for automatic sending (or maybe something that lets the user attach it to a radar). Perhaps we can obfuscate/minify (not sure). |
I'm very concerned about obfuscation because (sadly) some parts of the compiler use user-written names for ordering, and therefore we might lose the bug. (Thinking of protocol ordering in particular, which is used for generic signature canonicalization.) |
Ok. Even without the obfuscation I think it is still worth it. |
Additional Detail from JIRA
md5: 2fd1e26deeddd3e7f98fc4018716d178
Issue Description:
One thing that we have in clang that would be very useful in Swift is the ability to do a dump of the compiling module when the compiler crashes.
At a high level, I believe the problem basically comes down to the driver determining how far into the compilation the crash happened, rerunning to before that stage and dumping all intermediate, ast, sib files, packaging those up into a zip file.
My proposal for how to do this is to create a global variable that shows the stage of the compilation and have an RAII struct that sets up a signal handler that catches the signal and exits with the value in the global.
The text was updated successfully, but these errors were encountered: