summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ripple/minitrace/src/main.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs
index 1e8f583..3f846b6 100644
--- a/ripple/minitrace/src/main.rs
+++ b/ripple/minitrace/src/main.rs
@@ -45,6 +45,11 @@ impl Process {
 	fn spawn(cmd: &mut Command) -> anyhow::Result<Process> {
 		unsafe {
 			cmd.pre_exec(|| {
+				// disable ASLR
+				let mut persona = personality::get()?;
+				persona.insert(Persona::ADDR_NO_RANDOMIZE);
+				personality::set(persona)?;
+
 				ptrace::traceme()?;
 				Ok(())
 			});
@@ -89,11 +94,6 @@ enum EntryExit {
 }
 
 fn main() -> anyhow::Result<()> {
-	// disable ASLR
-	let mut persona = personality::get()?;
-	persona.insert(Persona::ADDR_NO_RANDOMIZE);
-	personality::set(persona)?;
-
 	let process = Process::spawn(&mut {
 		let mut args = env::args();