mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-20 05:23:44 +00:00
address upcoming clippy warnings (#1089)
This commit is contained in:
@ -273,7 +273,7 @@ impl Images {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if image.region().contains(&va) {
|
if image.region().contains(&va) {
|
||||||
return Some(&image);
|
return Some(image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ fn print_version(include_sha: bool, include_local: bool, sha: &str) -> Result<()
|
|||||||
|
|
||||||
if include_sha {
|
if include_sha {
|
||||||
version.push('-');
|
version.push('-');
|
||||||
version.push_str(&sha);
|
version.push_str(sha);
|
||||||
|
|
||||||
// if we're a non-release build, check to see if git has
|
// if we're a non-release build, check to see if git has
|
||||||
// unstaged changes
|
// unstaged changes
|
||||||
|
@ -138,7 +138,7 @@ pub fn args(name: &'static str) -> App<'static, 'static> {
|
|||||||
|
|
||||||
let mut used = HashSet::new();
|
let mut used = HashSet::new();
|
||||||
|
|
||||||
for args in &[
|
for args in [
|
||||||
build_fuzz_args(),
|
build_fuzz_args(),
|
||||||
build_crash_args(),
|
build_crash_args(),
|
||||||
build_analysis_args(false),
|
build_analysis_args(false),
|
||||||
|
@ -24,7 +24,7 @@ pub async fn run(args: &clap::ArgMatches<'_>, event_sender: Option<Sender<UiEven
|
|||||||
let check_retry_count = value_t!(args, CHECK_RETRY_COUNT, u64)?;
|
let check_retry_count = value_t!(args, CHECK_RETRY_COUNT, u64)?;
|
||||||
|
|
||||||
let config = TestInputArgs {
|
let config = TestInputArgs {
|
||||||
target_exe: &target_exe.as_path(),
|
target_exe: target_exe.as_path(),
|
||||||
target_env: &target_env,
|
target_env: &target_env,
|
||||||
target_options: &target_options,
|
target_options: &target_options,
|
||||||
input_url: None,
|
input_url: None,
|
||||||
|
@ -55,7 +55,7 @@ pub fn args(name: &'static str) -> App<'static, 'static> {
|
|||||||
let mut app = SubCommand::with_name(name).about("run a local generator & crash reporting job");
|
let mut app = SubCommand::with_name(name).about("run a local generator & crash reporting job");
|
||||||
|
|
||||||
let mut used = HashSet::new();
|
let mut used = HashSet::new();
|
||||||
for args in &[build_fuzz_args(), build_crash_args()] {
|
for args in [build_fuzz_args(), build_crash_args()] {
|
||||||
for arg in args {
|
for arg in args {
|
||||||
if used.contains(arg.b.name) {
|
if used.contains(arg.b.name) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -27,7 +27,7 @@ pub async fn run(args: &clap::ArgMatches<'_>, event_sender: Option<Sender<UiEven
|
|||||||
let check_debugger = !args.is_present(DISABLE_CHECK_DEBUGGER);
|
let check_debugger = !args.is_present(DISABLE_CHECK_DEBUGGER);
|
||||||
|
|
||||||
let config = TestInputArgs {
|
let config = TestInputArgs {
|
||||||
target_exe: &target_exe.as_path(),
|
target_exe: target_exe.as_path(),
|
||||||
target_env: &target_env,
|
target_env: &target_env,
|
||||||
target_options: &target_options,
|
target_options: &target_options,
|
||||||
input_url: None,
|
input_url: None,
|
||||||
|
@ -118,7 +118,7 @@ async fn run_existing(config: &Config, reports_dir: &Option<PathBuf>) -> Result<
|
|||||||
let mut read_dir = fs::read_dir(&crashes.local_path).await?;
|
let mut read_dir = fs::read_dir(&crashes.local_path).await?;
|
||||||
while let Some(file) = read_dir.next_entry().await? {
|
while let Some(file) = read_dir.next_entry().await? {
|
||||||
debug!("Processing file {:?}", file);
|
debug!("Processing file {:?}", file);
|
||||||
run_tool(file.path(), &config, &reports_dir).await?;
|
run_tool(file.path(), config, reports_dir).await?;
|
||||||
count += 1;
|
count += 1;
|
||||||
|
|
||||||
// sync the analysis container after every 10 inputs
|
// sync the analysis container after every 10 inputs
|
||||||
@ -158,10 +158,10 @@ async fn poll_inputs(
|
|||||||
let input_url = message
|
let input_url = message
|
||||||
.parse(|data| BlobUrl::parse(str::from_utf8(data)?))
|
.parse(|data| BlobUrl::parse(str::from_utf8(data)?))
|
||||||
.with_context(|| format!("unable to parse URL from queue: {:?}", message))?;
|
.with_context(|| format!("unable to parse URL from queue: {:?}", message))?;
|
||||||
if !already_checked(&config, &input_url).await? {
|
if !already_checked(config, &input_url).await? {
|
||||||
let destination_path = _copy(input_url, &tmp_dir).await?;
|
let destination_path = _copy(input_url, &tmp_dir).await?;
|
||||||
|
|
||||||
run_tool(destination_path, &config, &reports_dir).await?;
|
run_tool(destination_path, config, reports_dir).await?;
|
||||||
config.analysis.sync_push().await?
|
config.analysis.sync_push().await?
|
||||||
}
|
}
|
||||||
message.delete().await?;
|
message.delete().await?;
|
||||||
@ -206,13 +206,13 @@ pub async fn run_tool(
|
|||||||
.job_id(&config.common.job_id)
|
.job_id(&config.common.job_id)
|
||||||
.task_id(&config.common.task_id)
|
.task_id(&config.common.task_id)
|
||||||
.set_optional_ref(&config.common.microsoft_telemetry_key, |tester, key| {
|
.set_optional_ref(&config.common.microsoft_telemetry_key, |tester, key| {
|
||||||
tester.microsoft_telemetry_key(&key)
|
tester.microsoft_telemetry_key(key)
|
||||||
})
|
})
|
||||||
.set_optional_ref(&config.common.instance_telemetry_key, |tester, key| {
|
.set_optional_ref(&config.common.instance_telemetry_key, |tester, key| {
|
||||||
tester.instance_telemetry_key(&key)
|
tester.instance_telemetry_key(key)
|
||||||
})
|
})
|
||||||
.set_optional_ref(&reports_dir, |tester, reports_dir| {
|
.set_optional_ref(reports_dir, |tester, reports_dir| {
|
||||||
tester.reports_dir(&reports_dir)
|
tester.reports_dir(reports_dir)
|
||||||
})
|
})
|
||||||
.set_optional_ref(&config.crashes, |tester, crashes| {
|
.set_optional_ref(&config.crashes, |tester, crashes| {
|
||||||
tester
|
tester
|
||||||
|
@ -164,10 +164,10 @@ impl GeneratorTask {
|
|||||||
.task_id(&self.config.common.task_id)
|
.task_id(&self.config.common.task_id)
|
||||||
.set_optional_ref(
|
.set_optional_ref(
|
||||||
&self.config.common.microsoft_telemetry_key,
|
&self.config.common.microsoft_telemetry_key,
|
||||||
|tester, key| tester.microsoft_telemetry_key(&key),
|
|tester, key| tester.microsoft_telemetry_key(key),
|
||||||
)
|
)
|
||||||
.set_optional_ref(&self.config.common.instance_telemetry_key, |tester, key| {
|
.set_optional_ref(&self.config.common.instance_telemetry_key, |tester, key| {
|
||||||
tester.instance_telemetry_key(&key)
|
tester.instance_telemetry_key(key)
|
||||||
})
|
})
|
||||||
.set_optional_ref(&self.config.tools, |expand, tools| {
|
.set_optional_ref(&self.config.tools, |expand, tools| {
|
||||||
expand.tools_dir(&tools.local_path)
|
expand.tools_dir(&tools.local_path)
|
||||||
|
@ -179,7 +179,7 @@ async fn start_supervisor(
|
|||||||
.runtime_dir(&runtime_dir)
|
.runtime_dir(&runtime_dir)
|
||||||
.crashes(&crashes.local_path)
|
.crashes(&crashes.local_path)
|
||||||
.input_corpus(&inputs.local_path)
|
.input_corpus(&inputs.local_path)
|
||||||
.reports_dir(&reports_dir)
|
.reports_dir(reports_dir)
|
||||||
.setup_dir(&config.common.setup_dir)
|
.setup_dir(&config.common.setup_dir)
|
||||||
.job_id(&config.common.job_id)
|
.job_id(&config.common.job_id)
|
||||||
.task_id(&config.common.task_id)
|
.task_id(&config.common.task_id)
|
||||||
@ -196,10 +196,10 @@ async fn start_supervisor(
|
|||||||
expand.target_options(target_options)
|
expand.target_options(target_options)
|
||||||
})
|
})
|
||||||
.set_optional_ref(&config.common.microsoft_telemetry_key, |tester, key| {
|
.set_optional_ref(&config.common.microsoft_telemetry_key, |tester, key| {
|
||||||
tester.microsoft_telemetry_key(&key)
|
tester.microsoft_telemetry_key(key)
|
||||||
})
|
})
|
||||||
.set_optional_ref(&config.common.instance_telemetry_key, |tester, key| {
|
.set_optional_ref(&config.common.instance_telemetry_key, |tester, key| {
|
||||||
tester.instance_telemetry_key(&key)
|
tester.instance_telemetry_key(key)
|
||||||
})
|
})
|
||||||
.set_optional_ref(
|
.set_optional_ref(
|
||||||
&config.crashes.remote_path.clone().and_then(|u| u.account()),
|
&config.crashes.remote_path.clone().and_then(|u| u.account()),
|
||||||
|
@ -143,10 +143,10 @@ async fn merge(config: &Config, output_dir: impl AsRef<Path>) -> Result<()> {
|
|||||||
.job_id(&config.common.job_id)
|
.job_id(&config.common.job_id)
|
||||||
.task_id(&config.common.task_id)
|
.task_id(&config.common.task_id)
|
||||||
.set_optional_ref(&config.common.microsoft_telemetry_key, |tester, key| {
|
.set_optional_ref(&config.common.microsoft_telemetry_key, |tester, key| {
|
||||||
tester.microsoft_telemetry_key(&key)
|
tester.microsoft_telemetry_key(key)
|
||||||
})
|
})
|
||||||
.set_optional_ref(&config.common.instance_telemetry_key, |tester, key| {
|
.set_optional_ref(&config.common.instance_telemetry_key, |tester, key| {
|
||||||
tester.instance_telemetry_key(&key)
|
tester.instance_telemetry_key(key)
|
||||||
});
|
});
|
||||||
|
|
||||||
let supervisor_path = expand.evaluate_value(&config.supervisor_exe)?;
|
let supervisor_path = expand.evaluate_value(&config.supervisor_exe)?;
|
||||||
|
@ -40,7 +40,7 @@ pub async fn run(
|
|||||||
crashes,
|
crashes,
|
||||||
report_dirs,
|
report_dirs,
|
||||||
report_list,
|
report_list,
|
||||||
®ression_reports,
|
regression_reports,
|
||||||
&heartbeat_client,
|
&heartbeat_client,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
@ -50,7 +50,7 @@ pub async fn run(
|
|||||||
handle_inputs(
|
handle_inputs(
|
||||||
handler,
|
handler,
|
||||||
readonly_inputs,
|
readonly_inputs,
|
||||||
®ression_reports,
|
regression_reports,
|
||||||
&heartbeat_client,
|
&heartbeat_client,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
@ -73,7 +73,7 @@ impl ReportTask {
|
|||||||
|
|
||||||
info!("processing existing crashes");
|
info!("processing existing crashes");
|
||||||
if let Some(crashes) = &self.config.crashes {
|
if let Some(crashes) = &self.config.crashes {
|
||||||
self.poller.batch_process(&mut processor, &crashes).await?;
|
self.poller.batch_process(&mut processor, crashes).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("processing crashes from queue");
|
info!("processing crashes from queue");
|
||||||
|
@ -89,7 +89,7 @@ impl ReportTask {
|
|||||||
let mut processor = AsanProcessor::new(self.config.clone()).await?;
|
let mut processor = AsanProcessor::new(self.config.clone()).await?;
|
||||||
|
|
||||||
if let Some(crashes) = &self.config.crashes {
|
if let Some(crashes) = &self.config.crashes {
|
||||||
self.poller.batch_process(&mut processor, &crashes).await?;
|
self.poller.batch_process(&mut processor, crashes).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.config.check_queue {
|
if self.config.check_queue {
|
||||||
|
@ -38,7 +38,7 @@ fn print_version(include_sha: bool, include_local: bool, sha: &str) -> Result<()
|
|||||||
|
|
||||||
if include_sha {
|
if include_sha {
|
||||||
version.push('-');
|
version.push('-');
|
||||||
version.push_str(&sha);
|
version.push_str(sha);
|
||||||
|
|
||||||
// if we're a non-release build, check to see if git has
|
// if we're a non-release build, check to see if git has
|
||||||
// unstaged changes
|
// unstaged changes
|
||||||
|
@ -14,7 +14,7 @@ pub fn set_panic_handler() {
|
|||||||
SET_HOOK.call_once(move || {
|
SET_HOOK.call_once(move || {
|
||||||
let old_hook = panic::take_hook();
|
let old_hook = panic::take_hook();
|
||||||
panic::set_hook(Box::new(move |info| {
|
panic::set_hook(Box::new(move |info| {
|
||||||
panic_hook(&info);
|
panic_hook(info);
|
||||||
old_hook(info);
|
old_hook(info);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
@ -325,7 +325,7 @@ impl<'a> Expand<'a> {
|
|||||||
Ok(arg)
|
Ok(arg)
|
||||||
}
|
}
|
||||||
ExpandedValue::Scalar(v) => {
|
ExpandedValue::Scalar(v) => {
|
||||||
arg = arg.replace(fmtstr, &v);
|
arg = arg.replace(fmtstr, v);
|
||||||
Ok(arg)
|
Ok(arg)
|
||||||
}
|
}
|
||||||
ExpandedValue::List(value) => {
|
ExpandedValue::List(value) => {
|
||||||
@ -335,7 +335,7 @@ impl<'a> Expand<'a> {
|
|||||||
Ok(arg)
|
Ok(arg)
|
||||||
}
|
}
|
||||||
ExpandedValue::Mapping(func) => {
|
ExpandedValue::Mapping(func) => {
|
||||||
if let Some(value) = func(self, &fmtstr) {
|
if let Some(value) = func(self, fmtstr) {
|
||||||
let arg = self.replace_value(fmtstr, arg, &value)?;
|
let arg = self.replace_value(fmtstr, arg, &value)?;
|
||||||
Ok(arg)
|
Ok(arg)
|
||||||
} else {
|
} else {
|
||||||
|
@ -302,10 +302,10 @@ impl<'a> Tester<'a> {
|
|||||||
let expand = Expand::new()
|
let expand = Expand::new()
|
||||||
.input_path(input_file)
|
.input_path(input_file)
|
||||||
.target_exe(&self.exe_path)
|
.target_exe(&self.exe_path)
|
||||||
.target_options(&self.arguments)
|
.target_options(self.arguments)
|
||||||
.setup_dir(&self.setup_dir);
|
.setup_dir(&self.setup_dir);
|
||||||
|
|
||||||
let argv = expand.evaluate(&self.arguments)?;
|
let argv = expand.evaluate(self.arguments)?;
|
||||||
let mut env: HashMap<String, String> = HashMap::new();
|
let mut env: HashMap<String, String> = HashMap::new();
|
||||||
for (k, v) in self.environ {
|
for (k, v) in self.environ {
|
||||||
env.insert(k.clone(), expand.evaluate_value(v)?);
|
env.insert(k.clone(), expand.evaluate_value(v)?);
|
||||||
@ -314,15 +314,15 @@ impl<'a> Tester<'a> {
|
|||||||
let setup_dir = &self.setup_dir.to_path_buf();
|
let setup_dir = &self.setup_dir.to_path_buf();
|
||||||
if self.add_setup_to_path {
|
if self.add_setup_to_path {
|
||||||
let new_path = match env.get(PATH) {
|
let new_path = match env.get(PATH) {
|
||||||
Some(v) => update_path(v.clone().into(), &setup_dir)?,
|
Some(v) => update_path(v.clone().into(), setup_dir)?,
|
||||||
None => get_path_with_directory(PATH, &setup_dir)?,
|
None => get_path_with_directory(PATH, setup_dir)?,
|
||||||
};
|
};
|
||||||
env.insert(PATH.to_string(), new_path.to_string_lossy().to_string());
|
env.insert(PATH.to_string(), new_path.to_string_lossy().to_string());
|
||||||
}
|
}
|
||||||
if self.add_setup_to_ld_library_path {
|
if self.add_setup_to_ld_library_path {
|
||||||
let new_path = match env.get(LD_LIBRARY_PATH) {
|
let new_path = match env.get(LD_LIBRARY_PATH) {
|
||||||
Some(v) => update_path(v.clone().into(), &setup_dir)?,
|
Some(v) => update_path(v.clone().into(), setup_dir)?,
|
||||||
None => get_path_with_directory(LD_LIBRARY_PATH, &setup_dir)?,
|
None => get_path_with_directory(LD_LIBRARY_PATH, setup_dir)?,
|
||||||
};
|
};
|
||||||
env.insert(
|
env.insert(
|
||||||
LD_LIBRARY_PATH.to_string(),
|
LD_LIBRARY_PATH.to_string(),
|
||||||
@ -348,7 +348,7 @@ impl<'a> Tester<'a> {
|
|||||||
Err(error) => (None, Some(error), None),
|
Err(error) => (None, Some(error), None),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
match run_cmd(&self.exe_path, argv.clone(), &env, self.timeout).await {
|
match run_cmd(self.exe_path, argv.clone(), &env, self.timeout).await {
|
||||||
Ok(output) => (None, None, Some(output)),
|
Ok(output) => (None, None, Some(output)),
|
||||||
Err(error) => (None, Some(error), None),
|
Err(error) => (None, Some(error), None),
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ impl<'a> LibFuzzer<'a> {
|
|||||||
|
|
||||||
let expand = Expand::new()
|
let expand = Expand::new()
|
||||||
.target_exe(&self.exe)
|
.target_exe(&self.exe)
|
||||||
.target_options(&self.options)
|
.target_options(self.options)
|
||||||
.setup_dir(&self.setup_dir)
|
.setup_dir(&self.setup_dir)
|
||||||
.set_optional(corpus_dir, |tester, corpus_dir| {
|
.set_optional(corpus_dir, |tester, corpus_dir| {
|
||||||
tester.input_corpus(&corpus_dir)
|
tester.input_corpus(&corpus_dir)
|
||||||
@ -141,7 +141,7 @@ impl<'a> LibFuzzer<'a> {
|
|||||||
files.shuffle(&mut rng);
|
files.shuffle(&mut rng);
|
||||||
}
|
}
|
||||||
for file in files.iter().take(5) {
|
for file in files.iter().take(5) {
|
||||||
self.check_input(&file).await.with_context(|| {
|
self.check_input(file).await.with_context(|| {
|
||||||
format!("checking input corpus: {}", file.display())
|
format!("checking input corpus: {}", file.display())
|
||||||
})?;
|
})?;
|
||||||
seen_inputs = true;
|
seen_inputs = true;
|
||||||
@ -243,7 +243,7 @@ impl<'a> LibFuzzer<'a> {
|
|||||||
let mut options = self.options.to_owned();
|
let mut options = self.options.to_owned();
|
||||||
options.push("{input}".to_string());
|
options.push("{input}".to_string());
|
||||||
|
|
||||||
let mut tester = Tester::new(&self.setup_dir, &self.exe, &options, &self.env)
|
let mut tester = Tester::new(&self.setup_dir, &self.exe, &options, self.env)
|
||||||
.check_asan_stderr(true)
|
.check_asan_stderr(true)
|
||||||
.check_retry_count(retry)
|
.check_retry_count(retry)
|
||||||
.add_setup_to_path(true)
|
.add_setup_to_path(true)
|
||||||
|
@ -14,7 +14,6 @@ pub struct DirectoryMonitor {
|
|||||||
dir: PathBuf,
|
dir: PathBuf,
|
||||||
notify_events: UnboundedReceiver<DebouncedEvent>,
|
notify_events: UnboundedReceiver<DebouncedEvent>,
|
||||||
watcher: notify::RecommendedWatcher,
|
watcher: notify::RecommendedWatcher,
|
||||||
terminated: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DirectoryMonitor {
|
impl DirectoryMonitor {
|
||||||
@ -32,7 +31,6 @@ impl DirectoryMonitor {
|
|||||||
dir,
|
dir,
|
||||||
notify_events,
|
notify_events,
|
||||||
watcher,
|
watcher,
|
||||||
terminated: false,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +45,6 @@ impl DirectoryMonitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn stop(&mut self) -> Result<()> {
|
pub fn stop(&mut self) -> Result<()> {
|
||||||
self.terminated = true;
|
|
||||||
self.watcher.unwatch(self.dir.clone())?;
|
self.watcher.unwatch(self.dir.clone())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ impl From<u64> for Address {
|
|||||||
|
|
||||||
// Find the module-relative address of `addr`, if it exists.
|
// Find the module-relative address of `addr`, if it exists.
|
||||||
fn find_module_rva(addr: u64, maps: &[MapRange]) -> Option<Rva> {
|
fn find_module_rva(addr: u64, maps: &[MapRange]) -> Option<Rva> {
|
||||||
let mapping = find_mapping(addr, &maps)?;
|
let mapping = find_mapping(addr, maps)?;
|
||||||
|
|
||||||
// Offset into the mapped image of some object file, but _not_
|
// Offset into the mapped image of some object file, but _not_
|
||||||
// the file itself.
|
// the file itself.
|
||||||
|
@ -151,13 +151,13 @@ pub(crate) fn parse_summary_base(text: &str) -> Option<(String, String, String)>
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn parse_summary(text: &str) -> Result<(String, String, String)> {
|
pub(crate) fn parse_summary(text: &str) -> Result<(String, String, String)> {
|
||||||
if let Some((summary, sanitizer, fault_type)) = parse_summary_base(&text) {
|
if let Some((summary, sanitizer, fault_type)) = parse_summary_base(text) {
|
||||||
return Ok((summary, sanitizer, fault_type));
|
return Ok((summary, sanitizer, fault_type));
|
||||||
}
|
}
|
||||||
if let Some((summary, sanitizer, fault_type)) = parse_asan_abort_error(&text) {
|
if let Some((summary, sanitizer, fault_type)) = parse_asan_abort_error(text) {
|
||||||
return Ok((summary, sanitizer, fault_type));
|
return Ok((summary, sanitizer, fault_type));
|
||||||
}
|
}
|
||||||
if let Some((summary, sanitizer, fault_type)) = parse_asan_runtime_error(&text) {
|
if let Some((summary, sanitizer, fault_type)) = parse_asan_runtime_error(text) {
|
||||||
return Ok((summary, sanitizer, fault_type));
|
return Ok((summary, sanitizer, fault_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,11 +165,11 @@ impl CrashLog {
|
|||||||
let stack_filter = get_stack_filter();
|
let stack_filter = get_stack_filter();
|
||||||
let mut minimized_stack_details: Vec<StackEntry> = stack
|
let mut minimized_stack_details: Vec<StackEntry> = stack
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|x| filter_funcs(x, &stack_filter))
|
.filter_map(|x| filter_funcs(x, stack_filter))
|
||||||
.collect();
|
.collect();
|
||||||
// if we don't have a minimized stack, if one of these functions is on
|
// if we don't have a minimized stack, if one of these functions is on
|
||||||
// the stack, use it
|
// the stack, use it
|
||||||
for entry in &[
|
for entry in [
|
||||||
"LLVMFuzzerTestOneInput",
|
"LLVMFuzzerTestOneInput",
|
||||||
"fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long)",
|
"fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long)",
|
||||||
"main",
|
"main",
|
||||||
@ -177,7 +177,7 @@ impl CrashLog {
|
|||||||
if !minimized_stack_details.is_empty() {
|
if !minimized_stack_details.is_empty() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
let value = Some(String::from(*entry));
|
let value = Some(entry.to_string());
|
||||||
minimized_stack_details = stack
|
minimized_stack_details = stack
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|x| {
|
.filter_map(|x| {
|
||||||
@ -268,13 +268,13 @@ fn stack_function_lines(stack: &[StackEntry]) -> Vec<String> {
|
|||||||
|
|
||||||
fn parse_summary(text: &str) -> Result<(String, String, String)> {
|
fn parse_summary(text: &str) -> Result<(String, String, String)> {
|
||||||
// eventually, this should be updated to support multiple callstack formats
|
// eventually, this should be updated to support multiple callstack formats
|
||||||
asan::parse_summary(&text)
|
asan::parse_summary(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_scariness(text: &str) -> (Option<u32>, Option<String>) {
|
fn parse_scariness(text: &str) -> (Option<u32>, Option<String>) {
|
||||||
// eventually, this should be updated to support multiple callstack formats,
|
// eventually, this should be updated to support multiple callstack formats,
|
||||||
// including building this value
|
// including building this value
|
||||||
match asan::parse_scariness(&text) {
|
match asan::parse_scariness(text) {
|
||||||
Some((x, y)) => (Some(x), Some(y)),
|
Some((x, y)) => (Some(x), Some(y)),
|
||||||
None => (None, None),
|
None => (None, None),
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ fn edit_exclusion_list<F: Fn(RegKey) -> ::core::result::Result<(), std::io::Erro
|
|||||||
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
|
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
|
||||||
|
|
||||||
// We want to set both the 32 and 64 bit registries.
|
// We want to set both the 32 and 64 bit registries.
|
||||||
for flags in &[0, KEY_WOW64_32KEY] {
|
for flags in [0, KEY_WOW64_32KEY] {
|
||||||
let exclusion_list = hklm
|
let exclusion_list = hklm
|
||||||
.open_subkey_with_flags(AEDEBUG_EXCLUSION_LIST, KEY_SET_VALUE | flags)
|
.open_subkey_with_flags(AEDEBUG_EXCLUSION_LIST, KEY_SET_VALUE | flags)
|
||||||
.context("Opening AeDebug\\AutoExclusionList")?;
|
.context("Opening AeDebug\\AutoExclusionList")?;
|
||||||
|
Reference in New Issue
Block a user