-
Notifications
You must be signed in to change notification settings - Fork 7
Explanations on how to make the silver searcher analysis more precise
#59
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Michael Schwarz <[email protected]>
|
Is there still something to do here, or should we merge it? |
sim642
left a comment
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.
I added your config (with region) and some patches.
| ### Split paths using annotation `__goblint_split_begin(matches == NULL);` on line 39 in `search.c`. Requires activating `expsplit` analysis. | ||
|
|
||
| Will remove the following warnings: |
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.
Is this still true? Doesn't seem to reduce anything for me.
| ### `lib.activated = default + "pcre"` | ||
|
|
||
| Removes 2 race warnings and some accesses that happen due to the missing library function definitions from `pcre`. | ||
| In addition, removes some `[Error][Imprecise][Unsound] Function definition missing ...` warnings if `warn.unsound` and `warn.error` were set to `true`. |
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.
Also zlib and liblzma now.
| read with mhp:{tid=zfile_seek; created=All Threads} (conf. 110) (exp: __dest) (/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:3-34:90) | ||
| ``` | ||
|
|
||
| ### Add `decompress_zlib` and `decompress_lzma` to `ana.malloc.wrappers` |
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.
This was probably useless.
This PR includes descriptions of configurations and annotations to make the analysis more precise on
the silver searcheras well as explanations on why/how they help with reducing the number of warnings.The goals are to:
Remaining races (28) (13.09.23):
decompress.c(4)HASH_ADDwrite accesses insearch.c(2):symhashis global but only used by main thread in multi-threaded mode, value must be computed flow-sensitively.Two accesses have
region:{symhash}, but third should have bullet, but doesn't.lzma_endread-write-spawn accesses indecompress.c(2):mallocFreshmight get rid of this (becauseregionanalysis gets rid of these withno region)buf_getlineshould return bullet from argument to another argument via pointer?ignore.c(3)print_context_appendinprint.c: things with_threadkeyword that are thread-local but the cases discussed in Ignore accesses to variables with__threadkeyword analyzer#1071, and anunknownptrcomes from the pointer in that thread-local variable beingNULLdue to globals init, although it is thread-local and initialized every time the new thread is created (and if not, the program crashes on its own anyways)main.c(1)options.c(4)print_context_appendinprint.c(4): same thread-local problem as inignore.coptions.h(8)print_context_appendinprint.c(4):regionsknows that those fields (opts.color_line_number,opts.color_match,opts.color_path,opts.query) are not modified elsewhereopts.stream_line_numwrite only and comment "This should totally not be in here"options.h(1)opts.match_founddoes not race with read, and has a comment "This should totally not be in here" inoptions.h(1)Could be protected by
print_mtx.opts.print_line_numbersreal race (1)Only written by main thread in multi-threaded mode before workers do any work (and read it) — value/cond based.
Some workers might already start and read when
search_diris still adding to queue and writing!opts.print_pathreal race (1)Writes are safe: only written by main thread in multi-threaded mode before workers do any work (and read it) or with
print_mtx.Some reads without
print_mtx, insearch_stream? Looks like real race.util.c(2)mallocFreshanalysis (which @karoliineh tried to fix, but the wholemallocFreshcame out to be unsound and that is not resolved yet Improve mallocFresh analysis analyzer#1069): the races are onmatcheswhich is fresh (2):regionanalysis gets rid of these withno regionstring.h(1)search.c(5)matchesas inutil.c, just allocated at different locations (4):regionanalysis gets rid of these withno regionprint_context_appendinprint.c(1): same thread-local problem as inignore.c