-
Notifications
You must be signed in to change notification settings - Fork 45
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
Basic support for assert() #6529
Conversation
@@ -154,7 +154,8 @@ fun:llrintl=functional | |||
|
|||
# Functions that produce an output that does not depend on the input (shadow is | |||
# zeroed automatically). | |||
fun:__assert_fail=discard | |||
fun:__assert_fail=uninstrumented |
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.
What does "uninstrumented" result in? Does this mean the function is stubbed and polytracker does not interact with it?
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.
The pass treats every function in the uninstrumented category in the ABI list file as conforming to the native ABI. Unless the ABI list contains additional categories for those functions, a call to one of those functions will produce a warning message, as the labelling behavior of the function is unknown.
Source: https://clang.llvm.org/docs/DataFlowSanitizer.html#abi-list
Does this answer your question?
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.
Thank you! I didn't realize this is/was the same as the regular DFSan ABI list, my bad.
@@ -97,7 +97,7 @@ template <Section... Sections> class OutputFile { | |||
(SectionMeta{.tag = Sections::tag, | |||
.align = Sections::align_of, | |||
.offset = 0, | |||
.size = Sections::allocation_size})...}; | |||
.size = 0})...}; |
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.
Does setting the size to 0 for a section mean the section technically won't exist when output?
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 don't think so? I guess this was done to have correct information in the case when we have a section that's optional, like Events
if function tracing is turned off. I think there should be a header entry for the section, but it should tell you there's no trace events in it and it's size is 0? Am I right @hbrodin ?
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 we should update the comment above this code to reflect this change :P
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 is just the initial value. The final value will be set in the destructor of the OutputFile
. That behaviour hasn't changed, it is just that we don't assume the size to be max from the beginning, but rather to be empty.
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.
Just updating the code 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.
looks like the current changelist made @surovic's requested updates, and I have no further questions!
Will intercept the __assert_fail call and call polytracker_end which will update the output file and close it.
2e236f5
to
5bec4ab
Compare
Will intercept the __assert_fail call and call polytracker_end which will update the output file and close it.
At least a partial solution to #6528.