Explanations on how to make the silver searcher analysis more precise#59
Draft
karoliineh wants to merge 8 commits intomasterfrom
Draft
Explanations on how to make the silver searcher analysis more precise#59karoliineh wants to merge 8 commits intomasterfrom
the silver searcher analysis more precise#59karoliineh wants to merge 8 commits intomasterfrom
Conversation
Co-authored-by: Michael Schwarz <michael.schwarz93@gmail.com>
Member
|
Is there still something to do here, or should we merge it? |
Co-authored-by: karoliineh <karoliine.holter@ut.ee>
sim642
reviewed
Sep 22, 2023
Member
sim642
left a comment
There was a problem hiding this comment.
I added your config (with region) and some patches.
Comment on lines
+148
to
+150
| ### Split paths using annotation `__goblint_split_begin(matches == NULL);` on line 39 in `search.c`. Requires activating `expsplit` analysis. | ||
|
|
||
| Will remove the following warnings: |
Member
There was a problem hiding this comment.
Is this still true? Doesn't seem to reduce anything for me.
Comment on lines
+36
to
+39
| ### `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`. |
| 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` |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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