-
Notifications
You must be signed in to change notification settings - Fork 102
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
Rework of the support for builtins #1435
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I have one suggestion for improvement.
@fbrausse @rafaelsamenezes @lucasccordeiro folks, how do I run this on sv-comp? It's a pretty big change, so I think we should validate this PR there, specially since it changes code related to concurrency (which I know very little about). |
6a8a957
to
770b9cc
Compare
When you go to "Actions" in Github, select "Run Benchexec" and press "Run workflow" on the right, you can choose the branch to run it over. The defaults run the entire sv-benchmarks with a 30s timeout. |
got it working but the generate diff action doesn't seem to be working. How do you folks check the results? I downloaded the output but it only contains a bunch of witnesses. |
This PR:
Master:
|
Yeah, I need to know which ones failed :/ My guess is that the __builtin_unreachable() calls in the frontend are prematurely aborting verification: esbmc will crash even if the unsupported functions are never called |
@rafaelsamenezes lucas told me you have a script to find out which test failed, can you share it? |
I just download the artifacts and run
|
I have these 3 helper scripts to work with the sv-comp results: sv-comp-scripts.tar.gz
|
The Windows build fails on
|
a566e18
to
6f3ea1c
Compare
This PR:
Master:
Nice improvement over master on correct results, but too many incorrect results still |
I've tested all the new incorrect false and they are also reported by the master branch; this branch is just faster. I'll rerun the master branch on sv-comp, but otherwise, this should be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this PR, @mikhailramalho.
Can I ask you please to provide the names of the benchmarks that are giving incorrect results?
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
…, so their type shouldn't be the function type, but the return type Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
… easier to define an atomic scope there Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
…since its symbol was already added in during convert Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
1f59cc2
to
fb635b7
Compare
@rafaelsamenezes: Is our windows CI broken? |
Not really, the issue is that the failing test is calling __sync_fetch_and_add, which is gcc specific. |
Latest result:
Master:
Closer results now, I'll check the missing correct true but I guess it's only noise. |
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
…cc builtin Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
The CI is broken due to issue #1559, I submitted another PR to fix that first. |
This should be good to go now |
Thanks for submitting this PR, @mikhailramalho. |
Otherwise, `symex_function_call` would also increment pc, when a body for a builtin is not available. Bug appears to have been introduced in #1435. --------- Co-authored-by: intrigus <abc123zeus@live.de>
This PR is part of a series of PRs derived from #876: although that PR was accepted, it's been a nightmare to rebase, so I decided to split it.
This PR changes how esbmc handles builtins: we no longer need to define new names in the preprocessor (via -D), but instead check for the functions we support or abort, similar to how intrinsics are handled.
As the first implementation, this PR changes how the
__sync_fetch_and_*
,atomic_store/_load
, and thebuiltin_*_overflows
functions are handled. Bonus that we got rid of the 1238 defines to support all thebuiltin_*_overflows
in the frontend.For the polymorphic builtins (like atomic_store/load, sync_fetch_*) the implementation creates the new function bodies in the frontend. I implemented about half of them, so some are missing. I've added a
__builtin_unreachable();
call to the missing implementations so esbmc will crash on unsupported calls. It should be easy to implement these new functions and it's left as an exercise to the reader.There are also new tests for
builtin_*_overflows
function and atomic_load/store, which we didn't have before (these functions are used in the aws benchmarks).