-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[clang analyzer] Z3 error: Argument #x00007fff at position 1 does not match declaration (declare-fun bvsle ((_ BitVec 16) (_ BitVec 16)) Bool) #43375
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
Comments
assigned to @haoNoQ |
I don't think this should block the release because Z3 support in the Static Analyzer was never declared stable to begin with. I doubt Clang is actually ever shipped with Z3 support; even if it is, it shouldn't be. I wish we had this, but we're not there yet :( I could try to take a look tho. |
Thanks! |
Yep, this is another issue related to the casts being dropped by the CSA :/ In particular, the haveSameType call in SimpleSValBuilder.cpp:98 returns that the two bit-vectors have the same width. The range constraint manager is more lenient about these width mismatches, but the solver will refuse to encode the program :/ The correct fix is to implement the whole truncation/extension in the CSA. Maybe we can have this task as part of GSOC this year? Maybe implement support for truncation/extension and floating-points :D |
As was mentioned above, I don't think we should block the release on this. |
It was really thoughtful to read this. I'm also expecting to bite back in the future if we can't deal with this issue. PS thanks Lebedev for the CC. |
We ignored the cast if the enum was scoped. This is bad since there is no implicit conversion from the scoped enum to the corresponding underlying type. The fix is basically: isIntegralOrEnumerationType() -> isIntegralOr**Unscoped**EnumerationType() This materialized in crashes on analyzing the LLVM itself using the Z3 refutation. Refutation synthesized the given Z3 Binary expression (`BO_And` of `unsigned char` aka. 8 bits and an `int` 32 bits) with the wrong bitwidth in the end, which triggered an assert. Now, we evaluate the cast according to the standard. This bug could have been triggered using the Z3 CM according to https://bugs.llvm.org/show_bug.cgi?id=44030 Fixes #47570 #43375 Reviewed By: martong Differential Revision: https://reviews.llvm.org/D85528
We ignored the cast if the enum was scoped. This is bad since there is no implicit conversion from the scoped enum to the corresponding underlying type. The fix is basically: isIntegralOrEnumerationType() -> isIntegralOr**Unscoped**EnumerationType() This materialized in crashes on analyzing the LLVM itself using the Z3 refutation. Refutation synthesized the given Z3 Binary expression (`BO_And` of `unsigned char` aka. 8 bits and an `int` 32 bits) with the wrong bitwidth in the end, which triggered an assert. Now, we evaluate the cast according to the standard. This bug could have been triggered using the Z3 CM according to https://bugs.llvm.org/show_bug.cgi?id=44030 Fixes llvm#47570 llvm#43375 Reviewed By: martong Differential Revision: https://reviews.llvm.org/D85528 (cherry picked from commit fd7efe3)
Extended Description
Was playing around with clang trunk + Z3 4.8.6 + CodeChecker --z3 on
and got the following crash
The text was updated successfully, but these errors were encountered: