Skip to content

Commit d9ce33a

Browse files
authored
[libfuzzer] Prevent MSan false positive when printing log with -jobs (llvm#91679)
libfuzzer's -jobs option will, depending on the number of CPUs, spin up a WorkerThread and end up printing the log file using CopyFileToErr. This leads to an MSan false positive. This patch disables the MSan interceptor checks, similarly to other instances in https://reviews.llvm.org/D48891 Side-note: this false positive issue first appeared when printf() was replaced by puts() (90b4d1b). The interceptor check was always present; however, MSan does not check_printf by default.
1 parent 30aa49c commit d9ce33a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler-rt/lib/fuzzer/FuzzerDriver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ static void PulseThread() {
229229

230230
static void WorkerThread(const Command &BaseCmd, std::atomic<unsigned> *Counter,
231231
unsigned NumJobs, std::atomic<bool> *HasErrors) {
232+
ScopedDisableMsanInterceptorChecks S;
232233
while (true) {
233234
unsigned C = (*Counter)++;
234235
if (C >= NumJobs) break;

0 commit comments

Comments
 (0)