-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash with valgrind #188
Comments
Hey, thanks for the bug report! Huh! Never seen this before, but I'm not too surprised. Criterion.rs does some odd stuff with unsafe memory access to speed up the benchmark analysis. I was never sure that code was correct, but I haven't been able to replace it with safe code yet. That would be my first guess, anyway. |
Well, it doesn't need to be connected to unsafe, since it looks like a simple stray |
As a side note, I've also tried using perf, and that gave strange results with criterion. Using the standard harness made perf show usefull things. Right now, I can't pinpoint "strange results" any further, but if you want me to I'd investigate to give a better description. |
Any more information you can provide would be helpful, yeah. You should be able to enable debugging information in the benchmarks by adding this to your
|
Several of the unsafe are marked with |
Just wanted to chime in that I can reproduce OP's crash on all my rust programs (if a reproduction case is not desired, one can skip this) #[macro_use]
extern crate criterion;
use criterion::Criterion;
fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("20", |b| b.iter(|| 20));
}
criterion_group!(benches, criterion_benchmark);
criterion_main!(benches); ...
Results in the following execution
|
Thanks! That will help when I get around to looking into this. |
I ran the example of @nickbabcock through per, using |
I haven't been able to reproduce this issue. Could you confirm that it's still happening? I tried 0.2.4, 0.2.5 and the latest git revision without seeing this crash. |
Sorry for my silence, I get the same error with @KillTheMule 's project. git clone https://github.com/KillTheMule/tmp.git criterion.rs-188
cd criterion.rs-188
cargo bench --no-run
RUST_BACKTRACE=1 valgrind --tool=callgrind ./target/release/bench_tmp-* I believe I have a pretty standard environment: Ubuntu 18.04, valgrind 3.13.0, rust 1.31.0 |
I was finally able to reproduce this using an Ubuntu VM which did not have |
Excellent, I can confirm that upgrading to criterion 0.2.6 fixes this issue. Instead of panicking, criterion will print out that gnuplot was not found. 👍 |
Took me some time, sorry for that, but updating to 0.2.7 fixed the issue indeed, thanks! |
I've tried analyzing my benchmark with valgrind, and I've experienced a crash. Seems like criterion was the culprit (to be precise, running the benchmark with the standard harness made the crash go away), so I wanted to bring this to your attention. Seems to me that analyzing a benchmark with profiling tools is something people generally would want to do.
Or maybe I've simply made a mistake? Anyways, details can be found here, if there's anything I should to to investigate or help fix it, please let me know :)
The text was updated successfully, but these errors were encountered: