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

compiletest: detect non-ICE compiler panics #49891

Merged
merged 3 commits into from
Apr 27, 2018

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Apr 11, 2018

Fixes #49888, but will be blocked by revealing #49889.

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 11, 2018
@alexcrichton
Copy link
Member

Looks good to me, but if this can't land I'll hold off on approving

@rust-highfive
Copy link
Collaborator

Your PR failed on Travis (raw log). 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:49] configure: rust.quiet-tests     := True
---
[00:59:04] ..............................................................................i.....................
[00:59:12] .....................i..............................................................................
---
[01:00:05] i..........................................................................i........................
---
[01:01:20] .............................................i......................................................
---
[01:06:37] .............................i......................................................................
[01:06:55] ..............................................................i.....................................
[01:07:15] ...............................................i....................................................
[01:07:41] ....................................................................................................
[01:08:09] ....................................................................................................
[01:08:38] ....................................................................................................
[01:09:10] ...i...............................................................................................i
[01:09:28] ........................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[01:09:59] ............................................................
[01:10:39] ....................................................................................................
[01:11:25] .................................................................ii.................................
[01:12:06] ............................i........................test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[01:12:30] ............................i.ii...............
[01:13:23] .........................................................................................iiiiiii....
---
[01:16:54] ...................i............................................................ii.iii..............
[01:17:03] ....................................................................................................
[01:17:13] .........i..............................i...........................................................
[01:17:23] ....................................................................................................
[01:17:31] .....................i..............................................................................
[01:17:41] ....................................................................................................
[01:17:53] ....................................................................................................
[01:18:06] ......................................F.............................................................
[01:18:19] ....................................................................................................
[01:18:35] ...............................................................................................test [compile-fail] compile-fail/issue-22638.rs has been running for over 60 seconds
[01:18:35] .....
[01:18:47] ..............i.....................................................................................
[01:18:59] ..................i..ii.............................................................................
[01:19:11] ....................................................................................................
[01:19:23] ....................................................................................................
[01:19:34] .....................................................................................i..............
[01:19:46] ...............................i....................................................................
---
[01:20:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-36638.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-36638.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-O" "-Zmiri" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "continue-parse-after-error" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-36638.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
---
[01:20:28] {"message":"expected identifier, found keyword `Self`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/compile-fail/issue-36638.rs","byte_start":527,"byte_end":531,"line_start":13,"line_end":13,"column_start":12,"column_end":16,"is_primary":true,"text":[{"text":"struct Foo<Self>(Self);","highlight_start":12,"highlight_end":16}],"label":"expected identifier, found keyword","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: expected identifier, found keyword `Self`\n  --> /checkout/src/test/compile-fail/issue-36638.rs:13:12\n   |\nLL | struct Foo<Self>(Self);\n   |            ^^^^ expected identifier, found keyword\n\n"}
[01:20:28] {"message":"expected identifier, found keyword `Self`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/compile-fail/issue-36638.rs","byte_start":604,"byte_end":608,"line_start":16,"line_end":16,"column_start":11,"column_end":15,"is_primary":true,"text":[{"text":"trait Bar<Self> {}","highlight_start":11,"highlight_end":15}],"label":"expected identifier, found keyword","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error: expected identifier, found keyword `Self`\n  --> /checkout/src/test/compile-fail/issue-36638.rs:16:11\n   |\nLL | trait Bar<Self> {}\n   |           ^^^^ expected identifier, found keyword\n\n"}
[01:20:28] thread 'main' panicked at 'assertion failed: `(left == right)`
[01:20:28]   left: `1`,
[01:20:28]  right: `0`', librustc/ty/sty.rs:889:13
[01:20:28] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:20:28] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:20:28]
[01:20:28] ------------------------------------------
[01:20:28]
[01:20:28] thread '[compile-fail] compile-fail/issue-36638.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2921:9
---
[01:20:28] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/compile-fail" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "compile-fail" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zmiri -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zmiri -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:20:28] expected success, got: exit code: 101
[01:20:28]
[01:20:28]
[01:20:28] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:20:28] Build completed unsuccessfully in 0:23:02
[01:20:28] make: *** [check] Error 1
[01:20:28] Makefile:58: recipe for target 'check' failed
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:0aa2e856:start=1523492230860319297,finish=1523492230878738718,duration=18419421
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:0525e49c
$ 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:0525e49c:start=1523492230885863212,finish=1523492230892923066,duration=7059854
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:2a62f880
$ dmesg | grep -i kill
[   10.962759] init: failsafe main process (1094) 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. (Feature Requests)

@cuviper
Copy link
Member Author

cuviper commented Apr 12, 2018

Good bot -- that is #49889 as expected.

@kennytm kennytm added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 14, 2018
@kennytm
Copy link
Member

kennytm commented Apr 14, 2018

Blocked by #49889.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). 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:54:15] ....i.......................................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:54:19] ........
[00:54:50] ....................................................................................................
[00:55:19] ......................................................................ii............................
[00:56:12] .................................i....................................................i.ii......test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[00:56:55] ..............................................................................................iiiiii
[00:57:22] i...................................................................................................
[00:57:52] ....................................................................................................
[00:58:20] ....................................................................................................
---
[00:58:38] 
[00:58:38] running 2311 tests
[00:58:44] ....................................................................................................
[00:58:51] ....................................................................................................
[00:58:57] ......................................................................F.............................
[00:59:12] ....................i............................................................ii.iii.............
[00:59:18] ....................................................................................................
[00:59:26] .........i..............................i...........................................................
[00:59:33] ....................................................................................................
---
[01:01:58] failures:
[01:01:58] 
[01:01:58] ---- [compile-fail] compile-fail/borrowck/two-phase-reservation-sharing-interference.rs stdout ----
[01:01:58]  
[01:01:58] error in revision `nll_beyond`: compiler panicked
[01:01:58] status: exit code: 101
[01:01:58] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail" "--target=x86_64-unknown-linux-gnu" "--cfg" "nll_beyond" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.stage2-x86_64-unknown-linux-gnu" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "borrowck=mir" "-Z" "two-phase-borrows" "-Z" "two-phase-beyond-autoref" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.stage2-x86_64-unknown-linux-gnu.aux" "-A" "unused"
[01:01:58] ------------------------------------------
[01:01:58] 
[01:01:58] ------------------------------------------
[01:01:58] stderr:
[01:01:58] stderr:
[01:01:58] ------------------------------------------
[01:01:58] {"message":"cannot borrow `vec` as mutable because it is also borrowed as immutable","code":{"code":"E0502","explanation":"\nThis error indicates that you are trying to borrow a variable as mutable when it\nhas already been borrowed as immutable.\n\nExample of erroneous code:\n\n```compile_fail,E0502\nfn bar(x: &mut i32) {}\nfn foo(a: &mut i32) {\n    let ref y = a; // a is borrowed as immutable.\n    bar(a); // error: cannot borrow `*a` as mutable because `a` is also borrowed\n            //        as immutable\n}\n```\n\nTo fix this error, ensure that you don't have any other references to the\nvariable before trying to access it mutably:\n\n```\nfn bar(x: &mut i32) {}\nfn foo(a: &mut i32) {\n    bar(a);\n    let ref y = a; // ok!\n}\n```\n\nFor more information on the rust ownership system, take a look at\nhttps://doc.rust-lang.org/stable/book/references-and-borrowing.html.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs","byte_start":1895,"byte_end":1911,"line_start":46,"line_end":46,"column_start":9,"column_end":25,"is_primary":true,"text":[{"text":"        delay = &mut vec;","highlight_start":9,"highlight_end":25}],"label":"mutable borrow occurs here","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs","byte_start":1718,"byte_end":1722,"line_start":41,"line_end":41,"column_start":22,"column_end":26,"is_primary":false,"text":[{"text":"        let shared = &vec;","highlight_start":22,"highlight_end":26}],"label":"immutable borrow occurs here","suggested_replacement":null,"expansion":null},{"file_name":"/checkout/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs","byte_start":2130,"byte_end":2136,"line_start":50,"line_end":50,"column_start":9,"column_end":15,"is_primary":false,"text":[{"text":"        shared[0];","highlight_start":9,"highlight_end":15}],"label":"borrow later used here","suggested_replacement":null,"expansion":null}],"children":[],"rendered":"error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable\n  --> /checkout/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs:46:9\n   |\nLL |         let shared = &vec;\n   |                      ---- immutable borrow occurs here\n...\nLL |         delay = &mut vec;\n   |         ^^^^^^^^^^^^^^^^ mutable borrow occurs here\n...\nLL |         shared[0];\n   |         ------ borrow later used here\n\n"}
[01:01:58] thread 'main' panicked at 'assertion failed: match borrow.kind {{
[01:01:58]     BorrowKind::Shared => false,
[01:01:58]     BorrowKind::Unique | BorrowKind::Mut {{ .. }} => true,
[01:01:58] }}', librustc_mir/borrow_check/mod.rs:1252:13
[01:01:58] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:01:58] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:01:58] {"message":"For more information about this error, try `rustc --explain E0502`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0502`.\n"}
[01:01:58] ------------------------------------------
[01:01:58] 
[01:01:58] thread '[compile-fail] compile-fail/borrowck/two-phase-reservation-sharing-interference.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2938:9
[01:01:58] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[01:01:58] 
[01:01:58] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:488:22
[01:01:58] 
[01:01:58] 
[01:01:58] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/compile-fail" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "compile-fail" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:01:58] 
[01:01:58] 
[01:01:58] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:01:58] Build completed unsuccessfully in 0:18:24
[01:01:58] Build completed unsuccessfully in 0:18:24
[01:01:58] Makefile:58: recipe for target 'check' failed
[01:01:58] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0f81ed45
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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. (Feature Requests)

@cuviper
Copy link
Member Author

cuviper commented Apr 20, 2018

Oh joy, found another compiler panic!

@cuviper
Copy link
Member Author

cuviper commented Apr 20, 2018

cc @nikomatsakis -- seems you last tweaked nll_beyond in #49836.

@cuviper
Copy link
Member Author

cuviper commented Apr 20, 2018

Filed #50128.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 20, 2018
This commit papers over rust-lang#49889 (introducing a fixme pointing at rust-lang#50125) for a
bug that was introduced with rust-lang#49695. This workaround is taken from rust-lang#49891.
cuviper added 3 commits April 24, 2018 16:16
A comment already stated that this test should be disabled, but its
`should_fail` is not enough to excuse it from a compiler panic.  Remove
it from the `revisions` list to disable it harder.
@cuviper cuviper force-pushed the compiletest-crash branch from 50fe8f8 to fedee13 Compare April 24, 2018 23:52
@cuviper
Copy link
Member Author

cuviper commented Apr 24, 2018

I disabled nll_beyond per #50128 (comment).

@cuviper
Copy link
Member Author

cuviper commented Apr 25, 2018

Yay, the initial CI passed!

@cuviper cuviper added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Apr 25, 2018
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Apr 25, 2018

📌 Commit fedee13 has been approved by alexcrichton

@bors bors 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 25, 2018
@bors
Copy link
Contributor

bors commented Apr 27, 2018

⌛ Testing commit fedee13 with merge 9822b57...

bors added a commit that referenced this pull request Apr 27, 2018
compiletest: detect non-ICE compiler panics

Fixes #49888, but will be blocked by revealing #49889.
@bors
Copy link
Contributor

bors commented Apr 27, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: 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.

5 participants