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

Running example with SMACK #769

Open
m-carrasco opened this issue Nov 26, 2021 · 0 comments
Open

Running example with SMACK #769

m-carrasco opened this issue Nov 26, 2021 · 0 comments

Comments

@m-carrasco
Copy link

m-carrasco commented Nov 26, 2021

Hi,

I successfully created an interactive docker container following the documentation. However, I ran into some problems when testing this example.

user@555c547b444f:~/smack$ smack examples/rise4fun/rise_simple_buggy.c 
SMACK program verifier version 2.8.0
examples/rise4fun/rise_simple_buggy.c:9:3: warning: implicit declaration of function 'assert' is invalid in C99 [-Wimplicit-function-declaration]
  assert(z != 30);
  ^
1 warning generated.
SMACK found no errors with unroll bound 1.

Is this the expected behaviour?

Adding #include <assert.h> solves this problem, and the assertion violation is detected.

user@555c547b444f:~/smack$ smack examples/rise4fun/rise_simple_buggy.c
SMACK program verifier version 2.8.0
/usr/local/share/smack/lib/smack.c(1885,3): 
/usr/local/share/smack/lib/smack.c(1890,1): 
examples/rise4fun/rise_simple_buggy.c(9,9): smack:entry:main = -1032, z = 30
examples/rise4fun/rise_simple_buggy.c(10,3): CALL __VERIFIER_assert
/usr/local/share/smack/lib/smack.c(1606,29): __VERIFIER_assert:arg:x = 0
/usr/local/share/smack/lib/smack.c(52,3): 
examples/rise4fun/rise_simple_buggy.c(10,3): RETURN from __VERIFIER_assert
SMACK found an error.

If the header is missing from the file, I am more than willing to open a MR and fix it.

In a more general sense, should #include <assert.h> be always included? I think this question may be related to #627

Thanks for your time.

Kind regards,
Manuel

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

No branches or pull requests

1 participant