-
Notifications
You must be signed in to change notification settings - Fork 84
Improve multi-threaded valid-memcleanup
#1246
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
sim642
merged 23 commits into
goblint:master
from
mrstanb:improve-multi-threaded-valid-memcleanup
Nov 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
f209afd
First attempt to improve precision for multi-threaded valid-memcleanup
mrstanb c0fe89e
Add regr. test cases for multi-threaded valid-memcleanup
mrstanb 7289ec3
Use solely local state for multi-threaded valid-memcleanup
mrstanb 720cfee
IsMallocCalled should be `may`
michael-schwarz af9ddc7
Add unsound example
michael-schwarz 0655fd6
Merge branch 'master' into improve-multi-threaded-valid-memcleanup
michael-schwarz ada8491
Make sound by accounting for alloc in global invariant
michael-schwarz e7d6302
Cleanup
michael-schwarz e6cee27
Fix `memtrack` for multi-threaded case
michael-schwarz 97eb715
Account for failing assertions in the multi-threaded case as well
mrstanb 987795e
Add a few more test cases
mrstanb 8d55024
Add options to produce warnings only for memory leaks
mrstanb ca61360
Add example where better privatization helps
michael-schwarz 2cc915f
Check at end of main thread that the program is certainly single-thre…
jerhard 45ec8a6
Add test case for memory leaking from a thead that is not joined, add…
jerhard 56c4d62
Add test case with pthread_exit called in main, remove threadid analy…
jerhard 2fef812
Add testcases for thread return and pthread_exit in thread different …
jerhard 645b03c
ThreadAnalysis: Handle pthread_exit like return from thread.
jerhard c6cb63e
Update tests/regression/76-memleak/16-no-mem-leak-thread-exit-main.c
jerhard f12a392
Remove call to free.
jerhard be9171b
Add annotation of nowarn next to pthread_exit.
jerhard 585a65d
Check in TheadAnalysis.return whether the return is actually a thread…
jerhard bc7694b
Add test case that checking that analysis distinguishes between threa…
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
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
18 changes: 18 additions & 0 deletions
18
tests/regression/76-memleak/15-mem-leak-not-joined-thread.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,18 @@ | ||
| //PARAM: --set ana.malloc.unique_address_count 1 --set ana.activated[+] memLeak --set ana.activated[+] thread --set ana.activated[+] threadid | ||
| #include <stdlib.h> | ||
| #include <pthread.h> | ||
|
|
||
| int *m1; | ||
|
|
||
| void *f1(void *arg) { | ||
| m1 = malloc(sizeof(int)); | ||
| while (1); | ||
| } | ||
|
|
||
| int main(int argc, char const *argv[]) { | ||
| pthread_t t1; | ||
| pthread_create(&t1, NULL, f1, NULL); | ||
|
|
||
| // memory from thread f1 which was not joined into main, is not freed | ||
| return 0; //WARN | ||
| } |
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.