-
Notifications
You must be signed in to change notification settings - Fork 42
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
crux-llvm
crashes (Input block type ... does not match expected) during SSA conversion
#778
Comments
Some
Compare this to the basic block inputs after the offending commit:
Somehow,
Indeed, we can see that |
Hummm... the new debug statements might not be playing nicely with the SSA analysis for some reason... EDIT: nevermind, we're looking at the pre-SSA translation. |
Well, here's a chunk of the LLVM assembly from this program:
Notice that |
This looks like a |
A couple of things come to mind:
|
Here is a more minimal program showing the problematic behavior. shrink.c
The relevant section of
Here, |
Excellent sleuthing. Also, oof.
I brought up this topic on the LLVM Discord, and since at least two different people were surprised by this behavior, I went ahead and filed a bug here.
An excellent question. I can think of various workarounds:
Of those options, (3) sounds the most palatable to me. |
How challenging would it be to recognize the offending statements and just ignore the ones that violate the SSA invariant? |
Ah, that's an interesting idea—I'll call that option (4). @robdockins suggested in #778 (comment) that we should check for virtual register use-before-def errors during |
Just in practical terms, we might need to do the check in crucible-llvm somewhere before SSA conversion, because the SSA conversion doesn't get to know anything about the architecture extensions it is translating |
I think we should implement option 3 regardless; we probably want that to be the default for crux, since we aren't (currently?) making use of that debug information anyway. |
Unfortunately, Clang can sometimes generate ill-scoped `llvm.dbg` statements (see #778), so this patch adds a `debug-intrinsics` option that controls whether `llvm.dbg` statements should be translated at all. The default value for `crux-llvm` is `no`, as `crux-llvm` does not yet make use of `llvm.dbg` information. We may wish to revisit this choice in the future should the upstream LLVM bug (https://bugs.llvm.org/show_bug.cgi?id=51155) be fixed. Fixes #778.
Unfortunately, Clang can sometimes generate ill-scoped `llvm.dbg` statements (see #778), so this patch adds a `debug-intrinsics` option that controls whether `llvm.dbg` statements should be translated at all. The default value for `crux-llvm` is `no`, as `crux-llvm` does not yet make use of `llvm.dbg` information. We may wish to revisit this choice in the future should the upstream LLVM bug (https://bugs.llvm.org/show_bug.cgi?id=51155) be fixed. Fixes #778.
|
I'm not yet sure what a generic solution to this problem would look like. For what it's worth, there is a proposal to alter
If I understand that correctly, the author of the proposal wants to move away from debug statements specifying machine locations with virtual registers and instead have them specify machine locations by way of their defining instructions. Under such a proposal, debug statements would be permitted to "look forward in time". (The proposal link above contains the full motivation for why this is a useful thing to have, but it's not directly relevant to this conversation.) I mention this proposal because the author of the proposal has also suggested adopting a similar scheme for |
Unfortunately, Clang can sometimes generate ill-scoped `llvm.dbg` statements (see #778), so this patch adds a `debug-intrinsics` option that controls whether `llvm.dbg` statements should be translated at all. The default value for `crux-llvm` is `no`, as `crux-llvm` does not yet make use of `llvm.dbg` information. We may wish to revisit this choice in the future should the upstream LLVM bug (https://bugs.llvm.org/show_bug.cgi?id=51155) be fixed. Fixes #778.
Unfortunately, Clang can sometimes generate ill-scoped `llvm.dbg` statements (see #778), so this patch adds a `debug-intrinsics` option that controls whether `llvm.dbg` statements should be translated at all. The default value for `crux-llvm` is `no`, as `crux-llvm` does not yet make use of `llvm.dbg` information. We may wish to revisit this choice in the future should the upstream LLVM bug (https://bugs.llvm.org/show_bug.cgi?id=51155) be fixed. Fixes #778.
The popular opinion on https://bugs.llvm.org/show_bug.cgi?id=51155 seems to be that uses-before-defs in I propose that we go ahead with #782 and open a separate issue to discuss allowing programs like the one in #778 (comment) to work even when |
Unfortunately, Clang can sometimes generate ill-scoped `llvm.dbg` statements (see #778), so this patch adds a `debug-intrinsics` option that controls whether `llvm.dbg` statements should be translated at all. The default value for `crux-llvm` is `no`, as `crux-llvm` does not yet make use of `llvm.dbg` information. We may wish to revisit this choice in the future should the upstream LLVM bug (https://bugs.llvm.org/show_bug.cgi?id=51155) be fixed. Fixes #778.
Unfortunately, Clang can sometimes generate ill-scoped `llvm.dbg` statements (see #778), so this patch adds a `debug-intrinsics` option that controls whether `llvm.dbg` statements should be translated at all. The default value for `crux-llvm` is `no`, as `crux-llvm` does not yet make use of `llvm.dbg` information. We may wish to revisit this choice in the future should the upstream LLVM bug (https://bugs.llvm.org/show_bug.cgi?id=51155) be fixed. Fixes #778.
See also #798, which is about making programs like the one in #778 (comment) work with |
Consider this program, slightly minimized from SV-COMP's
soft_float_1-2a.c.cil.c
:Before commit 690d989,
crux-llvm
would verify this program. After commit 690d989, however,crux-llvm
crashes:The text was updated successfully, but these errors were encountered: