Arguments with spaces passed to the program incorrectly
tko opened this issue · comments
Given the following code
fn main() {
let arg = std::env::args().nth(1).unwrap();
if arg.contains(" ") {
loop{}
}
}
profiling it with cargo instruments "space here"
completes in few seconds as the single argument appears to get split and passed as two arguments "space" and "here" separately.
are you trying to pass arguments through to the target? I think the syntax is cargo instruments -- your args
, does that work?
Yes. And no, --
makes no difference.
Okay I'm probably not going to have time to investigate this for a while, but if you're motivated I would certainly accept a patch.
After some investigation I see cargo-instruments is simply passing the arguments to instruments and it's the latter that is misbehaving as can be reproduced with
instruments -t "Time Profiler" ./target/debug/main "space here"
Not sure there's anything one can do other than complaining to Apple.
yea you can file a radar but I wouldn't expect anything to come of it.
Best case scenario is likely that they end up using more Rust and end up using this utility and someone internal hits this bug