fn build_command() -> Command { // Anything that needs to spawn a child will need to give it permission to // ptrace itself, as Yama LSM will normally only allow a parent to debug // a child, not the other way around. #[cfg(target_os = "linux")]
{ let rc = unsafe { libc::prctl(libc::PR_SET_PTRACER, libc::PR_SET_PTRACER_ANY) };
assert_eq!(rc, 0);
}
// In normal cases where the host and target are the same this won't matter, // but tests will fail if you are eg running in a cross container which will // likely be x86_64 but may be targetting aarch64 or i686, which will result // in tests failing, or at the least not testing what you think
cmd.args(["--target", current_platform::CURRENT_PLATFORM, "--"]);
}
#[allow(unused)] pubfn assert_soft_errors_in_minidump<'a, 'b, T, I>(
dump: &minidump::Minidump<'a, T>,
expected_errors: I,
) where
T: std::ops::Deref<Target = [u8]> + 'a,
I: IntoIterator<Item = &'b serde_json::Value>,
{ let actual_json = read_minidump_soft_errors_or_panic(dump); let actual_errors = actual_json.as_array().unwrap();
// Ensure that every error we expect is in the actual list somewhere for expected_error in expected_errors {
assert!(
actual_errors
.iter()
.any(|actual_error| actual_error == expected_error), "soft error list missing expected error `{expected_error:#?}`\nError_list: {actual_errors:#?}"
);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.