Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Maybe dfsan part can be in a separate patch, but I will not insist.
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h | ||
---|---|---|
63 ↗ | (On Diff #345291) | u32 |
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp | ||
29–55 ↗ | (On Diff #345291) | I believe we just need to extract this code into a functions and we save some code below. |
168 ↗ | (On Diff #345291) | We need some tests in sanitizer_stacktrace_test.cpp |
compiler-rt/test/dfsan/origin_stack_trace.c | ||
73 | second description arg is not tests Could you please add tests for:
|
I will split the sanitizer common parts into a separate patch. However, I find it easier to exercise all tests while making changes for addressing comments, so I will do that in the end.
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h | ||
---|---|---|
63 ↗ | (On Diff #345291) | I chose this type in accordance with __sanitizer_symbolize_pc which includes similar parameters. Why is u32 more appropriate here? |
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp | ||
29–55 ↗ | (On Diff #345291) | Out of curiosity, is there a sanitizer developer guide that states such coding preferences more explicitly? For the given case, I'm not sure how this is possible with simple functions:
For the last part, I ran into this problem when trying to abstract Printf, in particular, which is a variadic function. Without callbacks, a public VPrintf version, and classes how could one write generic code e.g. to abstract the main for-loop (that renders frames) while keeping the actual operation that is performed per frame generic (e.g., a lambda)? Sorry if there's an obvious workaround here but I'm quite new to the sanitizer world. |
168 ↗ | (On Diff #345291) | Done. |
compiler-rt/test/dfsan/origin_stack_trace.c | ||
73 | Done. |
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h | ||
---|---|---|
63 ↗ | (On Diff #345291) | Actually uptr because this component usually use this type for memory buffer sizes |
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h | ||
---|---|---|
63 ↗ | (On Diff #345291) | Done. |
You can do this by keeping both patches in the same git branch and uploading them one by one with "arc diff HEAD^"
Address comments.
Change behavior on null buffer and zero buffer size.
compiler-rt/lib/dfsan/dfsan.cpp | ||
---|---|---|
911 | Done. | |
938 | I actually changed this, to be similar to StackTrace::PrintTo. Zero buf size is now legal behavior and returns the correct length (amended test). | |
940–949 | Acknowledged. Variable label is also used below and the return value is different. Also, I don't want to place any print outs inside the PrintOriginTraceToStr helper to minimize its side effects. I thought about having it return an error value or accept an error message string parameter that it can modify, but preferred to keep the code simple and add just some minimum duplication. |
This d can be removed.