rust-lang / rust-lang/rustc-perf

"Local profile (diff)" command fails (with valgrind 3.19.0)

Open
#1,703 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
733
Forks
189
Avg merge
10h 52m
Merged PRs (30d)
43

Description

I am trying to run the "Local profile (diff)" command given on this page. Unfortunately it doesn't work:

$ ./target/release/collector profile_local cachegrind +3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa --rustc2 +94b77248c5aa991f2597b4a1c1a49e297ac2f3e2 --include ctfe-stress-5 --profiles Debug --scenarios Full
Running with 1 job(s)
detecting the channel of the `3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa` toolchain...
downloading <https://ci-artifacts.rust-lang.org/rustc-builds/3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz>...
75.26 MB / 75.26 MB [===============================================================================================================================================================================================================================================] 100.00 % 11.18 MB/s 
downloading <https://ci-artifacts.rust-lang.org/rustc-builds/3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz>...
27.80 MB / 27.80 MB [===============================================================================================================================================================================================================================================] 100.00 % 11.16 MB/s 
toolchain `3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa` is successfully installed!
Profiling 3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa with Cachegrind
Executing benchmark ctfe-stress-5 (1/1)
Preparing ctfe-stress-5
Running ctfe-stress-5: Debug + [Full]
Finished benchmark ctfe-stress-5 (1/1)
collector error: Failed to profile 'ctfe-stress-5' with Cachegrind, recorded: expected success, got exit status: 101

stderr=   Compiling ctfe-stress-5 v0.1.0 (/tmp/.tmprorwj9)
==92466== Cachegrind, a cache and branch-prediction profiler
==92466== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==92466== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==92466== Command: /home/r/.rustup/toolchains/3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa/bin/rustc --crate-name ctfe_stress_5 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=60c11a1ed113cdf7 -C extra-filename=-60c11a1ed113cdf7 --out-dir /tmp/.tmprorwj9/target/debug/deps -L dependency=/tmp/.tmprorwj9/target/debug/deps -Ctarget-cpu=native -Adeprecated -Aunknown-lints -Zincremental-verify-ich
==92466== 
--92466-- warning: L3 cache found, using its data for the LL simulation.
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x23
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x23
==92466== Valgrind: debuginfo reader: ensure_valid failed:
==92466== Valgrind:   during call to ML_(img_get)
==92466== Valgrind:   request for range [2334864704, +4) exceeds
==92466== Valgrind:   valid image size of 2821480 for image:
==92466== Valgrind:   "/home/r/.rustup/toolchains/3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa/bin/rustc"
==92466== 
==92466== Valgrind: debuginfo reader: Possibly corrupted debuginfo file.
==92466== Valgrind: I can't recover.  Giving up.  Sorry.
==92466== 
thread 'main' panicked at 'command did not complete successfully: MALLOC_CONF="dirty_decay_ms:0,muzzy_decay_ms:0" RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER="rustc-perf" RUSTC_FORCE_RUSTC_VERSION="rustc-perf" "valgrind" "--tool=cachegrind" "--cache-sim=no" "--branch-sim=no" "--cachegrind-out-file=cgout" "/home/r/.rustup/toolchains/3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa/bin/rustc" "--crate-name" "ctfe_stress_5" "src/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "embed-bitcode=no" "-C" "debuginfo=2" "-C" "metadata=60c11a1ed113cdf7" "-C" "extra-filename=-60c11a1ed113cdf7" "--out-dir" "/tmp/.tmprorwj9/target/debug/deps" "-L" "dependency=/tmp/.tmprorwj9/target/debug/deps" "-Ctarget-cpu=native" "-Adeprecated" "-Aunknown-lints" "-Zincremental-verify-ich"', collector/src/bin/rustc-fake.rs:24:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: could not compile `ctfe-stress-5` (lib)


 stdout=

detecting the channel of the `94b77248c5aa991f2597b4a1c1a49e297ac2f3e2` toolchain...
downloading <https://ci-artifacts.rust-lang.org/rustc-builds/94b77248c5aa991f2597b4a1c1a49e297ac2f3e2/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz>...
73.95 MB / 73.95 MB [================================================================================================================================================================================================================================================] 100.00 % 8.94 MB/s 
downloading <https://ci-artifacts.rust-lang.org/rustc-builds/94b77248c5aa991f2597b4a1c1a49e297ac2f3e2/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz>...
27.78 MB / 27.78 MB [================================================================================================================================================================================================================================================] 100.00 % 8.36 MB/s 
toolchain `94b77248c5aa991f2597b4a1c1a49e297ac2f3e2` is successfully installed!
Profiling 94b77248c5aa991f2597b4a1c1a49e297ac2f3e2 with Cachegrind
Executing benchmark ctfe-stress-5 (1/1)
Preparing ctfe-stress-5
Running ctfe-stress-5: Debug + [Full]
Finished benchmark ctfe-stress-5 (1/1)
collector error: Failed to profile 'ctfe-stress-5' with Cachegrind, recorded: expected success, got exit status: 101

stderr=   Compiling ctfe-stress-5 v0.1.0 (/tmp/.tmpyrVw1y)
==92495== Cachegrind, a cache and branch-prediction profiler
==92495== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==92495== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==92495== Command: /home/r/.rustup/toolchains/94b77248c5aa991f2597b4a1c1a49e297ac2f3e2/bin/rustc --crate-name ctfe_stress_5 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=60c11a1ed113cdf7 -C extra-filename=-60c11a1ed113cdf7 --out-dir /tmp/.tmpyrVw1y/target/debug/deps -L dependency=/tmp/.tmpyrVw1y/target/debug/deps -Ctarget-cpu=native -Adeprecated -Aunknown-lints -Zincremental-verify-ich
==92495== 
--92495-- warning: L3 cache found, using its data for the LL simulation.
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x23
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x23
==92495== Valgrind: debuginfo reader: ensure_valid failed:
==92495== Valgrind:   during call to ML_(img_get)
==92495== Valgrind:   request for range [2334864704, +4) exceeds
==92495== Valgrind:   valid image size of 2821480 for image:
==92495== Valgrind:   "/home/r/.rustup/toolchains/94b77248c5aa991f2597b4a1c1a49e297ac2f3e2/bin/rustc"
==92495== 
==92495== Valgrind: debuginfo reader: Possibly corrupted debuginfo file.
==92495== Valgrind: I can't recover.  Giving up.  Sorry.
==92495== 
thread 'main' panicked at 'command did not complete successfully: MALLOC_CONF="dirty_decay_ms:0,muzzy_decay_ms:0" RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER="rustc-perf" RUSTC_FORCE_RUSTC_VERSION="rustc-perf" "valgrind" "--tool=cachegrind" "--cache-sim=no" "--branch-sim=no" "--cachegrind-out-file=cgout" "/home/r/.rustup/toolchains/94b77248c5aa991f2597b4a1c1a49e297ac2f3e2/bin/rustc" "--crate-name" "ctfe_stress_5" "src/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "embed-bitcode=no" "-C" "debuginfo=2" "-C" "metadata=60c11a1ed113cdf7" "-C" "extra-filename=-60c11a1ed113cdf7" "--out-dir" "/tmp/.tmpyrVw1y/target/debug/deps" "-L" "dependency=/tmp/.tmpyrVw1y/target/debug/deps" "-Ctarget-cpu=native" "-Adeprecated" "-Aunknown-lints" "-Zincremental-verify-ich"', collector/src/bin/rustc-fake.rs:24:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: could not compile `ctfe-stress-5` (lib)


 stdout=

Cannot open results/cgout-3071e0aef6dfd0a150c3fb1da0abad4ec86ca0aa-ctfe-stress-5-Debug-Full for reading
collector error: Cannot run cg_diff

Caused by:
    failed to generate cachegrind diff
Diffs:
collector error: 3 benchmarks failed

Am I doing something wrong?

This is on Debian testing with all apt-updates installed.

$ valgrind --version
valgrind-3.19.0

Is that valgrind too old, or so?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the profile_local command and Valgrind 3.19.0, then inspect collector/src/bin/rustc-fake.rs and the Cachegrind/cg_diff path shown in the output. Determine why Valgrind rejects the rustc debug information; done means local profiling completes and the generated Cachegrind diff can be read.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.