-
Notifications
You must be signed in to change notification settings - Fork 16
Add support for custom filters in JSON files #22
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
6 commits
Select commit
Hold shift + click to select a range
b452c92
abstract-tree: pass reference to getSringValue
lzaoral 38aec91
csfilter: add custom message filters from JSON files
lzaoral 036108f
csdiff: implement --filter-file option
lzaoral 653f312
csgrep: implement --filter-file option
lzaoral ec2e76a
csgrep-tests: set e and pipefail in sync.sh
lzaoral fb32526
doc: document the JSON format used by --filter-file options
lzaoral 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,28 @@ | ||
| [NAME] | ||
| csdiff - take two lists of defects and output either added or fixed ones | ||
|
|
||
| [OPTIONS] | ||
| The \fB\-\-filter\-file\fR option takes a list of JSON files in the following | ||
| format. Missing replace entry is equal to replace : "". | ||
|
|
||
| .RS 4 | ||
| .nf | ||
| { | ||
| "msg-filter" : [ | ||
| { | ||
| "checker" : "DIVINE|SYMBIOTIC", | ||
| "regexp" : "memory" | ||
| }, | ||
| { | ||
| "checker" : "COMPILER_WARNING", | ||
| "regexp" : "called on unallocated object", | ||
| "replace" : "called correctly, no UB here" | ||
| } | ||
| ] | ||
| } | ||
| .fi | ||
| .RE | ||
|
|
||
| [EXIT STATUS] | ||
| csdiff exits with status 0 if arguments are valid and input files are parsed | ||
| successfully. It does not matter whether any defects were matched or not. |
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
Empty file.
Empty file.
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,13 @@ | ||
| { | ||
| "msg-filter" : [ | ||
| { | ||
| "checker" : "DIVINE|SYMBIOTIC", | ||
| "regexp" : "memory" | ||
| }, | ||
| { | ||
| "checker" : "COMPILER_WARNING", | ||
| "regexp" : "called on unallocated object", | ||
| "replace" : "called correctly, no UB here" | ||
| } | ||
| ] | ||
| } |
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,5 @@ | ||
| Error: COMPILER_WARNING: | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-calloc/0004-calloc-plain-leak/0004-test.c: scope_hint: In function 'main' | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-calloc/0004-calloc-plain-leak/0004-test.c:5:5: warning[-Wunused-result]: ignoring return value of 'calloc' declared with attribute 'warn_unused_result' | ||
| # 5 | calloc(1, sizeof(char)); /* leak */ | ||
| # | ^~~~~~~~~~~~~~~~~~~~~~~ |
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,5 @@ | ||
| Error: COMPILER_WARNING: | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-calloc/0004-calloc-plain-leak/0004-test.c: scope_hint: In function 'main' | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-calloc/0004-calloc-plain-leak/0004-test.c:5:5: warning[-Wunused-result]: ignoring return value of 'calloc' declared with attribute 'warn_unused_result' | ||
| # 5 | calloc(1, sizeof(char)); /* leak */ | ||
| # | ^~~~~~~~~~~~~~~~~~~~~~~ |
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,20 @@ | ||
| Error: COMPILER_WARNING: | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c: scope_hint: In function 'main' | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c:6:5: warning[-Wfree-nonheap-object]: 'free' called correctly, no UB here 'a' | ||
| # 6 | free(&a); /* invalid free */ | ||
| # | ^~~~~~~~ | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c:5:9: note: declared here | ||
| # 5 | int a; | ||
| # | ^ | ||
|
|
||
| Error: SYMBIOTIC_WARNING: | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-malloc/0009-malloc-zerosize-leak/0009-test.c:10: error: memory error: memory not cleaned up | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-malloc/0009-malloc-zerosize-leak/0009-test.c:10: note: call stack: main () | ||
|
|
||
| Error: DIVINE_WARNING: | ||
| /home/lukas/tmp/assert-bounds.c: scope_hint: In function 'main': | ||
| /home/lukas/tmp/assert-bounds.c:8: error: access of size 1 at [alloca*] is 1 bytes out of bounds | ||
| /home/lukas/tmp/assert-bounds.c:8: note: memory error in userspace | ||
| /opt/divine/include/dios/sys/fault.hpp:119: note: void __dios::FaultBase::handler<__dios::Context>(_VM_Fault, _VM_Frame*, void (*)()) | ||
| /home/lukas/tmp/assert-bounds.c:8: note: main | ||
| /opt/divine/include/dios/libc/sys/start.cpp:91: note: __dios_start |
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,26 @@ | ||
| Error: COMPILER_WARNING: | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c: scope_hint: In function 'main' | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c:6:5: warning[-Wfree-nonheap-object]: 'free' called on unallocated object 'a' | ||
| # 6 | free(&a); /* invalid free */ | ||
| # | ^~~~~~~~ | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c:5:9: note: declared here | ||
| # 5 | int a; | ||
| # | ^ | ||
|
|
||
| Error: COMPILER_WARNING: | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-calloc/0004-calloc-plain-leak/0004-test.c: scope_hint: In function 'main' | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-calloc/0004-calloc-plain-leak/0004-test.c:5:5: warning[-Wunused-result]: ignoring return value of 'calloc' declared with attribute 'warn_unused_result' | ||
| # 5 | calloc(1, sizeof(char)); /* leak */ | ||
| # | ^~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Error: SYMBIOTIC_WARNING: | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-malloc/0009-malloc-zerosize-leak/0009-test.c:10: error: memory error: memory not cleaned up | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-malloc/0009-malloc-zerosize-leak/0009-test.c:10: note: call stack: main () | ||
|
|
||
| Error: DIVINE_WARNING: | ||
| /home/lukas/tmp/assert-bounds.c: scope_hint: In function 'main': | ||
| /home/lukas/tmp/assert-bounds.c:8: error: access of size 1 at [alloca*] is 1 bytes out of bounds | ||
| /home/lukas/tmp/assert-bounds.c:8: note: memory error in userspace | ||
| /opt/divine/include/dios/sys/fault.hpp:119: note: void __dios::FaultBase::handler<__dios::Context>(_VM_Fault, _VM_Frame*, void (*)()) | ||
| /home/lukas/tmp/assert-bounds.c:8: note: main | ||
| /opt/divine/include/dios/libc/sys/start.cpp:91: note: __dios_start |
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,8 @@ | ||
| Error: COMPILER_WARNING: | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c: scope_hint: In function 'main' | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c:6:5: warning[-Wfree-nonheap-object]: 'free' called correctly, no UB here 'a' | ||
| # 6 | free(&a); /* invalid free */ | ||
| # | ^~~~~~~~ | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c:5:9: note: declared here | ||
| # 5 | int a; | ||
| # | ^ |
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,8 @@ | ||
| Error: COMPILER_WARNING: | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c: scope_hint: In function 'main' | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c:6:5: warning[-Wfree-nonheap-object]: 'free' called correctly, no UB here 'a' | ||
| # 6 | free(&a); /* invalid free */ | ||
| # | ^~~~~~~~ | ||
| /home/lukas/aufover-benchmark/tests/single-c/mem-basic-free/0006-free-stack/0006-test.c:5:9: note: declared here | ||
| # 5 | int a; | ||
| # | ^ |
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.
Uh oh!
There was an error while loading. Please reload this page.