Skip to content

Incompleteness with uninitialized pointer fields in dynamic objects #5519

Open
@kenmcmil

Description

@kenmcmil

CBMC version: 5.15.0
Operating system: MacOS
Exact command line resulting in the issue: cbmc --trace --unwind 10 test2.c
What behaviour did you expect: Assert "test" is valid
What happened instead: Assertion "test" was violated

File test2.c:

struct list {
  struct list *next;
};


int main() {
  struct list *a = malloc(sizeof(struct list));
  struct list *b = malloc(sizeof(struct list));
  struct list *p;
  struct list *q;
  __CPROVER_assume(p == a);
  __CPROVER_assume(p->next == q);
  __CPROVER_assume(q == b);
  __CPROVER_assume(q->next == 0);
  __CPROVER_assert(p->next->next == 0,"test");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    More info neededawsBugs or features of importance to AWS CBMC users

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions