Skip to content

dirtyt analysis and OTHER instructions ? #7072

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

Closed
remi-delmas-3000 opened this issue Aug 16, 2022 · 9 comments
Closed

dirtyt analysis and OTHER instructions ? #7072

remi-delmas-3000 opened this issue Aug 16, 2022 · 9 comments
Assignees
Labels
aws Bugs or features of importance to AWS CBMC users aws-high bug soundness Soundness bug? Review and add "aws" if it is, or remove "soundness" if it isn't.

Comments

@remi-delmas-3000
Copy link
Collaborator

remi-delmas-3000 commented Aug 16, 2022

CBMC version: 5.63.0 (cbmc-5.63.0-41-g5a7a0a8801-dirty)
Operating system: macOS

dirtyt uses goto_programt::instructiont::apply to search for dirty symbols in instructions. goto_programt::instructiont::apply only visits the contents of an OTHER instruction if its statement attribute is an ID_expression :

void goto_programt::instructiont::apply(
  std::function<void(const exprt &)> f) const
{
  switch(_type)
  {
  case OTHER:
    if(get_other().get_statement() == ID_expression)
      f(to_code_expression(get_other()).expression());
    break;
 ....
}

Since OTHER operations can also have statement be equal to ID_array_set, ID_array_copy, ID_array_replace, ID_asm, etc. is it possible that dirtyt would miss anything of importance ?

@remi-delmas-3000 remi-delmas-3000 added bug aws Bugs or features of importance to AWS CBMC users aws-high soundness Soundness bug? Review and add "aws" if it is, or remove "soundness" if it isn't. labels Aug 16, 2022
@remi-delmas-3000 remi-delmas-3000 changed the title dirtyt analysis can miss some dirty locals dirtyt analysis and OTHER instructions ? Aug 17, 2022
@martin-cs
Copy link
Collaborator

Using OTHER for array copy and replace (rather than using builtin functions) feels like a mistake. It certainly wasn't implemented uniformly and the handling of OTHER is patchy at best. See #4323 for the last discussion of this. I think I agree with the conclusion that OTHER should be replaced or at least minimised, especially given the growth of use of builtin functions.

@tautschnig tautschnig self-assigned this Sep 2, 2022
@tautschnig
Copy link
Collaborator

Notwithstanding what @martin-cs said: the changes in #7085 should be moved to the actual dirtyt implementation instead of code contracts rolling its own.

@martin-cs
Copy link
Collaborator

Agree with @tautschnig . Let's not have multiple copies of the same code again; it takes ages to de-duplicate them.

@jimgrundy
Copy link
Collaborator

So, who's moving this code then? Michael seems to be doing a bunch of stuff, should we assign Remi?

@remi-delmas-3000
Copy link
Collaborator Author

I can take the action. If things break as a result I might need help.

@remi-delmas-3000 remi-delmas-3000 self-assigned this Sep 6, 2022
@remi-delmas-3000
Copy link
Collaborator Author

Notwithstanding what @martin-cs said: the changes in #7085 should be moved to the actual dirtyt implementation instead of code contracts rolling its own.

Could we also consider modifying goto_programt::instructiont::apply to traverse all subnodes of OTHER instructions and not just ID_expression ?

@martin-cs
Copy link
Collaborator

martin-cs commented Sep 7, 2022 via email

@martin-cs
Copy link
Collaborator

martin-cs commented Sep 7, 2022 via email

@remi-delmas-3000
Copy link
Collaborator Author

Fixed by #7106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users aws-high bug soundness Soundness bug? Review and add "aws" if it is, or remove "soundness" if it isn't.
Projects
None yet
Development

No branches or pull requests

4 participants