-
Notifications
You must be signed in to change notification settings - Fork 84
ThreadEscape: Collect set of escaping threads flow-insensitively #1078
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 12 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
070f7ca
Add test case where escaped local has unsound value.
jerhard 843e0dc
Remove race annotation, as this is secondary for this test case.
jerhard 87a10f9
Move failing test with local escaping into escape test folder, simpli…
jerhard f2c2145
ThreadEscape: Extract function emitting events.
jerhard df407b1
Add simple failiing test case due to unsound escape analysis.
jerhard 9143b2a
ThreadEscape: collect which threads escaped variables in flow-insensi…
jerhard cbfe7b6
ThreadEscape: also answer whether variable escaped in singlethreaded …
jerhard 7533309
Add test case, extend test case with interval checks.
jerhard fb90c45
Indent threadEscape.ml
jerhard 558ae51
ThreadEscape: add escaped to local state in threadenter.
jerhard 3fd471c
Enable intervals for test case.
jerhard 006d4ea
ThreadEscape: Check for uniquness of thread.
jerhard 7d70907
RelationAnalysis.threadenter: include reachable thread create args in…
jerhard 44d560e
ThreadEscape.threadenter: set local state (i.e., variables secaped in…
jerhard fb93563
Remove debug output.
jerhard 83e87e5
Revert "RelationAnalysis.threadenter: include reachable thread create…
jerhard 6b6c00f
Fix apron threadenter for unreached fixedpoint for 63/16.
jerhard 3d60727
RelationAnalysis.threadenter: Deduplicate code with enter.
jerhard a8c6722
Extract check for thread-uniqueness out.
jerhard 491dfbd
Move copy of relation to ensure that ctx.local.rel is not changed by …
jerhard 44233f6
Move RD.copy up, so that copy is performed on possibly smaller rel.
jerhard 90016e1
AffineEqualityDomain: Perform explicit copy in add_vars, drop_vars, k…
jerhard 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // PARAM: --enable ana.int.interval | ||
| #include<stdlib.h> | ||
| #include<pthread.h> | ||
| #include<goblint.h> | ||
| #include<unistd.h> | ||
|
|
||
| int g = 0; | ||
| int *p = &g; | ||
|
|
||
|
|
||
| void *thread1(void *pp){ | ||
| int x = 23; | ||
| __goblint_check(x == 23); | ||
| p = &x; | ||
| sleep(2); | ||
| __goblint_check(x == 23); //UNKNOWN! | ||
| __goblint_check(x <= 23); | ||
| __goblint_check(x >= 1); | ||
|
|
||
| return NULL; | ||
| } | ||
|
|
||
| void *thread2(void *ignored){ | ||
| sleep(1); | ||
| int *i = p; | ||
| *p = 1; | ||
| return NULL; | ||
| } | ||
|
|
||
| int main(){ | ||
| pthread_t t1; | ||
| pthread_t t2; | ||
| pthread_create(&t1, NULL, thread1, NULL); | ||
| pthread_create(&t2, NULL, thread2, NULL); | ||
| pthread_join(t1, NULL); | ||
| pthread_join(t2, NULL); | ||
| } | ||
|
|
22 changes: 22 additions & 0 deletions
22
tests/regression/45-escape/07-local-in-global-after-create.c
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,22 @@ | ||
| // SKIP | ||
| #include <pthread.h> | ||
| #include <goblint.h> | ||
|
|
||
| int* gptr; | ||
|
|
||
| void *foo(void* p){ | ||
| *gptr = 17; | ||
| return NULL; | ||
| } | ||
|
|
||
| int main(){ | ||
| int x = 0; | ||
| __goblint_check(x==0); | ||
| pthread_t thread; | ||
| pthread_create(&thread, NULL, foo, NULL); | ||
| gptr = &x; | ||
| sleep(3); | ||
| __goblint_check(x == 0); // UNKNOWN! | ||
| pthread_join(thread, NULL); | ||
| return 0; | ||
| } |
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,31 @@ | ||
| //PARAM: --enable ana.int.interval | ||
| #include<stdlib.h> | ||
| #include<pthread.h> | ||
| #include<goblint.h> | ||
| #include<unistd.h> | ||
|
|
||
| int g = 0; | ||
| int *p = &g; | ||
|
|
||
|
|
||
| void *thread1(void *pp){ | ||
| int x = 23; | ||
| __goblint_check(x == 23); | ||
| p = &x; | ||
| sleep(2); | ||
| __goblint_check(x == 23); //UNKNOWN! | ||
| __goblint_check(x <= 23); | ||
| __goblint_check(x >= 1); | ||
|
|
||
| int y = x; | ||
| return NULL; | ||
| } | ||
|
|
||
| int main(){ | ||
| pthread_t t1; | ||
| pthread_t t2; | ||
| pthread_create(&t1, NULL, thread1, NULL); | ||
| sleep(1); | ||
| *p = 1; | ||
| } | ||
|
|
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.
Uh oh!
There was an error while loading. Please reload this page.