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

Use `panic::set_hook` to print the ICE message #60584

Open
wants to merge 7 commits into
base: master
from

Conversation

@jonas-schievink
Copy link
Member

commented May 6, 2019

This allows custom frontends and backends to override the hook with their own, for example to point people to a different issue tracker.

ICE messages are printed in a slightly different order now. Nightly prints:

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.

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.36.0-nightly (08bfe1612 2019-05-02) running on x86_64-unknown-linux-gnu

After this PR, rustc prints:

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

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.36.0-dev running on x86_64-unknown-linux-gnu

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.
@davidtwco

This comment has been minimized.

Copy link
Member

commented May 6, 2019

r? @Zoxc (suggested by GitHub)

@rust-highfive rust-highfive assigned Zoxc and unassigned davidtwco May 6, 2019

@Zoxc

This comment was marked as resolved.

Copy link
Contributor

commented May 6, 2019

@jonas-schievink

This comment was marked as resolved.

Copy link
Member Author

commented May 6, 2019

True... That requires moving a lot of command line handling code from the driver into librustc though. Actually I might just move that one into the new handler.

@jonas-schievink jonas-schievink force-pushed the jonas-schievink:ice-panic-hook branch from 20f3215 to ced3690 May 6, 2019

@jonas-schievink jonas-schievink requested a review from Zoxc May 9, 2019

Show resolved Hide resolved src/librustc_driver/lib.rs Outdated
@@ -444,7 +444,8 @@ where R: 'static + Send,

let (tx, rx) = channel();

let result = rustc_driver::report_ices_to_stderr_if_any(move || {
rustc_driver::install_ice_hook();

This comment has been minimized.

Copy link
@Zoxc

Zoxc May 10, 2019

Contributor

This may cause problem for tests. We don't want to use the custom panic hook for them.

This comment has been minimized.

Copy link
@jonas-schievink

jonas-schievink May 13, 2019

Author Member

I've played around with this for a bit and couldn't notice any rustdoc changes, except that ICEs while building a test are missing the query stack for some reason, which seems odd.

This comment has been minimized.

Copy link
@jonas-schievink

jonas-schievink May 13, 2019

Author Member

Correction: The hook in this PR never seems to be called when doing rustdoc --test bla.rs. On nightly, the query stack hook still runs, but the normal ICE message isn't printed.

run_compiler is apparently only called for building documentation, not for running tests.

I'll change it to also register the hook when running doctests, since that matches the old behavior more closely, and having proper ICE messages there is a useful thing.

This comment has been minimized.

Copy link
@jonas-schievink

jonas-schievink May 13, 2019

Author Member

The ICE message printed by the hook ends up escaping libtest's output capturing, so it looks really jarring. I've removed this line instead. The only thing lost is the query stack. A user will still see that an ICE is an ICE and can extract it into a non-doctest instead.

Let me know if this isn't good enough. Ideally we'd rework how rustdoc runs tests entirely so it behaves closer to the normal rustc frontend, but that's clearly out of scope for this PR.

@jonas-schievink jonas-schievink force-pushed the jonas-schievink:ice-panic-hook branch from ced3690 to ad4b76e May 10, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented May 10, 2019

The job x86_64-gnu-llvm-6.0 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.
travis_time:end:0fc2e1ce:start=1557503874130649525,finish=1557503874881205789,duration=750556264
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
#####################                                                     30.3%
######################################################################## 100.0%
[00:02:02] extracting /checkout/obj/build/cache/2019-04-11/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:02:02]     Updating crates.io index
[00:02:24] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:24] Build completed unsuccessfully in 0:00:35
[00:02:24] make: *** [prepare] Error 1
[00:02:24] Makefile:69: recipe for target 'prepare' failed
[00:02:25] Command failed. Attempt 2/5:
[00:02:25] Command failed. Attempt 2/5:
[00:02:26] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:26] Build completed unsuccessfully in 0:00:00
[00:02:26] Makefile:69: recipe for target 'prepare' failed
[00:02:26] make: *** [prepare] Error 1
[00:02:28] Command failed. Attempt 3/5:
[00:02:28] Command failed. Attempt 3/5:
[00:02:28] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:28] Build completed unsuccessfully in 0:00:00
[00:02:28] make: *** [prepare] Error 1
[00:02:28] Makefile:69: recipe for target 'prepare' failed
[00:02:31] Command failed. Attempt 4/5:
[00:02:31] Command failed. Attempt 4/5:
[00:02:31] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:31] Build completed unsuccessfully in 0:00:00
[00:02:31] make: *** [prepare] Error 1
[00:02:31] Makefile:69: recipe for target 'prepare' failed
[00:02:35] Command failed. Attempt 5/5:
[00:02:35] Command failed. Attempt 5/5:
[00:02:36] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:36] Build completed unsuccessfully in 0:00:00
[00:02:36] make: *** [prepare] Error 1
[00:02:36] Makefile:69: recipe for target 'prepare' failed
[00:02:36] The command has failed after 5 attempts.
---
travis_time:end:1e91887c:start=1557504042575094848,finish=1557504042580371177,duration=5276329
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:017e3050
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:07c01c56
travis_time:start:07c01c56
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:01753afe
$ dmesg | grep -i kill

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)

@jonas-schievink jonas-schievink force-pushed the jonas-schievink:ice-panic-hook branch from ad4b76e to 4f1eeef May 10, 2019

@Zoxc

This comment has been minimized.

Copy link
Contributor

commented May 19, 2019

@QuietMisdreavus Do you know enough about how panics are handled in rustdoc to review this?

@jonas-schievink

This comment has been minimized.

Copy link
Member Author

commented May 29, 2019

@QuietMisdreavus is no longer reviewing PRs, so maybe @GuillaumeGomez can help with the rustdoc-specific changes in here?

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

commented May 29, 2019

I confirm that rustdoc changes look good. But we still need the @rust-lang/compiler team to take a look.

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2019

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

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2019

I'm not 100% sure how this would be used by custom drivers to overwrite the panic behavior. Maybe add some docs and/or show it in a custom driver test.

The impl lgtm

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

commented Jun 6, 2019

AFAIK, rustdoc doesn't do anything special to handle panics when building docs, that rustc doesn't already do - there's a thread spawned in main, and the documentation process is surrounded by that call to rustc_driver that you changed.

When running doctests, though, it called inteface::run_compiler twice:

Once when collecting doctests:

let tests = interface::run_compiler(config, |compiler| -> Result<_, ErrorReported> {
let lower_to_hir = compiler.lower_to_hir()?;
let mut opts = scrape_test_config(lower_to_hir.peek().0.borrow().krate());
opts.display_warnings |= options.display_warnings;
let mut collector = Collector::new(
compiler.crate_name()?.peek().to_string(),
options.cfgs,
options.libs,
options.codegen_options,
options.externs,
false,
opts,
options.maybe_sysroot,
Some(compiler.source_map().clone()),
None,
options.linker,
options.edition,
options.persist_doctests,
);
let mut global_ctxt = compiler.global_ctxt()?.take();
global_ctxt.enter(|tcx| {
let krate = tcx.hir().krate();
let mut hir_collector = HirCollector {
sess: compiler.session(),
collector: &mut collector,
map: tcx.hir(),
codes: ErrorCodes::from(compiler.session().opts
.unstable_features.is_nightly_build()),
};
hir_collector.visit_testable("".to_string(), &krate.attrs, |this| {
intravisit::walk_crate(this, krate);
});
});
Ok(collector.tests)
}).expect("compiler aborted in rustdoc!");

And once per-doctest to compile them:

rust/src/librustdoc/test.rs

Lines 327 to 338 in 51dc52b

let compile_result = panic::catch_unwind(AssertUnwindSafe(|| {
interface::run_compiler(config, |compiler| {
if no_run {
compiler.global_ctxt().and_then(|global_ctxt| global_ctxt.take().enter(|tcx| {
tcx.analysis(LOCAL_CRATE)
})).ok();
} else {
compiler.compile().ok();
};
compiler.session().compile_status()
})
})).map_err(|_| ()).and_then(|s| s.map_err(|_| ()));

In addition, there's some manual work with parsers during make_test which is itself wrapped in a catch_unwind to deliberately mask ICEs (the assumption being that the ICE would be re-emitted later on):

rust/src/librustdoc/test.rs

Lines 202 to 212 in 51dc52b

let (test, line_offset) = match panic::catch_unwind(|| {
make_test(test, Some(cratename), as_test_harness, opts, edition)
}) {
Ok((test, line_offset)) => (test, line_offset),
Err(cause) if cause.is::<errors::FatalErrorMarker>() => {
// If the parser used by `make_test` panicked due to a fatal error, pass the test code
// through unchanged. The error will be reported during compilation.
(test.to_owned(), 0)
},
Err(cause) => panic::resume_unwind(cause),
};

I'm not sure what the desired approach is in this situation, but i or @euclio could provide more information if needed.

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member

commented Jul 9, 2019

@joelpalmer

This comment has been minimized.

Copy link

commented Jul 22, 2019

Ping from Triage, @oli-obk @jonas-schievink - any update on this PR? Thanks!

@jonas-schievink

This comment has been minimized.

Copy link
Member Author

commented Jul 22, 2019

Yeah, sorry for dropping the ball on this. I'll get to this soon, I hope.

@jonas-schievink jonas-schievink force-pushed the jonas-schievink:ice-panic-hook branch from 6307520 to 8147663 Jul 26, 2019

@jonas-schievink

This comment has been minimized.

Copy link
Member Author

commented Jul 26, 2019

Okay, rebased this and added docs.

@jonas-schievink

This comment has been minimized.

Copy link
Member Author

commented Jul 29, 2019

:(

Looks like #63106 will fix this flakiness

@jonas-schievink

This comment has been minimized.

Copy link
Member Author

commented Jul 29, 2019

@bors retry

@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2019

⌛️ Testing commit 82b2547 with merge e84c181...

bors added a commit that referenced this pull request Jul 30, 2019

Auto merge of #60584 - jonas-schievink:ice-panic-hook, r=GuillaumeGomez
Use `panic::set_hook` to print the ICE message

This allows custom frontends and backends to override the hook with their own, for example to point people to a different issue tracker.

ICE messages are printed in a slightly different order now. Nightly prints:

```
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.

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.36.0-nightly (08bfe16 2019-05-02) running on x86_64-unknown-linux-gnu
```

After this PR, rustc prints:

```
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

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.36.0-dev running on x86_64-unknown-linux-gnu

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.
```
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Jul 30, 2019

The job i686-apple of your PR failed (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.
2019-07-30T08:31:25.8578530Z 
2019-07-30T08:31:25.8578590Z + 
2019-07-30T08:31:25.8579030Z + error: internal compiler error: unexpected panic
2019-07-30T08:31:25.8579100Z + 
2019-07-30T08:31:25.8579190Z + note: the compiler unexpectedly panicked. this is a bug.
2019-07-30T08:31:25.8579260Z + 
2019-07-30T08:31:25.8580020Z + note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2019-07-30T08:31:25.8580160Z + 
2019-07-30T08:31:25.8580800Z + note: rustc 1.38.0-dev running on i686-apple-darwin
2019-07-30T08:31:25.8580910Z + 
2019-07-30T08:31:25.8581590Z + note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-07-30T08:31:25.8581790Z 1 error: proc macro panicked
2019-07-30T08:31:25.8582420Z 2   --> $DIR/invalid-punct-ident-1.rs:10:1
2019-07-30T08:31:25.8582510Z 3    |
2019-07-30T08:31:25.8582550Z 
2019-07-30T08:31:25.8582550Z 
2019-07-30T08:31:25.8582600Z 
2019-07-30T08:31:25.8582670Z The actual stderr differed from the expected stderr.
2019-07-30T08:31:25.8583450Z Actual stderr saved to /Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui/proc-macro/invalid-punct-ident-1/invalid-punct-ident-1.stderr
2019-07-30T08:31:25.8584130Z To update references, rerun the tests and pass the `--bless` flag
2019-07-30T08:31:25.8584830Z To only update this specific test, also pass `--test-args proc-macro/invalid-punct-ident-1.rs`
2019-07-30T08:31:25.8585000Z error: 1 errors occurred comparing output.
2019-07-30T08:31:25.8585080Z status: exit code: 1
2019-07-30T08:31:25.8585080Z status: exit code: 1
2019-07-30T08:31:25.8586470Z command: "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/stage2/bin/rustc" "/Users/vsts/agent/2.154.3/work/1/s/src/test/ui/proc-macro/invalid-punct-ident-1.rs" "-Zthreads=1" "--target=i686-apple-darwin" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui/proc-macro/invalid-punct-ident-1" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/native/rust-test-helpers" "-L" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui/proc-macro/invalid-punct-ident-1/auxiliary" "-A" "unused"
2019-07-30T08:31:25.8587400Z ------------------------------------------
2019-07-30T08:31:25.8587480Z 
2019-07-30T08:31:25.8588080Z ------------------------------------------
2019-07-30T08:31:25.8588190Z stderr:
2019-07-30T08:31:25.8588190Z stderr:
2019-07-30T08:31:25.8588930Z ------------------------------------------
2019-07-30T08:31:25.8589880Z thread 'rustc' panicked at 'unsupported character `'`'`', src/libsyntax/ext/proc_macro_server.rs:309:13
2019-07-30T08:31:25.8590150Z 
2019-07-30T08:31:25.8590220Z error: internal compiler error: unexpected panic
2019-07-30T08:31:25.8590270Z 
2019-07-30T08:31:25.8590270Z 
2019-07-30T08:31:25.8590350Z note: the compiler unexpectedly panicked. this is a bug.
2019-07-30T08:31:25.8590410Z 
2019-07-30T08:31:25.8591180Z note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2019-07-30T08:31:25.8591270Z 
2019-07-30T08:31:25.8592040Z note: rustc 1.38.0-dev running on i686-apple-darwin
2019-07-30T08:31:25.8592110Z 
2019-07-30T08:31:25.8592770Z note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-07-30T08:31:25.8592940Z error: proc macro panicked
2019-07-30T08:31:25.8593630Z   --> /Users/vsts/agent/2.154.3/work/1/s/src/test/ui/proc-macro/invalid-punct-ident-1.rs:10:1
2019-07-30T08:31:25.8593740Z    |
2019-07-30T08:31:25.8593740Z    |
2019-07-30T08:31:25.8593820Z LL | invalid_punct!(); //~ ERROR proc macro panicked
2019-07-30T08:31:25.8593980Z    |
2019-07-30T08:31:25.8593980Z    |
2019-07-30T08:31:25.8594580Z    = help: message: unsupported character `'`'`
2019-07-30T08:31:25.8594740Z error: aborting due to previous error
2019-07-30T08:31:25.8595040Z 
2019-07-30T08:31:25.8595100Z 
2019-07-30T08:31:25.8595730Z ------------------------------------------
---
2019-07-30T08:31:25.8596640Z 
2019-07-30T08:31:25.8596700Z + 
2019-07-30T08:31:25.8596800Z + error: internal compiler error: unexpected panic
2019-07-30T08:31:25.8596870Z + 
2019-07-30T08:31:25.8596950Z + note: the compiler unexpectedly panicked. this is a bug.
2019-07-30T08:31:25.8597040Z + 
2019-07-30T08:31:25.8597740Z + note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2019-07-30T08:31:25.8597880Z + 
2019-07-30T08:31:25.8598700Z + note: rustc 1.38.0-dev running on i686-apple-darwin
2019-07-30T08:31:25.8598830Z + 
2019-07-30T08:31:25.8599710Z + note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-07-30T08:31:25.8599930Z 1 error: proc macro panicked
2019-07-30T08:31:25.8600600Z 2   --> $DIR/invalid-punct-ident-2.rs:10:1
2019-07-30T08:31:25.8600700Z 3    |
2019-07-30T08:31:25.8600740Z 
2019-07-30T08:31:25.8600740Z 
2019-07-30T08:31:25.8600800Z 
2019-07-30T08:31:25.8600870Z The actual stderr differed from the expected stderr.
2019-07-30T08:31:25.8601820Z Actual stderr saved to /Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui/proc-macro/invalid-punct-ident-2/invalid-punct-ident-2.stderr
2019-07-30T08:31:25.8602670Z To update references, rerun the tests and pass the `--bless` flag
2019-07-30T08:31:25.8603440Z To only update this specific test, also pass `--test-args proc-macro/invalid-punct-ident-2.rs`
2019-07-30T08:31:25.8603610Z error: 1 errors occurred comparing output.
2019-07-30T08:31:25.8603680Z status: exit code: 1
2019-07-30T08:31:25.8603680Z status: exit code: 1
2019-07-30T08:31:25.8605050Z command: "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/stage2/bin/rustc" "/Users/vsts/agent/2.154.3/work/1/s/src/test/ui/proc-macro/invalid-punct-ident-2.rs" "-Zthreads=1" "--target=i686-apple-darwin" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui/proc-macro/invalid-punct-ident-2" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/native/rust-test-helpers" "-L" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui/proc-macro/invalid-punct-ident-2/auxiliary" "-A" "unused"
2019-07-30T08:31:25.8606270Z ------------------------------------------
2019-07-30T08:31:25.8606360Z 
2019-07-30T08:31:25.8606950Z ------------------------------------------
2019-07-30T08:31:25.8607060Z stderr:
2019-07-30T08:31:25.8607060Z stderr:
2019-07-30T08:31:25.8607640Z ------------------------------------------
2019-07-30T08:31:25.8608340Z thread 'rustc' panicked at '`"*"` is not a valid identifier', src/libsyntax/ext/proc_macro_server.rs:335:13
2019-07-30T08:31:25.8608820Z 
2019-07-30T08:31:25.8608890Z error: internal compiler error: unexpected panic
2019-07-30T08:31:25.8608940Z 
2019-07-30T08:31:25.8608940Z 
2019-07-30T08:31:25.8609020Z note: the compiler unexpectedly panicked. this is a bug.
2019-07-30T08:31:25.8609080Z 
2019-07-30T08:31:25.8609820Z note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2019-07-30T08:31:25.8609910Z 
2019-07-30T08:31:25.8610570Z note: rustc 1.38.0-dev running on i686-apple-darwin
2019-07-30T08:31:25.8610640Z 
2019-07-30T08:31:25.8611330Z note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-07-30T08:31:25.8611650Z error: proc macro panicked
2019-07-30T08:31:25.8612330Z   --> /Users/vsts/agent/2.154.3/work/1/s/src/test/ui/proc-macro/invalid-punct-ident-2.rs:10:1
2019-07-30T08:31:25.8612680Z    |
2019-07-30T08:31:25.8612680Z    |
2019-07-30T08:31:25.8612770Z LL | invalid_ident!(); //~ ERROR proc macro panicked
2019-07-30T08:31:25.8612930Z    |
2019-07-30T08:31:25.8612930Z    |
2019-07-30T08:31:25.8613760Z    = help: message: `"*"` is not a valid identifier
2019-07-30T08:31:25.8613970Z error: aborting due to previous error
2019-07-30T08:31:25.8614050Z 
2019-07-30T08:31:25.8614140Z 
2019-07-30T08:31:25.8614830Z ------------------------------------------
---
2019-07-30T08:31:25.8616560Z 
2019-07-30T08:31:25.8616690Z + 
2019-07-30T08:31:25.8616800Z + error: internal compiler error: unexpected panic
2019-07-30T08:31:25.8616920Z + 
2019-07-30T08:31:25.8617040Z + note: the compiler unexpectedly panicked. this is a bug.
2019-07-30T08:31:25.8617160Z + 
2019-07-30T08:31:25.8617960Z + note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2019-07-30T08:31:25.8618400Z + 
2019-07-30T08:31:25.8619140Z + note: rustc 1.38.0-dev running on i686-apple-darwin
2019-07-30T08:31:25.8619570Z + 
2019-07-30T08:31:25.8620360Z + note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-07-30T08:31:25.8620920Z 1 error: proc macro panicked
2019-07-30T08:31:25.8621640Z 2   --> $DIR/invalid-punct-ident-3.rs:10:1
2019-07-30T08:31:25.8621740Z 3    |
2019-07-30T08:31:25.8621810Z 
2019-07-30T08:31:25.8621810Z 
2019-07-30T08:31:25.8621850Z 
2019-07-30T08:31:25.8621920Z The actual stderr differed from the expected stderr.
2019-07-30T08:31:25.8622690Z Actual stderr saved to /Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui/proc-macro/invalid-punct-ident-3/invalid-punct-ident-3.stderr
2019-07-30T08:31:25.8623360Z To update references, rerun the tests and pass the `--bless` flag
2019-07-30T08:31:25.8624420Z To only update this specific test, also pass `--test-args proc-macro/invalid-punct-ident-3.rs`
2019-07-30T08:31:25.8624960Z error: 1 errors occurred comparing output.
2019-07-30T08:31:25.8625090Z status: exit code: 1
2019-07-30T08:31:25.8625090Z status: exit code: 1
2019-07-30T08:31:25.8627070Z command: "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/stage2/bin/rustc" "/Users/vsts/agent/2.154.3/work/1/s/src/test/ui/proc-macro/invalid-punct-ident-3.rs" "-Zthreads=1" "--target=i686-apple-darwin" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui/proc-macro/invalid-punct-ident-3" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/native/rust-test-helpers" "-L" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui/proc-macro/invalid-punct-ident-3/auxiliary" "-A" "unused"
2019-07-30T08:31:25.8628570Z ------------------------------------------
2019-07-30T08:31:25.8628970Z 
2019-07-30T08:31:25.8629770Z ------------------------------------------
2019-07-30T08:31:25.8630190Z stderr:
2019-07-30T08:31:25.8630190Z stderr:
2019-07-30T08:31:25.8630950Z ------------------------------------------
2019-07-30T08:31:25.8632180Z thread 'rustc' panicked at '`self` cannot be a raw identifier', src/libsyntax/ext/proc_macro_server.rs:339:13
2019-07-30T08:31:25.8632920Z 
2019-07-30T08:31:25.8633040Z error: internal compiler error: unexpected panic
2019-07-30T08:31:25.8633130Z 
2019-07-30T08:31:25.8633130Z 
2019-07-30T08:31:25.8633250Z note: the compiler unexpectedly panicked. this is a bug.
2019-07-30T08:31:25.8633340Z 
2019-07-30T08:31:25.8634110Z note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2019-07-30T08:31:25.8634480Z 
2019-07-30T08:31:25.8635410Z note: rustc 1.38.0-dev running on i686-apple-darwin
2019-07-30T08:31:25.8636020Z 
2019-07-30T08:31:25.8636870Z note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-07-30T08:31:25.8637420Z error: proc macro panicked
2019-07-30T08:31:25.8638330Z   --> /Users/vsts/agent/2.154.3/work/1/s/src/test/ui/proc-macro/invalid-punct-ident-3.rs:10:1
2019-07-30T08:31:25.8638460Z    |
2019-07-30T08:31:25.8638460Z    |
2019-07-30T08:31:25.8638860Z LL | invalid_raw_ident!(); //~ ERROR proc macro panicked
2019-07-30T08:31:25.8639130Z    |
2019-07-30T08:31:25.8639130Z    |
2019-07-30T08:31:25.8639270Z    = help: message: `self` cannot be a raw identifier
2019-07-30T08:31:25.8652020Z error: aborting due to previous error
2019-07-30T08:31:25.8652120Z 
2019-07-30T08:31:25.8652180Z 
2019-07-30T08:31:25.8652920Z ------------------------------------------
---
2019-07-30T08:31:25.8694340Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:533:22
2019-07-30T08:31:25.8987180Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-07-30T08:31:25.8987650Z 
2019-07-30T08:31:25.8987840Z 
2019-07-30T08:31:25.8996180Z command did not execute successfully: "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/stage0-tools-bin/compiletest" "--compile-lib-path" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/stage2/lib" "--run-lib-path" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/stage2/lib/rustlib/i686-apple-darwin/lib" "--rustc-path" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/stage2/bin/rustc" "--src-base" "/Users/vsts/agent/2.154.3/work/1/s/src/test/ui" "--build-base" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/test/ui" "--stage-id" "stage2-i686-apple-darwin" "--mode" "ui" "--target" "i686-apple-darwin" "--host" "i686-apple-darwin" "--llvm-filecheck" "/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/llvm/build/bin/FileCheck" "--nodejs" "/usr/local/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/Users/vsts/agent/2.154.3/work/1/s/build/i686-apple-darwin/native/rust-test-helpers" "--docck-python" "/usr/local/bin/python2.7" "--lldb-python" "/usr/bin/python" "--lldb-version" "lldb-902.0.79.2\n  Swift-4.1\n" "--lldb-python-dir" "/Applications/Xcode_9.3.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python" "--llvm-version" "9.0.0-rust-1.38.0-dev\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-07-30T08:31:25.8999650Z 
2019-07-30T08:31:25.8999870Z 
2019-07-30T08:31:25.9000220Z failed to run: /Users/vsts/agent/2.154.3/work/1/s/build/bootstrap/debug/bootstrap test
2019-07-30T08:31:25.9000570Z Build completed unsuccessfully in 1:04:49
2019-07-30T08:31:25.9000570Z Build completed unsuccessfully in 1:04:49
2019-07-30T08:31:25.9094480Z ##[error]Bash exited with code '1'.
2019-07-30T08:31:25.9133940Z ##[section]Starting: Upload CPU usage statistics
2019-07-30T08:31:25.9138160Z ==============================================================================
2019-07-30T08:31:25.9138260Z Task         : Bash
2019-07-30T08:31:25.9138340Z Description  : Run a Bash script on macOS, Linux, or Windows

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)

@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2019

💔 Test failed - checks-azure

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2019

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

@jonas-schievink jonas-schievink force-pushed the jonas-schievink:ice-panic-hook branch 2 times, most recently from 65ae95a to 0ed2056 Aug 4, 2019

@jonas-schievink

This comment has been minimized.

Copy link
Member Author

commented Aug 4, 2019

Test failures seem to be due to #59769 (comment) / #59998.

The erroneous compiler output now isn't limited to the default panic message, but now contains the entire ICE message. This is a bit unfortunate, but I think it's good to get more attention on that issue anyways. I've pushed a commit that normalizes the ICE message away.

@jonas-schievink

This comment has been minimized.

Copy link
Member Author

commented Aug 11, 2019

@bors

This comment was marked as resolved.

Copy link
Contributor

commented Aug 11, 2019

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

@jonas-schievink jonas-schievink force-pushed the jonas-schievink:ice-panic-hook branch from 0ed2056 to 110c2ff Aug 11, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Aug 11, 2019

The job mingw-check of your PR failed (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.
2019-08-11T23:47:24.4966967Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-11T23:47:24.5176285Z ##[command]git config gc.auto 0
2019-08-11T23:47:24.5251730Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-11T23:47:25.0712110Z ##[command]git config --get-all http.proxy
2019-08-11T23:47:25.0722928Z ##[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/60584/merge:refs/remotes/pull/60584/merge
---
2019-08-11T23:47:57.3734270Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-11T23:47:57.3734300Z 
2019-08-11T23:47:57.3734517Z   git checkout -b <new-branch-name>
2019-08-11T23:47:57.3734547Z 
2019-08-11T23:47:57.3734593Z HEAD is now at b60877735 Merge 110c2ffa24c952e2ffa9db3ab430d9e6acaae8f9 into 00ee1b47f42129a0a6e33510578fbcf07c1e5382
2019-08-11T23:47:57.3912192Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-11T23:47:57.3915249Z ==============================================================================
2019-08-11T23:47:57.3915486Z Task         : Bash
2019-08-11T23:47:57.3915532Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-11T23:51:08.8968685Z ################                                                          22.3%
2019-08-11T23:51:08.9676126Z #########################################                                 58.3%
2019-08-11T23:51:08.9676935Z ######################################################################## 100.0%
2019-08-11T23:51:09.4072145Z extracting /checkout/obj/build/cache/2019-07-04/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
2019-08-11T23:51:09.4875792Z error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
2019-08-11T23:51:09.4875964Z Caused by:
2019-08-11T23:51:09.4875964Z Caused by:
2019-08-11T23:51:09.4876489Z   patch for `rustfmt-nightly` in `https://github.com/rust-lang/crates.io-index` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
2019-08-11T23:51:09.4884303Z failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml
2019-08-11T23:51:09.4884391Z Build completed unsuccessfully in 0:00:18
2019-08-11T23:51:25.9281564Z ##[error]Bash exited with code '1'.
2019-08-11T23:51:25.9342537Z ##[section]Starting: Checkout
2019-08-11T23:51:25.9344016Z ==============================================================================
2019-08-11T23:51:25.9344081Z Task         : Get sources
2019-08-11T23:51:25.9344123Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@bors

This comment was marked as resolved.

Copy link
Contributor

commented Aug 12, 2019

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

jonas-schievink added some commits May 6, 2019

Update proc-macro tests
Due to #59998, the panic hook fires incorrectly for errors that should
not be treated as ICEs. Previously, this would only print the default
panic message, but moving the ICE printing into the panic handler will
now print the entire ICE ordeal we all hate to see.

Unfortunately this will make #59998 a lot more visible.

@jonas-schievink jonas-schievink force-pushed the jonas-schievink:ice-panic-hook branch from 110c2ff to b6cdd07 Aug 12, 2019

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