Skip to content

Mutex-Meet-TID without clusters more precise than approach with clusters #1551

@michael-schwarz

Description

@michael-schwarz

For the following small program:

#include<pthread.h>
pthread_mutex_t c;
int d, e, f;

void b(void* arg);

void main(int argc, char *argv) {
  pthread_t t;
  e = pthread_create(&t, 0, b, &f);
  pthread_mutex_lock(&c);
  d++;
  pthread_mutex_unlock(&c);
  pthread_mutex_lock(&c);
}
./goblint --conf conf/traces-rel.json --set ana.activated[+] threadJoins --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.relation.privatization mutex-meet-tid-cluster12 1.c --sets exp.relation.prec-dump cluster.prec
./goblint --conf conf/traces-rel.json --set ana.activated[+] threadJoins --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.relation.privatization mutex-meet-tid 1.c --sets exp.relation.prec-dump tid.prec
./apronPrecCompare cluster.prec tid.prec

we get

Apron Octagon(domain: Apron Octagon, privatization: PerMutexMeetPrivTID(cluster12,join)) less precise than Apron Octagon(domain: Apron Octagon, privatization: PerMutexMeetPrivTID(no-clusters,join)) (equal: 6, more precise: 0, less precise: 1, incomparable: 0, total: 7)

While such effects may happen due to W/N, it seems odd that it can be observed on such small programs. b having no implementation available seems crucial for this to happen, so it may be invalidation related somehow...

Detailed comparison

``` Apron Octagon(domain: Apron Octagon, privatization: PerMutexMeetPrivTID(no-clusters,join)): [|d-1.>=0; -d+1.>=0; -d+e+2147483649.>=0; d+e+2147483647.>=0; e+2147483648.>=0; -d-e+2147483648.>=0; d-e+2147483646.>=0; -e+2147483647.>=0; -d+f+2147483649.>=0; d+f+2147483647.>=0; -e+f+2147483648.>=0; e+f+2147483648.>=0; f+2147483648.>=0; -d-f+2147483648.>=0; d-f+2147483646.>=0; -e-f+2147483647.>=0; e-f+2147483648.>=0; -f+2147483647.>=0|] (env: [|0> __daylight:int; 1> __timezone:int; 2> argc#996:int; 3> d:int; 4> daylight:int; 5> e:int; 6> f:int; 7> timezone:int|]) more precise than Apron Octagon(domain: Apron Octagon, privatization: PerMutexMeetPrivTID(cluster12,join)): [|d-1.>=0; -d+1.>=0; -d+e+2147483649.>=0; d+e+2147483647.>=0; e+2147483648.>=0; -d-e+2147483648.>=0; d-e+2147483646.>=0; -e+2147483647.>=0; -d+f+2147483649.>=0; d+f+2147483647.>=0; -e+f+4294967295.>=0; e+f+4294967296.>=0; f+2147483648.>=0; -d-f+2147483648.>=0; d-f+2147483646.>=0; -e-f+4294967294.>=0; e-f+4294967295.>=0; -f+2147483647.>=0|] (env: [|0> __daylight:int; 1> __timezone:int; 2> argc#996:int; 3> d:int; 4> daylight:int; 5> e:int; 6> f:int; 7> timezone:int|]) reverse diff: -e+f+2147483648.>=0, -e-f+2147483647.>=0, e+f+2147483648.>=0, e-f+2147483648.>=0 ```

Metadata

Metadata

Labels

precisionrelationalRelational analyses (Apron, affeq, lin2var)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions