-
Notifications
You must be signed in to change notification settings - Fork 80
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
Compiler Crash "Assertion !AS->hasBoundsExpr() failed" #526
Comments
https://github.com/AnnaKornfeldSimpson/parson/tree/crashRepro Terminal output: |
Yes, this is a compiler bug. The following small piece of code will trigger this crash:
It looks like we are accidentally walking a bounds expression that the compiler has inferred to use when implementing the dynamic check. We end up traversing the IR for the expression object->names[I] twice, which triggers the assert. |
The children() method for iterating over chidren of AST cast expressions was incorrectly including compiler-generated bounds expressions. Child AST nodes should be nodes that appear in the source program and additional information shouldn't be treated as child nodes. There were complex IR invariants about when a bounds expression stored within a cast expression was child AST node or not. This change fixes the bug and simplifies the AST invariants. This fixes issue #526. for cast expressions, there is now one entry for bounds expressions declared as part of the program. There are separate nodes for normalized bounds and inferred bounds. Testing: - Added a new regression test case for the failing case. - Passes existing Checked C and clang Checked C tests.
The children() method for iterating over chidren of AST cast expressions was incorrectly including compiler-generated bounds expressions. Child AST nodes should be nodes that appear in the source program and additional information shouldn't be treated as child nodes. There were complex IR invariants about when a bounds expression stored within a cast expression was child AST node or not. This change fixes the bug and simplifies the AST invariants. This fixes issue #526. for cast expressions, there is now one entry for bounds expressions declared as part of the program. There are separate nodes for normalized bounds and inferred bounds. Testing: - Added a new regression test case for the failing case. - Passes existing Checked C and clang Checked C tests.
I made a change that I was certain was incorrect, but I wanted to see what guidance I would get from the error message. Instead, it seems to have been sufficiently unpredictable as to crash the compiler.
It prints the error message including
Assertion !AS->hasBoundsExpr() failed
then pauses for several seconds before printing the stack trace.Attached are the information printed in the terminal window, and files specified in the bug report instructions (remove extra ".txt" extension after downloading).
clangCrashTerminalOutput.txt
parson-3e2b4f.c.txt
parson-3e2b4f.sh.txt
tests-c3dc85.c.txt
The text was updated successfully, but these errors were encountered: