Skip to content

goto-harness (memory snapshot): static array identifier not found #9078

Description

@rosabot-allegro

I'm having an Invariant check failing on static arrays while calling goto-harness from a memory snapshot.

CBMC version: 6.9.0

Here is a minimal example:

static const int my_static_array[] = {1, 2};
int var;

void f() {
    int tmp = my_static_array[0];
}

int main() {
    f();
    return 0;
}

goto-gcc -g main.c -o main.gb

memory-analyzer --symtab-snapshot --json-ui --breakpoint main.c:9 --symbols var main.gb > snapshot.json

goto-harness main.gb harness.c --harness-type initialize-with-memory-snapshot --harness-function-name generated_harness_test_function --memory-snapshot snapshot.json --initial-goto-location f

Output of goto-harness:

--- begin invariant violation report ---
Invariant check failed
File: ../src/util/namespace.h:49 function: lookup
Condition: !not_found
Reason: we are assuming that a name exists in the namespace when this function is called - identifier my_static_array was not found
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions