Skip to content

Print query stack on ICEs - #49222

Merged
bors merged 1 commit into
rust-lang:masterfrom
Zoxc:print-query-stack
Apr 7, 2018
Merged

Print query stack on ICEs#49222
bors merged 1 commit into
rust-lang:masterfrom
Zoxc:print-query-stack

Conversation

@Zoxc

@ZoxcZoxc commented Mar 20, 2018

Copy link
Copy Markdown
Contributor

ICE output is now:

thread 'rustc' panicked at 'no borrowck', librustc_borrowck\borrowck\mod.rs:95:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
query stack during panic:
#0 [borrowck] processing `main`
--> no-std.rs:10:1
|
10 | fn main() {}
| ^^^^^^^^^
end of query stack
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.26.0-dev running on x86_64-pc-windows-msvc

Fixes#42529.

r? @eddyb

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 20, 2018
@emilyalbini

Copy link
Copy Markdown
Member

Can we get a review on this PR @eddyb (or someone else from @rust-lang/compiler)?

@eddyb

Copy link
Copy Markdown
Contributor

LGTM. r? @nikomatsakis

@nagisa

Copy link
Copy Markdown
Member

I think it would be preferable if we did this only when RUST_BACKTRACE is enabled – mostly for the reasons that also apply for not printing backtraces by default – the clutter makes it hard(er) to notice these lines:

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.26.0-dev running on x86_64-pc-windows-msvc

@nikomatsakis

Copy link
Copy Markdown
Contributor

Hmm I think I agree with @nagisa -- this feels like a ton of output to dump by default. But it seems very useful!

@Zoxc
Zoxcforce-pushed the print-query-stack branch from ff8dd38 to df99236CompareApril 5, 2018 09:54
@Zoxc

Zoxc commented Apr 5, 2018

Copy link
Copy Markdown
ContributorAuthor

I've changed it so it only prints the query stack when RUST_BACKTRACE is set to a non-0 value.

@bors

bors commented Apr 5, 2018

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #49045) made this pull request unmergeable. Please resolve the merge conflicts.

@Zoxc
Zoxcforce-pushed the print-query-stack branch from df99236 to 83a173fCompareApril 6, 2018 12:43
@TimNN

TimNN commented Apr 6, 2018

Copy link
Copy Markdown
Contributor

Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:00:47] configure: rust.quiet-tests := True
---
[00:07:23] error[E0609]: no field `query_stack` on type `ty::maps::Maps<'_>`
[00:07:23] --> librustc/ty/maps/plumbing.rs:114:38
[00:07:23] |
[00:07:23] 114 | if let Ok(stack) = self.maps.query_stack.try_borrow() {
[00:07:23] | ^^^^^^^^^^^ unknown field
[00:07:23] |
[00:07:23] = note: available fields are: `providers`, `type_of`, `generics_of`, `predicates_of`, `super_predicates_of` ... and 141 others
---
[00:07:32] process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc librustc/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=b061046bb39a474d -C extra-filename=-b061046bb39a474d --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern flate2=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libflate2-0249ed74490015f9.rlib --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f27fded04dd31022.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f27fded04dd31022.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-7eebd272275b441b.rlib --extern lazy_static=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblazy_static-3c1d922a28d91411.rlib --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-069d1433ad059ff1.so --extern jobserver=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libjobserver-3c385cb05f9c08fa.rlib --extern rustc_const_math=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_const_math-2cbdd37d611532dc.so --extern arena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libarena-2e4ce590106ede04.so --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-b23276248c684a7d.rlib --extern byteorder=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbyteorder-f04ca02424a68c4e.rlib --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-e01ce88b04783514.rlib --extern backtrace=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbacktrace-a7efadae36f54a3c.rlib --extern proc_macro=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libproc_macro-414d7e12269f768c.so --extern fmt_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libfmt_macros-5106459147843225.so --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-1e725c22de2888b8.so --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-67023beb7edf290b.so --extern rustc_back=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_back-c188df8980be19c3.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-d823127e323fa243.so --extern graphviz=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libgraphviz-01fc77d929e8bdd6.so --extern tempdir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libtempdir-728fcbc86125f341.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-751752dec0960570/out/.libs -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-07c608814ba8d6ba/out` (exit code: 101)
[00:07:32] travis_fold:end:stage0-rustc
[00:07:32] travis_time:end:stage0-rustc:start=1523018980323861020,finish=1523019158311337347,duration=177987476327
[00:07:32] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:07:32] expected success, got: exit code: 101
[00:07:32] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1085:9
[00:07:32] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:07:32] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:07:32] Build completed unsuccessfully in 0:03:10
[00:07:32] Makefile:28: recipe for target 'all' failed
[00:07:32] make: *** [all] Error 1
---
$ dmesg | grep -i kill
[ 10.204158] init: failsafe main process (1093) killed by TERM signal

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN.

@Zoxc
Zoxcforce-pushed the print-query-stack branch from 83a173f to 8cd3d05CompareApril 6, 2018 14:02
@TimNN

TimNN commented Apr 6, 2018

Copy link
Copy Markdown
Contributor

Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:00:47] configure: rust.quiet-tests := True
---
[00:05:00] tidy error: /checkout/src/librustc/ty/maps/plumbing.rs:124: line longer than 100 chars
[00:05:02] some tidy checks failed
[00:05:02]
[00:05:02]
[00:05:02] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:05:02] expected success, got: exit code: 1
[00:05:02]
[00:05:02]
[00:05:02] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:05:02] Build completed unsuccessfully in 0:01:52
[00:05:02] make: *** [tidy] Error 1
[00:05:02] Makefile:79: recipe for target 'tidy' failed
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:0d064240:start=1523023776511891361,finish=1523023776521780964,duration=9889603
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:12156fc8
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:12156fc8:start=1523023776530212822,finish=1523023776539053659,duration=8840837
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0af8f169
$ dmesg | grep -i kill
[ 11.751274] init: failsafe main process (1092) killed by TERM signal

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN.

@Zoxc
Zoxcforce-pushed the print-query-stack branch from 8cd3d05 to 4fd188eCompareApril 6, 2018 14:23
@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 6, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 4fd188e has been approved by nikomatsakis

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 6, 2018
@bors

bors commented Apr 7, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 4fd188e with merge ee1014e...

bors added a commit that referenced this pull request Apr 7, 2018
Print query stack on ICEs
ICE output is now:
```
thread 'rustc' panicked at 'no borrowck', librustc_borrowck\borrowck\mod.rs:95:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
query stack during panic:
#0 [borrowck] processing `main`
--> no-std.rs:10:1
|
10 | fn main() {}
| ^^^^^^^^^
end of query stack
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.26.0-dev running on x86_64-pc-windows-msvc
```
Fixes#42529.
r? @eddyb
@bors

bors commented Apr 7, 2018

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing ee1014e to master...

@bors
bors merged commit 4fd188e into rust-lang:masterApr 7, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@Zoxc@emilyalbini@eddyb@nagisa@nikomatsakis@bors@TimNN@rust-highfive