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 upRustup uses backtrace regardless of RUST_BACKTRACE #591
Comments
This comment has been minimized.
This comment has been minimized.
|
I suspect this is due to the use of the |
This comment has been minimized.
This comment has been minimized.
|
@Diggsey thanks regardless of I am not so lucky to hear about that. Any way to disable it? I've set |
This comment has been minimized.
This comment has been minimized.
|
@pravic Does this only happen when rustup ends with an error or does it also happen when rustup exits successfully? (I don't know why any backtrace code would be running on success) I'd like to know more about what it means to 'scan your HDD'. Why is this a problem for you? |
This comment has been minimized.
This comment has been minimized.
|
@brson There are no errors in regular The problem is in unnesessary HDD access which is quiet noisy and slowly. And thats despite of incorrect behavior with RUST_BACKTRACE ignoring. |
This comment has been minimized.
This comment has been minimized.
|
Here's the strace output of
That doesn't look unexpected, though I'm not sure what the So the same strace on
Suddenly some code is very interested in terminfo, but still nothing that looks particularly out of the ordinary. But I guess since you mentioned |
This comment has been minimized.
This comment has been minimized.
|
@pravic when you mention that @brson I think that error-chain captures a stack trace when any error happens, right? That means that a backtrace would be captured for an error which is later ignored I believe? It may be worth optimizing some stuff in backtrace-rs for this use case if it's causing perf problems. |
This comment has been minimized.
This comment has been minimized.
|
Yes, backtraces are generated for all errors regardless of whether they are displayed to the user. |
alexcrichton
added a commit
to alexcrichton/backtrace-rs
that referenced
this issue
Jul 19, 2016
This comment has been minimized.
This comment has been minimized.
|
Ok, I've pushed a commit to backtrace-rs which should greatly reduce the number of times |
This comment has been minimized.
This comment has been minimized.
|
I'm having some issues with my windows build at the moment, but when I've resolved them I'll post a testing build. |
This comment has been minimized.
This comment has been minimized.
|
@pravic Here's a build that contains @alexcrichton's fixes. Maybe you can test it and see if it performs better for you: https://s3-us-west-1.amazonaws.com/static-rust-lang-org/rustup/temp-testing/rustup-init.exe |
This comment has been minimized.
This comment has been minimized.
|
Just checked (rustup 0.3.0): Well, I checked new build. Behavior the same, since all symbols were loaded on first SymInitialize call, because it enumerates all process modules and tries to load (or download) pdb file for each. But yes, backtrace calls SymInitialize many times before patch:
The only solution I found, it is disable "dbghelp" feature of backtrace completely. I definitely do not need a flying error chains with linked backtraces, RUST_BACKTRACE is enough for me when it needed. |
pravic
referenced this issue
Jul 20, 2016
Closed
Do not capture backtrace without RUST_BACKTRACE=1 #7
This comment has been minimized.
This comment has been minimized.
|
I wonder why running |
This comment has been minimized.
This comment has been minimized.
Guess, thats how windows symbol handler works.
|
This comment has been minimized.
This comment has been minimized.
|
Hm, @pravic if the simple Do you see the same behavior with |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Thanks @pravic. @alexcrichton can you think of any reason rustc and rustup would differ in this behavior? Apparently |
This comment has been minimized.
This comment has been minimized.
|
The standard library doesn't hit backtrace logic until a panic happens, which |
This comment has been minimized.
This comment has been minimized.
|
For example when I run
Presumably a backtrace is getting generated each time that happens? |
This comment has been minimized.
This comment has been minimized.
|
Oh duh. There is indeed some code that runs even before argument parsing. Argh, I wish I knew why this disk access is so horrible on @pravic's system but doesn't seem to be on others. It really isn't that important to carry the backtraces around most of the time so maybe it is worth just converting error-chain to obey |
brson
added
the
help wanted
label
Jul 29, 2016
This comment has been minimized.
This comment has been minimized.
|
Next step is to make the modification to error-chain then upgrade it in rustup. The rustup error code tries to show backtraces on |
squidpickles
added a commit
to squidpickles/rustup.rs
that referenced
this issue
Aug 30, 2016
squidpickles
referenced this issue
Aug 30, 2016
Merged
Update to error-chain 0.5.0 to allow optional backtrace. #591 #703
brson
added a commit
that referenced
this issue
Sep 30, 2016
nodakai
added a commit
to nodakai/rustup.rs
that referenced
this issue
Apr 23, 2017
This comment has been minimized.
This comment has been minimized.
|
A fix for this was merged. |
pravic commentedJul 18, 2016
I noticed that
rustup updatescans my HDD every time it been called.I found that it always initializes a symbol helper (dbghelp!SymInitialize) at begin.
Setting
RUST_BACKTRACE=0or removingRUST_BACKTRACEdoes not help.Any explanation/recomendations about it? I tested cargo also, it does not load .pdb every time like rustup does.