Skip to content
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

Shadow memory initialization functions #7836

Merged
merged 4 commits into from
Aug 7, 2023

Conversation

esteffin
Copy link
Contributor

@esteffin esteffin commented Aug 2, 2023

PR adding implementation for the Shadow memory initialization functions.

Unit tests will be added when the remaining components will be added.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@esteffin esteffin force-pushed the esteffin/shadow-memory-init branch 2 times, most recently from 5dd8480 to 3bf8f24 Compare August 2, 2023 17:10
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Patch coverage: 76.57% and no project coverage change.

Comparison is base (1ecce42) 78.79% compared to head (4f5df20) 78.80%.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop    #7836    +/-   ##
=========================================
  Coverage    78.79%   78.80%            
=========================================
  Files         1698     1698            
  Lines       194641   194745   +104     
=========================================
+ Hits        153374   153467    +93     
- Misses       41267    41278    +11     
Files Changed Coverage Δ
src/goto-symex/shadow_memory.h 100.00% <ø> (ø)
src/goto-symex/shadow_memory.cpp 75.69% <72.52%> (+2.36%) ⬆️
src/goto-symex/shadow_memory_util.cpp 96.55% <95.00%> (-3.45%) ⬇️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

symbol.is_auxiliary) ||
!symbol.is_static_lifetime)
return;
if(id2string(symbol.name).find("__cs_") != std::string::npos)
Copy link
Member

Choose a reason for hiding this comment

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

This case needs to be handled by some future filter option. I'd remove it for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We added a TODO comment saying that the filtering will be done when the last functionalities are added, so we will have more confidence that we are not adding regressions.

{
return;
}
if(symbol_name.find("__cs_") != std::string::npos)
Copy link
Member

Choose a reason for hiding this comment

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

Same here (filter option).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As above

symbol_name.find("::return_value") == std::string::npos)
return;
if(
symbol_name.find("malloc::") != std::string::npos &&
Copy link
Member

Choose a reason for hiding this comment

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

These filters should be made more precise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As above

@esteffin esteffin force-pushed the esteffin/shadow-memory-init branch from 3bf8f24 to 8f57405 Compare August 4, 2023 14:55
@esteffin esteffin marked this pull request as ready for review August 4, 2023 15:01
@esteffin esteffin requested a review from a team August 4, 2023 15:01
peterschrammel and others added 4 commits August 7, 2023 12:25
Clean the given pointer expression so that it has the right
shape for being used for identifying shadow memory.
This handles some quirks regarding array sizes containing
L2 symbols and string constants not having char-pointer type.
Allocates shadows for a given original memory
for each declared field. The shadows are registered
in the shadow_memory_state (part of goto_symex_statet
to consider scoping of local shadows).

In the next step this functionality is used to
allocate shadow memory for the original memory
allocations encountered when symexing a
goto model.
This commit adds the implementation to the 4 shadow memory
user-facing initialization functions.
Namely:
 - shadow_memoryt::symex_field_static_init
 - shadow_memoryt::symex_field_static_init_string_constant
 - shadow_memoryt::symex_field_local_init
 - shadow_memoryt::symex_field_dynamic_init
@esteffin esteffin merged commit a82e456 into diffblue:develop Aug 7, 2023
34 of 35 checks passed
@esteffin esteffin deleted the esteffin/shadow-memory-init branch August 7, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants