Skip to content

goto-analyzer says __sputc is reachable in empty program #5173

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

Open
markrtuttle opened this issue Nov 6, 2019 · 7 comments
Open

goto-analyzer says __sputc is reachable in empty program #5173

markrtuttle opened this issue Nov 6, 2019 · 7 comments
Labels
aws Bugs or features of importance to AWS CBMC users bug Viewer Bugs and features related to CBMC Viewer

Comments

@markrtuttle
Copy link
Collaborator

CBMC version: 5.12 (cbmc-5.12-d8598f8-1270-g1ea1ede98)
Operating system: MacOS
Exact command line resulting in the issue: goto-analyzer --reachable-functions test.goto
What behaviour did you expect: Report main and __CPROVER_initialize reachable
What happened instead: Got also __sputc from stdio.h

I need help debugging odd behavior on MacOS. Consider the file test.c below.

#include <stdio.h>

int main(){
  return 0;
}

Run the commands

goto-cc -o test.goto test.c
goto-analyzer --reachable-functions test.goto

On MacOS, the result is unexpected:

/private/tmp/testing/test.c main 3 5
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h __sputc 264 269
/private/tmp/testing/<built-in-additions> __CPROVER_initialize 35 7

On Ubuntu 16, the result is expected:

/tmp/testing/test.c main 3 5
/tmp/testing/<built-in-additions> __CPROVER_initialize 35 7
@tautschnig
Copy link
Collaborator

This would require #2481 to be completed: __sputc is a function defined in stdio.h marked __attribute__((always_inline)), which we currently ignore.

@karkhaz karkhaz added the aws Bugs or features of importance to AWS CBMC users label Nov 13, 2019
@hannes-steffenhagen-diffblue
Copy link
Contributor

Can still reproduce as of November 5th 2020

@martin-cs
Copy link
Collaborator

@hannes-steffenhagen-diffblue : does this mean you are working on this?

@feliperodri
Copy link
Collaborator

@hannes-steffenhagen-diffblue any updates on this issue? Should we close it?

@hannes-steffenhagen-diffblue
Copy link
Contributor

I don't think this one should be closed, it just hasn't made it to the top of our backlog.

@martin-cs
Copy link
Collaborator

Might be effected by #5807

@markrtuttle
Copy link
Collaborator Author

The example still works as described with cbmc 5.37.

@jimgrundy jimgrundy added the bug label Aug 30, 2021
@feliperodri feliperodri changed the title goto-analyzer says __sputc is reachable in empty program. goto-analyzer says __sputc is reachable in empty program Oct 6, 2022
@feliperodri feliperodri added the Viewer Bugs and features related to CBMC Viewer label Oct 6, 2022
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 bug Viewer Bugs and features related to CBMC Viewer
Projects
None yet
Development

No branches or pull requests

7 participants