-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Slow backtrace on panic, nightly 2017-05-28 #42295
Comments
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) |
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:
|
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) |
@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 are you still seeing this today? any chance of a reproduction? |
@steveklabnik I haven't touched this old codebase in some 2-3 years :) Thanks for pinging me though, I had hoped this was already fixed. I'll look into reproducing this and reopen if I can make this happen. Looking at #29293 the merge of #45523 should had fixed this, closing as the 29293 is already closed. |
I recently noticed that my app startup is much slower on
--release
builds than on debug builds. Starting my app on an empty data directory triggers an error which is mapped into anerror_chain
type. 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 = true
for[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 callingunwrap
directly 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:737
takes 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 555
the outermost ("Children") 96% of time goes toread_function_entry
and the most self time is used by__rbt_backtrace_alloc
.There is no problem when
RUST_BACKTRACE=0
or 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
--release
optimized 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 whengold
is 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
The text was updated successfully, but these errors were encountered: