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

Fix global_init for escaped globals in mutex-meet-tid cluster configuration #1481

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/analyses/apron/relationPriv.apron.ml
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,9 @@ struct
let g_var = V.global g in
(* normal (strong) mapping: contains only still fully protected *)
let g' = VS.singleton g in
let oct = LRD.find g' octs in
(* If there is no map entry yet which contains the global, default to top rather than bot *)
(* Happens e.g. in 46/86 because of escape *)
let oct = Option.default (RD.top ()) (LRD.find_opt g' octs) in
LRD.singleton g' (RD.keep_vars oct [g_var])

let lock_get_m oct local_m get_m =
Expand Down
21 changes: 21 additions & 0 deletions tests/regression/46-apron2/86-escape-cluster12.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SKIP PARAM: --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.relation.privatization mutex-meet-tid-cluster12
#include<pthread.h>
#include<goblint.h>
void *a;

void* nothing(void* arg) {
// Go multithreaded!
}

void main() {
pthread_t t;
pthread_create(&t, 0, nothing, 0);

int d = 5;
a = &d;

if (0)
;

__goblint_check(1); // Should be reachable!
}
Loading