Skip to content

Wrong report of assertion failure for access to shared memory through global pointer #305

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
danpoe opened this issue Nov 14, 2016 · 0 comments

Comments

@danpoe
Copy link
Contributor

danpoe commented Nov 14, 2016

In the following example, cbmc reports an assertion failure for assert(*v == 1). It is however able to correctly deduce v == &g in the other two assertions.

#include <pthread.h>
#include <assert.h>

int *v;
int g;

void *thread1(void * arg)
{
  v = &g;
}

void *thread2(void *arg)
{
  assert(v == &g);
  *v = 1;
}

int main()
{
  pthread_t t1, t2;

  pthread_create(&t1, 0, thread1, 0);
  pthread_join(t1, 0);

  pthread_create(&t2, 0, thread2, 0);
  pthread_join(t2, 0);

  assert(v == &g);
  assert(*v == 1);

  return 0;
}

This is regression test regression/cbmc/concurrency/global_pointer1 in #303 .

smowton pushed a commit to smowton/cbmc that referenced this issue May 9, 2018
…from_elements

SEC-173: Added end-to-end test 'taint_array_from_elements'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants