Skip to content
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

Improve cleaning of the bottom of the backtrace #41815

Merged
merged 1 commit into from May 10, 2017

Conversation

Projects
None yet
6 participants
@Yamakaky
Copy link
Contributor

Yamakaky commented May 7, 2017

Following #40264. It only cleans the bottom of the trace (after the main). It handles correctly the normal main, tests, benchmarks and threads.

I kept skipped_before since it will be used later for the cleaning of the top.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented May 7, 2017

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@Yamakaky

This comment has been minimized.

Copy link
Contributor Author

Yamakaky commented May 7, 2017

@alexcrichton
Copy link
Member

alexcrichton left a comment

Looks good! Could a test be added for this as well?

@@ -122,7 +158,7 @@ pub fn log_enabled() -> Option<PrintFormat> {
}

let val = match env::var_os("RUST_BACKTRACE") {
Some(x) => if &x == "0" {
Some(x) => if &x == "0" || &x == "" {

This comment has been minimized.

@alexcrichton

alexcrichton May 8, 2017

Member

Perhaps we could hold off on changing the interpretation of RUST_BACKTRACE for now? I'm wary to add more and more cases for positive/negative intepretation.

This comment has been minimized.

@Yamakaky

Yamakaky May 9, 2017

Author Contributor

OK

let _ = resolve_symname(*frame, |symname| {
if let Some(mangled_symbol_name) = symname {
// Use grep to find the concerned functions
if mangled_symbol_name.contains("__rust_begin_short_backtrace") {

This comment has been minimized.

@alexcrichton

alexcrichton May 8, 2017

Member

This should have a deterministic symbol name, right? Would it be possible to use == here?

This comment has been minimized.

@Yamakaky

This comment has been minimized.

@alexcrichton

alexcrichton May 9, 2017

Member

Ah yes right, that's a good point.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented May 9, 2017

Ok looks good to me! Want to squash and I'll r+?

@Yamakaky

This comment has been minimized.

Copy link
Contributor Author

Yamakaky commented May 9, 2017

Yeay !

Don't show the std frames before user code on unwinding.
When `RUST_BACKTRACE=1`, remove all frames after
`__rust_maybe_catch_panic`. Tested on `main`, threads, tests and
benches. Cleaning of the top of the stacktrace is let to a future PR.

Fixes #40201

See #41815

@Yamakaky Yamakaky force-pushed the Yamakaky:improve-backtrace-bottom branch from 7b41ca0 to ca8b754 May 9, 2017

@Yamakaky

This comment has been minimized.

Copy link
Contributor Author

Yamakaky commented May 9, 2017

(not really proud of the commit's title ^^)

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented May 9, 2017

@bors: r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented May 9, 2017

📌 Commit ca8b754 has been approved by alexcrichton

@alexcrichton alexcrichton added the T-libs label May 9, 2017

frewsxcv added a commit to frewsxcv/rust that referenced this pull request May 10, 2017

Rollup merge of rust-lang#41815 - Yamakaky:improve-backtrace-bottom, …
…r=alexcrichton

Improve cleaning of the bottom of the backtrace

Following rust-lang#40264. It only cleans the bottom of the trace (after the main). It handles correctly the normal main, tests, benchmarks and threads.

I kept `skipped_before` since it will be used later for the cleaning of the top.

bors added a commit that referenced this pull request May 10, 2017

Auto merge of #41869 - frewsxcv:rollup, r=frewsxcv
Rollup of 11 pull requests

- Successful merges: #41531, #41536, #41659, #41684, #41764, #41815, #41843, #41861, #41862, #41863, #41864
- Failed merges:

frewsxcv added a commit to frewsxcv/rust that referenced this pull request May 10, 2017

Rollup merge of rust-lang#41815 - Yamakaky:improve-backtrace-bottom, …
…r=alexcrichton

Improve cleaning of the bottom of the backtrace

Following rust-lang#40264. It only cleans the bottom of the trace (after the main). It handles correctly the normal main, tests, benchmarks and threads.

I kept `skipped_before` since it will be used later for the cleaning of the top.

bors added a commit that referenced this pull request May 10, 2017

Auto merge of #41872 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests

- Successful merges: #41531, #41536, #41764, #41809, #41815, #41861, #41862, #41863, #41864
- Failed merges:
@bors

This comment has been minimized.

Copy link
Contributor

bors commented May 10, 2017

⌛️ Testing commit ca8b754 with merge 25a1617...

bors added a commit that referenced this pull request May 10, 2017

Auto merge of #41815 - Yamakaky:improve-backtrace-bottom, r=alexcrichton
Improve cleaning of the bottom of the backtrace

Following #40264. It only cleans the bottom of the trace (after the main). It handles correctly the normal main, tests, benchmarks and threads.

I kept `skipped_before` since it will be used later for the cleaning of the top.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented May 10, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 25a1617 to master...

@bors bors merged commit ca8b754 into rust-lang:master May 10, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@Yamakaky Yamakaky deleted the Yamakaky:improve-backtrace-bottom branch May 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.