-
Notifications
You must be signed in to change notification settings - Fork 83
Ego-Lane-Derived-Digests for Privatizations: ProtectionBasedTIDPriv
#1398
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2d08c29
Typo
michael-schwarz 9f16774
ProtectionBasedTIDPriv
michael-schwarz 0dabb9d
Add protection-tid to available privatizations
michael-schwarz 4917725
Add test for protection-tid
michael-schwarz 8192f08
Use functor
michael-schwarz 352c404
Pass `ask` to `invariant_global`
michael-schwarz df0d0f5
Add second more involved example
michael-schwarz a64b85a
Add `protection-read-tid`
michael-schwarz 3deeba3
`protection-read-tid` in `options.schema.json`
michael-schwarz 508bf67
Fix semantics of `TID.is_must_parent` and resulting changes
michael-schwarz f27cfc6
Simplify
michael-schwarz 1c782bd
Rewrite `accounted_for` for more clarity
michael-schwarz 6961ad2
Comment on `ThreadDigest` vs `ThreadNotStartedDigest`
michael-schwarz 603b909
Typo
michael-schwarz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// PARAM: --set ana.base.privatization protection-tid | ||
#include <pthread.h> | ||
#include <goblint.h> | ||
|
||
int g; | ||
pthread_mutex_t m; | ||
|
||
void* spoiler() { | ||
int x; | ||
pthread_mutex_lock(&m); | ||
x=g; | ||
pthread_mutex_unlock(&m); | ||
} | ||
|
||
void* producer() | ||
{ | ||
pthread_mutex_lock(&m); | ||
g = 8; | ||
pthread_mutex_unlock(&m); | ||
return 0; | ||
} | ||
|
||
int main() | ||
{ | ||
pthread_t tid1; | ||
pthread_t tid2; | ||
|
||
pthread_create(&tid1, 0, spoiler, 0); | ||
|
||
pthread_mutex_lock(&m); | ||
__goblint_check(g == 0); | ||
pthread_mutex_unlock(&m); | ||
|
||
pthread_create(&tid2, 0, producer, 0); | ||
|
||
|
||
pthread_mutex_lock(&m); | ||
__goblint_check(g == 0); //UNKNOWN! | ||
pthread_mutex_unlock(&m); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does
protection-tid
use different digests thanmutex-meet-tid
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference is that
mutex-meet-tid
is equipped with aL
component that guarantees that all join-local contributions are already accounted for.protection-tid
instead does not track such a component and thus needs to rely purely on the refinement provided by the ego-lane-derived digest. I'll add a comment to this effect.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the digest modules don't have access to
mutex-meet-tid
'sL
, so how can it be coupled with that? Also in more-traces, the digest framework is introduced beforeL
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but things such as not reading from yourself and not reading from joined threads goes beyond what the digests can do, and relies on the analysis taking care of it in some way.
Consider e.g. reading from a thread that has been joined: It is possible that this thread held the mutex last before me, and thus the digests are
compatible
.It is only because the analyses also read from some L that this contribution is
accounted_for
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In more-traces this is the difference between
$$[[lock(a)]]^\sharp_\mathcal{A}(A_0,A_1) = \emptyset$$
and
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. I guess the coupling is kind of implicit here: this
accounted_for
assumes that the privatization actually accounts for things in itsthread_join
.