Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSlow backtrace on panic, nightly 2017-05-28 #42295
Comments
Mark-Simulacrum
added
the
I-slow
label
May 29, 2017
This comment has been minimized.
This comment has been minimized.
xftroxgpx
commented
Jul 24, 2017
|
Can you show the output of these two(assuming shell is bash): $ time RUST_BACKTRACE=1 rustc -vv
$ time RUST_BACKTRACE=0 rustc -vv(-vv is not a typo for -vV) |
This comment has been minimized.
This comment has been minimized.
|
With some nightly I had installed:
For the nightly I reported the bug against:
Just noticed that rustup might be adding some here as well:
For stable 1.18:
|
This comment has been minimized.
This comment has been minimized.
xftroxgpx
commented
Jul 25, 2017
•
|
I think you were right, this seems to be the issue: #37477 (comment) EDIT: I'm actually basing all this on your OP, not on what I asked above. (re below) |
This comment has been minimized.
This comment has been minimized.
|
@xftroxgpx just to clarify. I encountered this while running my own code, not having rustc errors. In the end it'd seem plausible that the gcc/libbacktrace bug would be cause. If I understand correctly, slower rustc errors were fixed by stripping the debuginfo but that is not a viable solution if I want to run my code in production with backtraces. Apparently a possible solution could be the removal of mmap.c functionality and thus forcing the use of EDIT: linked to the bug confirming comment by wthrowe |
koivunej commentedMay 29, 2017
•
edited
I recently noticed that my app startup is much slower on
--releasebuilds than on debug builds. Starting my app on an empty data directory triggers an error which is mapped into anerror_chaintype. In this issue I am showing backtraces from a startup which fails instantly at the first file open which I modified to useunwrap()instead of errors.I have
debug = truefor[profile.release]in my Cargo.toml. I initially suspected this was a bug witherror_chain, but this problem manifests even with when bypassing error_chain and callingunwrapdirectly to panic.When panicking, all other frames are printed fast, but the following (full backtraces in the end):
First line of output above takes a bit longer to output, but the
at /checkout/src/libcore/result:737takes more than ten seconds to print. After that the rest of the output is instant.There is a possibly related rustc issue #37477. When profiling with
perf record -g --call-graph dwarf -F 555the outermost ("Children") 96% of time goes toread_function_entryand the most self time is used by__rbt_backtrace_alloc.There is no problem when
RUST_BACKTRACE=0or when running non-optimized binary (Cargo settings for dev profile are the defaults).Timings
I tried this code: I have been unable to produce a minimized example and my current code base is not open source. My
--releaseoptimized binary is 44M and I link to a pretty high number (~37) of crates. Suggestions on generating a minimized test case are welcome, though I suspect it is required to have a large binary.I expected to see this happen: Fast backtrace
Instead, this happened: Slow backtrace (20s compared to 0.3s)
Meta
rustc --version --verbose:First noticed with
rustc 1.19.0-nightly (5f3966864 2017-05-25), then upgraded to latest. Same behaviour whengoldis used as linker. Same behaviour with incremental compilation.Backtrace is slow also with
rustc 1.18.0-nightly (2564711e8 2017-04-04).Backtrace: without `--release`
Backtrace with `--release`
diff -u dev.backtrace release.backtrace