[tsan] Fallback to top frame (#77145)

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.
This commit is contained in:
Vitaly Buka
2024-01-05 14:48:37 -08:00
committed by GitHub
parent 77724d5f46
commit f74ce00075

View File

@@ -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) {