Skip to content

Commit 1af664e

Browse files
lvaroquiclaude
andcommitted
fix(valgrind): allow file caps on the runner's own executable
The memory executor grants file capabilities to the runner's executable, and valgrind refuses to run an executable that carries them. A simulation run of an exec target then failed with "Permission denied" (exit code 126) as soon as the executable had been granted them, since exec-harness runs through it. Pass --allow-file-caps with the runner's executable path, so valgrind runs it without the capabilities, which its internal subcommands do not need. This option requires a valgrind-codspeed build that supports it. Refs COD-3722 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 3023d97 commit 1af664e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/executor/valgrind/measure.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ fn get_valgrind_args(tool: &SimulationTool, config: &ExecutorConfig) -> Vec<Stri
6363
children_skip_patterns.join(",")
6464
));
6565

66+
// Internal subcommands run through the runner's own executable, which may
67+
// carry file capabilities that valgrind refuses to run by default. They
68+
// do not need those capabilities.
69+
if let Ok(self_exe) = crate::cli::self_exe() {
70+
args.push(format!("--allow-file-caps={}", self_exe.display()));
71+
}
72+
6673
if config.fair_sched {
6774
args.push("--fair-sched=yes".to_string());
6875
}

0 commit comments

Comments
 (0)