Skip to content

Pretty print __CPROVER_havoc_object in --show-goto-functions #6125

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
SaswatPadhi opened this issue May 14, 2021 · 0 comments · Fixed by #6174
Closed

Pretty print __CPROVER_havoc_object in --show-goto-functions #6125

SaswatPadhi opened this issue May 14, 2021 · 0 comments · Fixed by #6174
Assignees
Labels
aws Bugs or features of importance to AWS CBMC users enhancement

Comments

@SaswatPadhi
Copy link
Contributor

SaswatPadhi commented May 14, 2021

CBMC version: 5.30
Operating system: 10.15.7

Test case:

int main() {
  int a[64];
  __CPROVER_havoc_object(a);
}

Exact command line resulting in the issue:

$ goto-cc test.c -o test.gb && goto-instrument --show-goto-functions test.gb | tail
        signed int a[64l];
        // 1 file /Users/saspadhi/test.c line 3 function main
        irep("(\"code\" \"\" (\"typecast\" \"\" (\"address_of\" \"\" (\"index\" \"\" (\"symbol\" \"type\" (\"array\" \"\" (\"signedbv\" \"width\" (\"32\") \"#c_type\" (\"signed_int\")) \"#source_location\" (\"\" \"file\" (\"/Users/saspadhi/test.c\") \"line\" (\"2\") \"function\" (\"main\") \"working_directory\" (\"/Users/saspadhi/Repos/cbmc-wip\")) \"size\" (\"constant\" \"type\" (\"signedbv\" \"width\" (\"64\") \"#c_type\" (\"signed_long_int\")) \"value\" (\"40\"))) \"#source_location\" (\"\" \"file\" (\"/Users/saspadhi/test.c\") \"line\" (\"3\") \"function\" (\"main\") \"working_directory\" (\"/Users/saspadhi/Repos/cbmc-wip\")) \"identifier\" (\"main::1::a\") \"#lvalue\" (\"1\")) \"\" (\"constant\" \"type\" (\"signedbv\" \"width\" (\"64\") \"#c_type\" (\"signed_long_int\")) \"value\" (\"0\")) \"type\" (\"signedbv\" \"width\" (\"32\") \"#c_type\" (\"signed_int\"))) \"type\" (\"pointer\" \"\" (\"signedbv\" \"width\" (\"32\") \"#c_type\" (\"signed_int\")) \"width\" (\"64\"))) \"type\" (\"pointer\" \"\" (\"empty\" \"#source_location\" (\"\" \"file\" (\"<builtin-architecture-strings>\") \"line\" (\"20\") \"working_directory\" (\"/Users/saspadhi/Repos/cbmc-wip\"))) \"#source_location\" (\"\" \"file\" (\"<builtin-architecture-strings>\") \"line\" (\"20\") \"working_directory\" (\"/Users/saspadhi/Repos/cbmc-wip\")) \"width\" (\"64\"))) \"type\" (\"empty\") \"#source_location\" (\"\" \"file\" (\"/Users/saspadhi/test.c\") \"line\" (\"3\") \"function\" (\"main\") \"working_directory\" (\"/Users/saspadhi/Repos/cbmc-wip\")) \"statement\" (\"havoc_object\"))")
        // 2 file /Users/saspadhi/test.c line 4 function main
        dead a;
        // 3 file /Users/saspadhi/test.c line 4 function main
        return NONDET(signed int);
        // 4 file /Users/saspadhi/test.c line 4 function main
        END_FUNCTION

What behaviour did you expect:
Some readable expression for the __CPROVER_havoc_object call.

What happened instead:
An overly verbose debug output for the irep is printed.

Additional context:
We generate calls to __CPROVER_havoc_object when enforcing loop contracts (may be function contracts too, @feliperodri?). So the --show-goto-functions output for programs that use contracts often end up with unreadable blobs like this.

@SaswatPadhi SaswatPadhi added enhancement aws Bugs or features of importance to AWS CBMC users labels May 14, 2021
@SaswatPadhi SaswatPadhi self-assigned this Jun 12, 2021
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 enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant