-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[tsan] Fallback to top frame #77145
[tsan] Fallback to top frame #77145
Conversation
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) ChangesProbably it's not important, as it should not happen, Full diff: https://github.com/llvm/llvm-project/pull/77145.diff 1 Files Affected:
diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
index cdcc20b9758f48..c6b764bd891752 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp
@@ -275,7 +275,7 @@ static ReportStack *ChooseSummaryStack(const ReportDesc *rep) {
static bool FrameIsInternal(const SymbolizedStack *frame) {
if (!frame)
- return false;
+ return true;
const char *file = frame->info.file;
const char *module = frame->info.module;
if (file && (internal_strstr(file, "/compiler-rt/lib/")))
@@ -286,9 +286,10 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
}
static SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) {
- while (FrameIsInternal(frames) && frames->next)
- frames = frames->next;
- return frames;
+ for (SymbolizedStack *f = frames; f; f = f->next)
+ if (!FrameIsInternal(f))
+ return f;
+ return frames; // Fallback to the top frame.
}
void PrintReport(const ReportDesc *rep) {
|
If we encounter a case that "should not happen", wouldn't it be better to fail/assert? |
Created using spr 1.3.4 [skip ci]
usually should not happen |
Probably it's not important, as it should not happen often, but if all frames are internal we should pick top, not the bottom frame.
Probably it's not important, as it should not happen often,
but if all frames are internal we should pick top, not
the bottom frame.