Skip to content

ICE when building docopt with rustc nightly on Travis CI #70041

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
ghedo opened this issue Mar 16, 2020 · 8 comments · Fixed by #70051
Closed

ICE when building docopt with rustc nightly on Travis CI #70041

ghedo opened this issue Mar 16, 2020 · 8 comments · Fixed by #70051
Assignees
Labels
A-HIR Area: The high-level intermediate representation (HIR) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ghedo
Copy link
Contributor

ghedo commented Mar 16, 2020

As of rustc 1.43.0-nightly (45ebd58 2020-03-15) the Travis CI builds of https://github.com/cloudflare/quiche are failing due to rustc crashing. The crash happens when building the docopt crate, which is a dependency of one of quiche's subcrates.

Unfortunately I wasn't able to reproduce this locally, so I can't try the latest master or try to prepare a minimal reproducer, but I can reproduce this realiably on Travis CI, see e.g.
https://travis-ci.com/github/cloudflare/quiche/jobs/298502269
https://travis-ci.com/github/cloudflare/quiche/jobs/298521787
https://travis-ci.com/github/cloudflare/quiche/jobs/298536148
https://travis-ci.com/github/cloudflare/quiche/jobs/298535326

Could this have something to do with Travis CI specifically?

Code

As per above, I don't have specific code that reproduces this. I can only reproduce when building the docopt crate as part of quiche on Travis CI.

Meta

rustc --version --verbose:

rustc 1.43.0-nightly (45ebd5808 2020-03-15)

Error output

   Compiling docopt v1.1.0
     Running `rustc --crate-name docopt --edition=2018 /home/travis/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/docopt-1.1.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 -C metadata=60637fd07855c546 -C extra-filename=-60637fd07855c546 --out-dir /home/travis/build/cloudflare/quiche/tools/apps/target/debug/deps -L dependency=/home/travis/build/cloudflare/quiche/tools/apps/target/debug/deps --extern lazy_static=/home/travis/build/cloudflare/quiche/tools/apps/target/debug/deps/liblazy_static-9097ff8143d19ca4.rmeta --extern regex=/home/travis/build/cloudflare/quiche/tools/apps/target/debug/deps/libregex-e22dcf23ec571abd.rmeta --extern serde=/home/travis/build/cloudflare/quiche/tools/apps/target/debug/deps/libserde-4039d5b385e0dfe9.rmeta --extern strsim=/home/travis/build/cloudflare/quiche/tools/apps/target/debug/deps/libstrsim-161e6c2eb076d56e.rmeta --cap-lints allow -D warnings`
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/librustc/hir/mod.rs:81:37
Backtrace

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/librustc/hir/mod.rs:81:37
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.heygears.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.heygears.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1427
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:513
  12: rust_begin_unwind
             at src/libstd/panicking.rs:417
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:111
  14: core::panicking::panic
             at src/libcore/panicking.rs:54
  15: core::ops::function::FnOnce::call_once
  16: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::hir_owner>::compute
  17: rustc::dep_graph::graph::DepGraph::with_task_impl
  18: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  19: rustc::hir::map::Map::get_entry
  20: rustc::hir::map::Map::find
  21: rustc_passes::dead::MarkSymbolVisitor::check_def_id
  22: rustc_hir::intravisit::walk_item
  23: rustc_passes::dead::check_crate
  24: rustc_session::utils::<impl rustc_session::session::Session>::time
  25: rustc_interface::passes::analysis::{{closure}}::{{closure}}
  26: rustc_session::utils::<impl rustc_session::session::Session>::time
  27: rustc_interface::passes::analysis
  28: rustc::ty::query::__query_compute::analysis
  29: rustc::dep_graph::graph::DepGraph::with_task_impl
  30: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  31: rustc::ty::context::tls::enter_global
  32: rustc_interface::interface::run_compiler_in_existing_thread_pool
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@ghedo ghedo added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 16, 2020
@ghedo ghedo changed the title ICE when building docopt with rustc nightly ICE when building docopt with rustc nightly on Travis CI Mar 16, 2020
@ghedo
Copy link
Contributor Author

ghedo commented Mar 16, 2020

FTR, the docopt crate was last updated almost a year ago, so this is not due to some new code there https://crates.io/crates/docopt

@jonas-schievink jonas-schievink added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-nominated regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. A-HIR Area: The high-level intermediate representation (HIR) labels Mar 16, 2020
@Centril
Copy link
Contributor

Centril commented Mar 16, 2020

Let's see if we can shrink the input to something suitable for a regression test.

@rustbot ping cleanup

Also cc @Zoxc

@rustbot rustbot added the ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections label Mar 16, 2020
@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2020

Hey Cleanup Crew ICE-breakers! This bug has been identified as a good
"Cleanup ICE-breaking candidate". In case it's useful, here are some
instructions for tackling these sorts of bugs. Maybe take a look?
Thanks! <3

cc @AminArria @chrissimpkins @contrun @DutchGhost @elshize @ethanboxx @h-michael @HallerPatrick @hdhoang @hellow554 @imtsuki @jakevossen5 @KarlK90 @LeSeulArtichaut @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @senden9 @shekohex @sinato @spastorino @turboladen @woshilapin @yerke

@Zoxc
Copy link
Contributor

Zoxc commented Mar 16, 2020

This seems to be an issue with #68944. It could be we're calling hir_owner with something that isn't an HIR owner, in which case it should be changed to return None instead of panicking. It's odd that it can't be reproduced though.

@Zoxc
Copy link
Contributor

Zoxc commented Mar 16, 2020

I can reproduce it by cargo build on https://github.com/docopt/docopt.rs.

@ghedo
Copy link
Contributor Author

ghedo commented Mar 16, 2020

It's odd that it can't be reproduced though.

I just realized I wasn't actually using rust nightly when I tried to reproduce locally 🤦‍♂️ so that explains that...

@jonas-schievink jonas-schievink removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Mar 16, 2020
@dtolnay dtolnay pinned this issue Mar 16, 2020
@dtolnay
Copy link
Member

dtolnay commented Mar 16, 2020

Minimized:

[package]
name = "docopt"
version = "0.0.0"
edition = "2018"
macro_rules! regex {
    () => {};
}

#[allow(dead_code)]
mod parse {
    use regex;
}

@jonas-schievink jonas-schievink added P-high High priority and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Mar 16, 2020
Centril added a commit to Centril/rust that referenced this issue Mar 16, 2020
@ecstatic-morse ecstatic-morse unpinned this issue Mar 16, 2020
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 17, 2020
@Centril Centril removed the P-high High priority label Mar 18, 2020
@nikomatsakis
Copy link
Contributor

@rustbot assign @Zoxc

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-HIR Area: The high-level intermediate representation (HIR) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants