Skip to content

Commit 18263c3

Browse files
authored
[compiler-rt][rtsan] Add scoped reporting lock (#107167)
Uses a static lock to ensure multiple threads reporting issues at the same time don't have printing collisions. This isn't so important now, but will be with continue mode in the future.
1 parent dce73e1 commit 18263c3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler-rt/lib/rtsan/rtsan_context.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ bool __rtsan::Context::IsBypassed() const { return bypass_depth_ > 0; }
9191

9292
void __rtsan::PrintDiagnostics(const char *intercepted_function_name, uptr pc,
9393
uptr bp) {
94+
ScopedErrorReportLock l;
95+
9496
fprintf(stderr,
9597
"Real-time violation: intercepted call to real-time unsafe function "
9698
"`%s` in real-time context! Stack trace:\n",

0 commit comments

Comments
 (0)