Skip to content

Reachability slice requires function bodies #6505

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

Merged
merged 3 commits into from
Feb 24, 2022

Conversation

tautschnig
Copy link
Collaborator

Reachability slicing relies on the CFG. The CFG, however, will not
contain edges from a function call to the next instruction when no body
is available for the function call. Therefore, reachability slicing
requires two steps:

  • The model library needs to be applied. CBMC already did so,
    goto-instrument now does with this commit.
  • Remaining function calls without body need to be replaced by
    nondet-return-value assignments.

Fixes: #6394

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Dec 4, 2021

Codecov Report

Merging #6505 (0359a87) into develop (afc53d8) will increase coverage by 0.00%.
The diff coverage is 92.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #6505   +/-   ##
========================================
  Coverage    76.73%   76.73%           
========================================
  Files         1579     1579           
  Lines       181999   182006    +7     
========================================
+ Hits        139652   139662   +10     
+ Misses       42347    42344    -3     
Impacted Files Coverage Δ
src/goto-instrument/reachability_slicer_class.h 100.00% <ø> (ø)
src/goto-programs/slice_global_inits.h 0.00% <0.00%> (ø)
src/goto-programs/string_instrumentation.h 0.00% <0.00%> (ø)
jbmc/src/jbmc/jbmc_parse_options.cpp 72.46% <50.00%> (ø)
src/cbmc/cbmc_parse_options.cpp 77.61% <100.00%> (+0.04%) ⬆️
.../goto-instrument/goto_instrument_parse_options.cpp 69.36% <100.00%> (+0.11%) ⬆️
src/goto-instrument/reachability_slicer.cpp 99.34% <100.00%> (+0.07%) ⬆️
src/goto-programs/remove_calls_no_body.cpp 100.00% <100.00%> (ø)
src/goto-programs/restrict_function_pointers.cpp 80.67% <100.00%> (+0.40%) ⬆️
src/memory-analyzer/gdb_api.h 100.00% <100.00%> (+9.52%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c351198...0359a87. Read the comment docs.

Copy link
Contributor

@NlightNFotis NlightNFotis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Michael, confirmed it works against the code in #6394 .

Thanks for handling this!

if(
cmdline.isset("add-library") || cmdline.isset("mm") ||
cmdline.isset("reachability-slice") ||
cmdline.isset("reachability-slice-fb") ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once upon a future... it'd be lovely if we had proper feature flags, grouping of feature flags, etc.... rather than sprinkling hardcoded strings all over the place :-)

This is a non-trivial implementation with external dependencies.
Upcoming changes will make it even more complex.
Reachability slicing relies on the CFG. The CFG, however, will not
contain edges from a function call to the next instruction when no body
is available for the function call. Therefore, reachability slicing
requires two steps:

- The model library needs to be applied. CBMC already did so,
goto-instrument now does with this commit.
- Remaining function calls without body need to be replaced by
nondet-return-value assignments.

Fixes: diffblue#6394
Use of this functionality will make symex warnings about functions
without body go away. To make up for this, at least status output should
be produced to ensure that this possible soundness issue of the
verification result can be caught.
@tautschnig tautschnig force-pushed the fix-reachability-slicer branch from 459ec09 to 0359a87 Compare February 8, 2022 14:08
@NlightNFotis NlightNFotis merged commit 37f122c into diffblue:develop Feb 24, 2022
@tautschnig tautschnig deleted the fix-reachability-slicer branch February 24, 2022 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reachability-slice changes verification from FAILED to SUCCESSFUL
5 participants