Fix unknown thread invalidation ordering - #2099
Conversation
What is a "thread-create result"? Is it the resulting abstract state, or is it the lvalue of And what are "thread initialization snapshots"?
Does "joining" mean something other than |
It's the |
It's the values published to
It's about the The problem is that the invalidations of the things reachable via the argument and the invalidation of the The join then gives you |
|
For e = pthread_create(&t, NULL, b, &f);the current code works as follows:
This ensures that |
Summary
Fix relational invalidation for unknown spawned functions.
The thread-create result and the unknown thread argument were invalidated in separate thread initialization snapshots. Joining those relational snapshots could introduce a spurious relation between the independently invalidated globals, causing an invalid witness invariant to be confirmed when side widening was disabled.
Apply the unknown function invalidation in
threadspawn, where the caller state already contains the invalidated thread-create result. For the first spawn, publish this combined state as the initialization snapshot; later spawns use ordinary privatized writes.threadenternow only initializes the child privatization state.The regression test disables side widening and independently checks both invalidated globals in addition to the previously spurious relational invariant.
Closes #2098