Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 36bae9e

Browse files
authored
disable sympath unless it's set via target_env (#222)
1 parent 640091f commit 36bae9e

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/agent/onefuzz-agent/src/tasks/coverage/recorder.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,13 @@ impl CoverageRecorder {
128128
.join("libfuzzer-coverage")
129129
.join("DumpCounters.js");
130130

131+
let should_disable_sympath = !self.config.target_env.contains_key("_NT_SYMBOL_PATH");
132+
131133
let cdb_cmd = format!(
132-
".scriptload {}; !dumpcounters {:?}; q",
134+
".scriptload {}; !dumpcounters {:?}, {}; q",
133135
script_path.to_string_lossy(),
134-
output.to_string_lossy()
136+
output.to_string_lossy(),
137+
should_disable_sympath,
135138
);
136139

137140
let mut cmd = Command::new("cdb.exe");

src/agent/script/win64/libfuzzer-coverage/DumpCounters.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ function processModule(module, results_dir) {
8383
return true;
8484
}
8585

86-
function dumpCounters(results_dir, sample_name) {
86+
function dumpCounters(results_dir, should_disable_sympath) {
87+
if (should_disable_sympath == true) {
88+
logln(`disabling sympath`);
89+
execute('.sympath ""');
90+
} else {
91+
logln(`not disabling sympath`);
92+
}
93+
8794
// Reset to initial break in `ntdll!LdrpDoDebuggerBreak`.
8895
execute(".restart");
8996

@@ -95,7 +102,7 @@ function dumpCounters(results_dir, sample_name) {
95102

96103
let found = false;
97104
host.currentProcess.Modules.All(function (module) {
98-
let result = processModule(module, results_dir, sample_name);
105+
let result = processModule(module, results_dir);
99106
if (result) {
100107
found = true;
101108
}

0 commit comments

Comments
 (0)