Skip to content

Unexpected failure with array_copy/array_equals #8176

Open
@remi-delmas-3000

Description

@remi-delmas-3000

The assertion in this program fails unexpectedly, but passes with size = N for many different concrete N

#include <stdlib.h>
#include <assert.h>
size_t nondet_size_t();
int main() {
  size_t size = nondet_size_t();
  if (0 < size && size <= __CPROVER_max_malloc_size) {
    char *a = malloc(size);
    char *b = malloc(size);
    __CPROVER_array_copy(a, b);
    assert(__CPROVER_array_equal(a, b));
  }
}

CBMC version: 5.95.1
Operating system: Ubuntu 20.04, macOS 14.3
Exact command line resulting in the issue: cbmc array_copy.c
What behaviour did you expect: SUCCESS for assert(__CPROVER_array_equal(a, b));
What happened instead: FAILURE for assert(__CPROVER_array_equal(a, b));

Metadata

Metadata

Assignees

No one assigned

    Labels

    awsBugs or features of importance to AWS CBMC usersaws-highpending merge

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions