Currently we don't lock ScopedErrorReportLock around fork
and it mostly works becuase tsan has own report_mtx that
is locked around fork and tsan reports.
However, sanitizer_common code prints some own reports
which are not protected by tsan's report_mtx. So it's better
to lock ScopedErrorReportLock explicitly.
Details
- Reviewers
vitalybuka melver - Commits
- rGc3c324dddf73: tsan: lock ScopedErrorReportLock around fork
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp | ||
---|---|---|
256 | Well, yes. The reason I put it here is that CommonSanitizerReportMutex is static in this source file, so there is no way to refer to it in the header file. I already encountered this situation in several other places, I guess the annotations were developed with the classical C++ OOP style in mind. I've moved the mutex to the header and improved the annotations. PTAL |
Shouldn't the ACQUIRE() annotation go in the header, so that callers see this?