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

YAML: Relational invariants about escaped variables are incorrect (due to Apron->CIL conversion not considering escaping) #1547

Open
michael-schwarz opened this issue Jul 17, 2024 · 0 comments
Labels
bug sv-comp SV-COMP (analyses, results), witnesses unsound

Comments

@michael-schwarz
Copy link
Member

michael-schwarz commented Jul 17, 2024

Consider:

#include<pthread.h>
int *b;
pthread_mutex_t e;

void* other(void* arg) {
    *b = -100;

    return NULL;
}

void main() {
    pthread_t t;
    pthread_create(&t, NULL, other, NULL);
    int g = 8;

    b = &g;

    pthread_mutex_lock(&e);
}

We produce invariants 8LL - (long long )g >= 0LL and -8LL + (long long )g >= 0LL before the lock, where the latter does not hold.
It seems that the invariants talk about stale variables corresponding to locals and no appropriate filtering is performed when turning Apron things back into assertions to avoid writing out invariants that only speak about parts of the values of variables.

The last example in #1542 could also be a result of this, only that the claimed invariant holds in the concrete by coincidence.

Commands to reproduce

`./goblint --conf conf/traces-rel.json --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.relation.privatization mutex-meet-tid-cluster12 --enable allglobs -v --enable witness.yaml.enabled 1.c --set witness.yaml.path 1.yml`

./goblint --conf conf/traces-rel.json --set dbg.timeout 4000 --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.relation.privatization mutex-meet-tid-cluster12 1.c --enable allglobs --enable dbg.timing.enabled -v --set witness.yaml.validate ./1.yml

@sim642 sim642 added the sv-comp SV-COMP (analyses, results), witnesses label Jul 17, 2024
@jerhard jerhard changed the title YAML: Relational invaraints about escaped variables are incorrect (due to Apron->CIL conversion not considering escaping) YAML: Relational invariants about escaped variables are incorrect (due to Apron->CIL conversion not considering escaping) Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug sv-comp SV-COMP (analyses, results), witnesses unsound
Projects
None yet
Development

No branches or pull requests

2 participants