Closed sim642 closed 3 months ago
After cherry-picking this and #1430 onto #1417, the newly added tests seem to not terminate.
In 46/87
, this seems to be due to the line:
int r = __VERIFIER_nondet_bool();
If I replace it with
int top;
int r=0;
if(top) { r =1}
it works.
I guess it is the same problem as
// TODO: why nonterm without threadflag path-sens?
on master
I would guess the reason it works on master may be https://github.com/goblint/analyzer/pull/1475
Yes, if I turn off the special handling in branched_thread_creation ()
, it misbehaves.
Problem
As mentioned in https://github.com/goblint/analyzer/pull/1430#issuecomment-2075246339, privatizations don't do anything special with non-definite mutexes.
As the added test case shows, this is wrong and all of them are unsound.
Solution
As discussed during GobCon, the fix is to only call
lock
andunlock
of privatizations with definite mutexes. This PR adapts the recently-fixed-and-refactored (#1430) must lockset analysis logic to base and relation analyses for these events. Notably,unlock
of indefinite mutex calls privatization'sunlock
for all may-aliasing held locks. This PR also fixes the long-standing unsoundness in privatizations of unlocking unknown mutexes: just by unlocking all held locks unconditionally.