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

ICE in nightly-2020-02-08: handle TerminatorKind::Yield in librustc_mir::transform::promote_consts::Validator method #69032

Merged
merged 3 commits into from
Feb 12, 2020

Conversation

chrissimpkins
Copy link
Member

@chrissimpkins chrissimpkins commented Feb 10, 2020

IR: #69017
regressed commit: f8fd462
Source: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=55e65a869e1f5fef64cc4462b1a5a087

Addresses ICE reported in #69017 by handling TerminatorKind::Yield in

TerminatorKind::Call { func, args, .. } => self.validate_call(func, args),
kind => {
span_bug!(terminator.source_info.span, "{:?} not promotable", kind);
}
.

Nightly build

$ cargo +nightly build
Compiling yielder v0.1.0 (/Users/chris/Desktop/tests/rustlang-tests/yielder)
error: internal compiler error: src/librustc_mir/transform/promote_consts.rs:467: _1 = suspend(move _21) -> [resume: bb2, drop: bb3] not promotable
 --> src/main.rs:8:27
  |
8 |         println!("-> {}", yield);
  |                           ^^^^^

thread 'rustc' panicked at 'Box<Any>', <::std::macros::panic macros>:2:4
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.43.0-nightly (71c7e149e 2020-02-09) running on x86_64-apple-darwin

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: aborting due to previous error

error: could not compile `yielder`.

To learn more, run the command again with --verbose.

Stage 1 dev build

$ cargo +stage1 build
Compiling yielder v0.1.0 (/Users/chris/Desktop/tests/rustlang-tests/yielder)
warning: function is never used: `gen`
 --> src/main.rs:6:4
  |
6 | fn gen() -> impl Generator<usize> {
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

    Finished dev [unoptimized + debuginfo] target(s) in 0.53s

@jonas-schievink @oli-obk

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2020
@jonas-schievink
Copy link
Contributor

Neat! Can you add a test for this in the src/test/ui/generator folder? https://rust-lang.github.io/rustc-guide/tests/intro.html

@chrissimpkins
Copy link
Member Author

chrissimpkins commented Feb 10, 2020

Can you add a test for this in the src/test/ui/generator folder?

fc3ecb2

@chrissimpkins
Copy link
Member Author

// check-pass header command is ok here correct?

@chrissimpkins chrissimpkins changed the title ICE in nightly-2020-02-08: handle Terminator::Yield in librustc_mir::transform::promote_consts::Validator method ICE in nightly-2020-02-08: handle TerminatorKind::Yield in librustc_mir::transform::promote_consts::Validator method Feb 10, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, 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.
2020-02-10T17:04:45.3842238Z ========================== Starting Command Output ===========================
2020-02-10T17:04:45.3843619Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/f6226868-2f4a-40c4-831c-a1621704e23e.sh
2020-02-10T17:04:45.3843652Z 
2020-02-10T17:04:45.3845699Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-10T17:04:45.3852244Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69032/merge to s
2020-02-10T17:04:45.3853991Z Task         : Get sources
2020-02-10T17:04:45.3854068Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-10T17:04:45.3854101Z Version      : 1.0.0
2020-02-10T17:04:45.3854133Z Author       : Microsoft
---
2020-02-10T17:04:46.3657160Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-10T17:04:46.3669145Z ##[command]git config gc.auto 0
2020-02-10T17:04:46.3671359Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-10T17:04:46.3673117Z ##[command]git config --get-all http.proxy
2020-02-10T17:04:46.3679623Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/69032/merge:refs/remotes/pull/69032/merge
---
2020-02-10T18:02:21.2732881Z .................................................................................................... 1700/9626
2020-02-10T18:02:25.9954274Z .................................................................................................... 1800/9626
2020-02-10T18:02:38.0524193Z .............................i...................................................................... 1900/9626
2020-02-10T18:02:45.3473443Z .................................................................................................... 2000/9626
2020-02-10T18:02:59.4346141Z ...................iiiii............................................................................ 2100/9626
2020-02-10T18:03:09.0201672Z .................................................................................................... 2300/9626
2020-02-10T18:03:11.4047116Z .................................................................................................... 2400/9626
2020-02-10T18:03:16.1223221Z .................................................................................................... 2500/9626
2020-02-10T18:03:36.6756128Z .................................................................................................... 2600/9626
---
2020-02-10T18:06:14.6883013Z .......................................................................i...............i............ 4900/9626
2020-02-10T18:06:22.3350091Z .................................................................................................... 5000/9626
2020-02-10T18:06:30.2800258Z .................................................................................................... 5100/9626
2020-02-10T18:06:34.8025009Z .............i...................................................................................... 5200/9626
2020-02-10T18:06:45.8447410Z .......................................................................................ii.ii........ 5300/9626
2020-02-10T18:06:49.6242450Z i...i............................................................................................... 5400/9626
2020-02-10T18:07:01.3879950Z .................................................................................................... 5600/9626
2020-02-10T18:07:09.5228601Z ...........................................................................i........................ 5700/9626
2020-02-10T18:07:16.8484439Z .................................................................................................... 5800/9626
2020-02-10T18:07:23.0375654Z .................................................................................................... 5900/9626
2020-02-10T18:07:23.0375654Z .................................................................................................... 5900/9626
2020-02-10T18:07:32.8526925Z ...................................................................ii...i..ii...........i........... 6000/9626
2020-02-10T18:07:53.7746122Z .................................................................................................... 6200/9626
2020-02-10T18:08:01.1944487Z .................................................................................................... 6300/9626
2020-02-10T18:08:08.9252616Z ...............................................................................................i..ii 6400/9626
2020-02-10T18:08:24.2772455Z .................................................................................................... 6500/9626
---
2020-02-10T18:10:26.5067785Z .................................................................................................... 7600/9626
2020-02-10T18:10:30.4540398Z .................................................................................................... 7700/9626
2020-02-10T18:10:35.8276403Z .................................................................................................... 7800/9626
2020-02-10T18:10:44.0848060Z .................................................................................................... 7900/9626
2020-02-10T18:10:52.9294587Z ....................................................................iiiiiii.i....................... 8000/9626
2020-02-10T18:11:08.4145685Z ........i......i.................................................................................... 8200/9626
2020-02-10T18:11:13.7623034Z .................................................................................................... 8300/9626
2020-02-10T18:11:27.1577470Z .................................................................................................... 8400/9626
2020-02-10T18:11:36.5751034Z .................................................................................................... 8500/9626
---
2020-02-10T18:13:32.9612217Z ---- [ui] ui/generator/issue-69017.rs stdout ----
2020-02-10T18:13:32.9612309Z 
2020-02-10T18:13:32.9612595Z error: test compilation failed although it shouldn't!
2020-02-10T18:13:32.9612644Z status: exit code: 1
2020-02-10T18:13:32.9613408Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/generator/issue-69017.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generator/issue-69017" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generator/issue-69017/auxiliary" "-A" "unused"
2020-02-10T18:13:32.9613719Z ------------------------------------------
2020-02-10T18:13:32.9613749Z 
2020-02-10T18:13:32.9613949Z ------------------------------------------
2020-02-10T18:13:32.9614007Z stderr:
---
2020-02-10T18:13:32.9615031Z LL | | use std::ops::Generator;
2020-02-10T18:13:32.9615087Z ...  |
2020-02-10T18:13:32.9615332Z LL | |     }
2020-02-10T18:13:32.9615371Z LL | | }
2020-02-10T18:13:32.9615818Z    | |_^ consider adding a `main` function to `/checkout/src/test/ui/generator/issue-69017.rs`
2020-02-10T18:13:32.9615917Z error: aborting due to previous error
2020-02-10T18:13:32.9615942Z 
2020-02-10T18:13:32.9616182Z For more information about this error, try `rustc --explain E0601`.
2020-02-10T18:13:32.9616213Z 
---
2020-02-10T18:13:32.9644842Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-02-10T18:13:32.9645143Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-02-10T18:13:32.9656687Z 
2020-02-10T18:13:32.9656919Z 
2020-02-10T18:13:32.9662576Z 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/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-02-10T18:13:32.9663320Z 
2020-02-10T18:13:32.9663461Z 
2020-02-10T18:13:32.9667603Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2020-02-10T18:13:32.9667845Z Build completed unsuccessfully in 1:02:42
2020-02-10T18:13:32.9667845Z Build completed unsuccessfully in 1:02:42
2020-02-10T18:13:32.9717135Z == clock drift check ==
2020-02-10T18:13:32.9738689Z   local time: Mon Feb 10 18:13:32 UTC 2020
2020-02-10T18:13:33.2663835Z   network time: Mon, 10 Feb 2020 18:13:33 GMT
2020-02-10T18:13:33.2666405Z == end clock drift check ==
2020-02-10T18:13:33.6852259Z 
2020-02-10T18:13:33.6972178Z ##[error]Bash exited with code '1'.
2020-02-10T18:13:33.6984574Z ##[section]Finishing: Run build
2020-02-10T18:13:33.7005347Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/69032/merge to s
2020-02-10T18:13:33.7007063Z Task         : Get sources
2020-02-10T18:13:33.7007130Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-10T18:13:33.7007177Z Version      : 1.0.0
2020-02-10T18:13:33.7007218Z Author       : Microsoft
2020-02-10T18:13:33.7007218Z Author       : Microsoft
2020-02-10T18:13:33.7007301Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-10T18:13:33.7007351Z ==============================================================================
2020-02-10T18:13:34.1214838Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-10T18:13:34.1256311Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/69032/merge to s
2020-02-10T18:13:34.1367845Z Cleaning up task key
2020-02-10T18:13:34.1368600Z Start cleaning up orphan processes.
2020-02-10T18:13:34.1475492Z Terminate orphan process: pid (3665) (python)
2020-02-10T18:13:34.1705020Z ##[section]Finishing: Finalize Job

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)

@petrochenkov
Copy link
Contributor

petrochenkov commented Feb 10, 2020

@bors r+

@petrochenkov petrochenkov 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 Feb 10, 2020
@petrochenkov
Copy link
Contributor

@bors are you still there?

@chrissimpkins
Copy link
Member Author

chrissimpkins commented Feb 10, 2020

<crickets>

@jonas-schievink
Copy link
Contributor

https://buildbot2.rust-lang.org seems to be having certificate troubles too

@bors
Copy link
Contributor

bors commented Feb 11, 2020

📌 Commit 53b16fb has been approved by petrochenkov

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 12, 2020
…t-lang#69017, r=petrochenkov

ICE in nightly-2020-02-08: handle TerminatorKind::Yield in librustc_mir::transform::promote_consts::Validator method

IR: rust-lang#69017
regressed commit: rust-lang@f8fd462
Source: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=55e65a869e1f5fef64cc4462b1a5a087

Addresses ICE reported in rust-lang#69017 by handling `TerminatorKind::Yield` in https://github.com/rust-lang/rust/blob/4d1241f5158ffd66730e094d8f199ed654ed52ae/src/librustc_mir/transform/promote_consts.rs#L465-L468.

<details><summary>Nightly build</summary>
<p>

```
$ cargo +nightly build
Compiling yielder v0.1.0 (/Users/chris/Desktop/tests/rustlang-tests/yielder)
error: internal compiler error: src/librustc_mir/transform/promote_consts.rs:467: _1 = suspend(move _21) -> [resume: bb2, drop: bb3] not promotable
 --> src/main.rs:8:27
  |
8 |         println!("-> {}", yield);
  |                           ^^^^^

thread 'rustc' panicked at 'Box<Any>', <::std::macros::panic macros>:2:4
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.43.0-nightly (71c7e14 2020-02-09) running on x86_64-apple-darwin

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: aborting due to previous error

error: could not compile `yielder`.

To learn more, run the command again with --verbose.
```

</p>
</details>

<details><summary>Stage 1 dev build</summary>
<p>

```
$ cargo +stage1 build
Compiling yielder v0.1.0 (/Users/chris/Desktop/tests/rustlang-tests/yielder)
warning: function is never used: `gen`
 --> src/main.rs:6:4
  |
6 | fn gen() -> impl Generator<usize> {
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

    Finished dev [unoptimized + debuginfo] target(s) in 0.53s
```

</p>
</details>

@jonas-schievink @oli-obk
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 12, 2020
…t-lang#69017, r=petrochenkov

ICE in nightly-2020-02-08: handle TerminatorKind::Yield in librustc_mir::transform::promote_consts::Validator method

IR: rust-lang#69017
regressed commit: rust-lang@f8fd462
Source: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=55e65a869e1f5fef64cc4462b1a5a087

Addresses ICE reported in rust-lang#69017 by handling `TerminatorKind::Yield` in https://github.com/rust-lang/rust/blob/4d1241f5158ffd66730e094d8f199ed654ed52ae/src/librustc_mir/transform/promote_consts.rs#L465-L468.

<details><summary>Nightly build</summary>
<p>

```
$ cargo +nightly build
Compiling yielder v0.1.0 (/Users/chris/Desktop/tests/rustlang-tests/yielder)
error: internal compiler error: src/librustc_mir/transform/promote_consts.rs:467: _1 = suspend(move _21) -> [resume: bb2, drop: bb3] not promotable
 --> src/main.rs:8:27
  |
8 |         println!("-> {}", yield);
  |                           ^^^^^

thread 'rustc' panicked at 'Box<Any>', <::std::macros::panic macros>:2:4
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.43.0-nightly (71c7e14 2020-02-09) running on x86_64-apple-darwin

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: aborting due to previous error

error: could not compile `yielder`.

To learn more, run the command again with --verbose.
```

</p>
</details>

<details><summary>Stage 1 dev build</summary>
<p>

```
$ cargo +stage1 build
Compiling yielder v0.1.0 (/Users/chris/Desktop/tests/rustlang-tests/yielder)
warning: function is never used: `gen`
 --> src/main.rs:6:4
  |
6 | fn gen() -> impl Generator<usize> {
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

    Finished dev [unoptimized + debuginfo] target(s) in 0.53s
```

</p>
</details>

@jonas-schievink @oli-obk
bors added a commit that referenced this pull request Feb 12, 2020
Rollup of 8 pull requests

Successful merges:

 - #67585 (Improve `char::is_ascii_*` codegen)
 - #68914 (Speed up `SipHasher128`.)
 - #68994 (rustbuild: include channel in sanitizers installed name)
 - #69032 (ICE in nightly-2020-02-08: handle TerminatorKind::Yield in librustc_mir::transform::promote_consts::Validator method)
 - #69034 (parser: Remove `Parser::prev_token_kind`)
 - #69042 (Remove backtrace header text)
 - #69059 (Remove a few unused objects)
 - #69089 (Properly use the darwin archive format on Apple targets)

Failed merges:

r? @ghost
@bors bors merged commit 53b16fb into rust-lang:master Feb 12, 2020
@chrissimpkins chrissimpkins deleted the ice-yield-println-#69017 branch February 12, 2020 20:15
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