-
Notifications
You must be signed in to change notification settings - Fork 273
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
CBMC aborts path exploration when it cannot resolve a function pointer #6983
Comments
The argument type and parameter type are not compatible, so this isn't defined behaviour in the C standard. (I will therefore also remove the "soundness" label from this issue.) CBMC does not currently think that
If you don't use |
Why is it adding an |
Fair point, though it's harder for us to produce a warning here. |
In Kani we use |
Questions:
|
|
I actually don't think we need to. The use case I had in mind was to simplify our code generation, but we can (and should) just respect the C spec. My main problem is with the fact that CBMC just assume(0) at the else branch. This can lead to soundness issues if we encode anything incorrectly.
That's exactly what we need. I think it would make a lot of sense to just pick whatever encoding the user chooses for missing functions definitions but we're OK with a different flag.
We do enable --pointer-check. But for some reason I could not reproduce that yet in C. |
I think there is a soundness issue, but it might be related to
|
Oh, yes, in that case you'd have to use |
The case where a function pointer matches none of the candidate functions now introduces a call to a new function. No implementation of this function is provided, leaving the choice to the user in case they choose to use goto-instrument's generate-function-body. As doing so requires updates to goto_functions by the caller, two unused API variants of remove_function_pointers were removed. Fixes: diffblue#6983
#6987 now implements the proposed approach of introducing a dummy function (the behaviour of which you can configure when using |
The case where a function pointer matches none of the candidate functions now introduces a call to a new function. No implementation of this function is provided, leaving the choice to the user in case they choose to use goto-instrument's generate-function-body. As doing so requires updates to goto_functions by the caller, two unused API variants of remove_function_pointers were removed. Fixes: diffblue#6983
The case where a function pointer matches none of the candidate functions now introduces a call to a new function. No implementation of this function is provided, leaving the choice to the user in case they choose to use goto-instrument's generate-function-body. As doing so requires updates to goto_functions by the caller, two unused API variants of remove_function_pointers were removed. Fixes: diffblue#6983
The case where a function pointer matches none of the candidate functions now introduces a call to a new function. No implementation of this function is provided, leaving the choice to the user in case they choose to use goto-instrument's generate-function-body. As doing so requires updates to goto_functions by the caller, two unused API variants of remove_function_pointers were removed. Fixes: diffblue#6983
The case where a function pointer matches none of the candidate functions now introduces a call to a new function. No implementation of this function is provided, leaving the choice to the user in case they choose to use goto-instrument's generate-function-body. As doing so requires updates to goto_functions by the caller, two unused API variants of remove_function_pointers were removed. Fixes: diffblue#6983
The case where a function pointer matches none of the candidate functions now introduces a call to a new function. No implementation of this function is provided, leaving the choice to the user in case they choose to use goto-instrument's generate-function-body. As doing so requires updates to goto_functions by the caller, two unused API variants of remove_function_pointers were removed. Fixes: diffblue#6983
The case where a function pointer matches none of the candidate functions now introduces a call to a new function. No implementation of this function is provided, leaving the choice to the user in case they choose to use goto-instrument's generate-function-body. As doing so requires updates to goto_functions by the caller, two unused API variants of remove_function_pointers were removed. Fixes: diffblue#6983
#7011 at least addresses this part of the problem. |
Assigning Michael T so he can drive merging the PRs that would address this. |
Thanks @tautschnig! #7011 addresses my main concern which was interrupting the analysis without producing any error. |
CBMC version: 5.60
Operating system: Ubuntu 18.04
Exact command line resulting in the issue:
cbmc main.c
What behaviour did you expect: I expected that at least one of the assertions in this code would fail.
What happened instead: CBMC verification is successful.
This is the test case I created.
When I run
cbmc main.c
, I get the following:If I add
--pointer-check
there is one failure:When I execute this code after compiling it with either
gcc
orclang
, I get the following assertion failure:Questions?
assert(0)
statement to be reachable. Why isn't this the case?The text was updated successfully, but these errors were encountered: