-
Notifications
You must be signed in to change notification settings - Fork 11
SARIF reports #167
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
SARIF reports #167
Conversation
a9b5efc to
1d6067b
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #167 +/- ##
==========================================
+ Coverage 69.42% 69.71% +0.28%
==========================================
Files 210 216 +6
Lines 30083 30393 +310
Branches 6668 6716 +48
==========================================
+ Hits 20886 21187 +301
+ Misses 6692 6689 -3
- Partials 2505 2517 +12
|
a45b568 to
6fa80e7
Compare
7155494 to
c3ac2ff
Compare
lib/Core/CodeEvents/ReturnEvent.h
Outdated
| @@ -0,0 +1,34 @@ | |||
| #ifndef KLEE_RETURN_EVENT_H | |||
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.
It might be ok to have declarations of all kinds of events in one header.
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'll better separate them in different files. With grow number of events single header will be less readable (e.g. Passes.h). I suggest an alternative: use a directory for headers, each consisting of a single class.
| @@ -0,0 +1,76 @@ | |||
| #ifndef KLEE_CODE_LOCATION_H | |||
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.
We must have a copyright and license block in the head part of all files to match the KLEE project style.
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.
Add *- C++ -*- for .cpp related headers, please.
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.
KLEE -> KLEEF
lib/Core/Executor.cpp
Outdated
| debugLogBuffer(debugBufferString) { | ||
| debugLogBuffer(debugBufferString), sarifReport({}) { | ||
|
|
||
| // FIXME: put configuration in different place. |
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.
?
lib/Core/Executor.cpp
Outdated
| baseInBounds = | ||
| AndExpr::create(baseInBounds, mo->getBoundsCheckPointer(base, size)); | ||
| } | ||
| // if (base != address || size != bytes) { |
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.
Clean dead code.
| // RUN: %clang -emit-llvm -g -c %s -o %t.bc | ||
| // RUN: rm -rf %t.klee-out | ||
| // RUN: %klee -write-sarifs --use-sym-size-alloc --use-sym-size-li --skip-not-symbolic-objects --posix-runtime --libc=uclibc -cex-cache-validity-cores --output-dir=%t.klee-out %t.bc > %t.log | ||
| // RUN: python3 %S/../../checker.py %t.klee-out/report.sarif %S/pattern.sarif |
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.
Add checker.py as a command in lit.cfg
fda377e to
dd98605
Compare
test/SARIF/lit.local.cfg
Outdated
|
|
||
| config.substitutions.append( | ||
| ('%checker', f"python3 {os.path.join(os.path.dirname(__file__), 'checker.py')}".strip()) | ||
| ) No newline at end of file |
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.
Add a new line.
| @@ -0,0 +1,76 @@ | |||
| #ifndef KLEE_CODE_LOCATION_H | |||
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.
Add *- C++ -*- for .cpp related headers, please.
| @@ -0,0 +1,76 @@ | |||
| #ifndef KLEE_CODE_LOCATION_H | |||
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.
KLEE -> KLEEF
* Introduces `CodeEvent` as a base unit for storing information about event in code. * `CodeEvent`s are managed with `EventRecorder`, capable of serializing recorded trace. * `termianateStateOnProgramError` receives an `ErrorEvent` object contatining all required information about error. [feat] Enhances `gepExprBases`: * Bases for addresses stored for constant expressions. * Precalculates bases for `llvm::ConstantExpr` (i.e. for `getElementPtr` in arguments of instructions). [perf] Removes checks on `baseInBounds` during memory operations. [fix] Adds hacks for managing objects with neighboring addresses (in some cases `gepExprBases` could assume that the beginning of one object is the end of another). [fix] Fixes ODR violation with `llvm::APFloat::RoundingMode`.
PR providing support for generating error report in SARIF format.
Adds support for reporting errors in SARIF format:
CodeEventas a base unit for storing information about event in code.CodeEvents are managed withEventRecorder, capable of serializing recorded trace.termianateStateOnProgramErrorreceives anErrorEventobject contatining all required informration about error.Enhances
gepExprBases:llvm::ConstantExpr(i.e. forgetElementPtrin arguments of instructions)Removes checks on
baseInBoundsduring memory operations.Adds hacks for managing objects with neighboring addresses (in some cases
gepExprBasescould fail for that case).Fixes ODR violation with
llvm::APFloat::RoundingMode.