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

rustc 1.34.0 panics when running "cargo clippy" and checking "combine" crate #59909

Closed
ancwrd1 opened this issue Apr 12, 2019 · 13 comments
Closed
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. stable-accepted Accepted for backporting to the compiler in the stable channel. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.

Comments

@ancwrd1
Copy link

ancwrd1 commented Apr 12, 2019

Platform: x86_64-unknown-linux-gnu
Version: 1.34.0
Error description: when running cargo clippy compiler panics. Compilation works fine though.

Backtrace:

Checking combine v3.8.1
thread 'rustc' panicked at 'begin <= end (617 <= 296) when slicing `pub)
            $(#[$derive])*
            struct $type_name;
            type PartialState = (());
            $(#[$attr])*
            fn $name [$($type_params)*]($($arg : $arg_type),*)($input_type) -> $output_type
                where [$($where_`[...]', src/libcore/str/mod.rs:2014:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:482
   6: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:385
   7: rust_begin_unwind
             at src/libstd/panicking.rs:312
   8: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   9: core::str::slice_error_fail
             at src/libcore/str/mod.rs:0
  10: core::str::traits::<impl core::slice::SliceIndex<str> for core::ops::range::RangeFrom<usize>>::index::{{closure}}
  11: <clippy_lints::functions::Functions as rustc::lint::LateLintPass<'a, 'tcx>>::check_fn
  12: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn
  13: rustc::hir::intravisit::walk_item
  14: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  15: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  16: rustc::hir::intravisit::walk_item
  17: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  18: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  19: rustc::hir::intravisit::walk_item
  20: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  21: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  22: rustc::hir::intravisit::walk_crate
  23: rustc::lint::context::check_crate
  24: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::{{closure}}
  25: rustc::util::common::time
  26: <std::thread::local::LocalKey<T>>::with
  27: rustc::ty::context::TyCtxt::create_and_enter
  28: rustc_driver::driver::compile_input
  29: rustc_driver::run_compiler_with_pool
  30: <scoped_tls::ScopedKey<T>>::set
  31: rustc_driver::run_compiler
  32: <scoped_tls::ScopedKey<T>>::set
  33: syntax::with_globals
  34: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  35: <F as alloc::boxed::FnBox<A>>::call_box
  36: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/91856ed52c58aa5ba66a015354d1cc69e9779bdf/src/liballoc/boxed.rs:759
             at src/libstd/sys_common/thread.rs:14
             at src/libstd/sys/unix/thread.rs:81
  37: start_thread
  38: __GI___clone
query stack during panic:
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.34.0 (91856ed52 2019-04-10) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib
@pietroalbini
Copy link
Member

pietroalbini commented Apr 12, 2019

cc @oli-obk @Manishearth
Checked and this regressed from 1.33 to 1.34, but it's fixed on beta/nightly. Any idea on which PR could have fixed it?

@rustbot modify labels: regression-from-stable-to-stable T-dev-tools I-nominated I-ICE

@rustbot rustbot added I-nominated regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Apr 12, 2019
@phansch
Copy link
Member

phansch commented Apr 12, 2019

@pietroalbini This was fixed in rust-lang/rust-clippy#3805

@pietroalbini
Copy link
Member

Nominating that PR to be backported to stable.

cc @rust-lang/release
@rustbot modify labels: stable-nominated.

@rustbot rustbot added the stable-nominated Nominated for backporting to the compiler in the stable channel. label Apr 12, 2019
@Indy2222
Copy link
Contributor

I have encountered a similar error and I am not sure whether it is the same or a different issue. From Travis CI:

$ cargo clippy -- -D warnings
    Checking num-traits v0.2.2
    Checking unicode-width v0.1.4
    Checking bitflags v1.0.1
thread 'rustc' panicked at 'begin <= end (190 <= 0) when slicing `}
                        }
                    )+
                }
                let mut first = true;
                $(
                    if <$BitFlags as __BitFlags>::$Flag(self) {
                        if !first {
                            t`[...]', src/libcore/str/mod.rs:2014:5
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.34.0 (91856ed52 2019-04-10) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 --crate-type lib
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `bitflags`.
warning: build failed, waiting for other jobs to finish...
error: build failed
The command "cargo clippy -- -D warnings" exited with 101.

@pietroalbini
Copy link
Member

cc @rust-lang/dev-tools, do you think this PR is safe to backport to a stable point release?

@Manishearth
Copy link
Member

@pietroalbini Yep!

Feel free to make a stable branch on the clippy repo for this.

@oli-obk @phansch think we should also backport some of the redundant_closure fixes? Or move the lint to the nursery for now?

@Manishearth
Copy link
Member

Made a backport PR in rust-lang/rust-clippy#4003

@Manishearth
Copy link
Member

Both backported PRs already exist on beta.

@Manishearth
Copy link
Member

@pietroalbini ready to go , see rust-lang/rust-clippy#4003

just check out the stable clippy branch.

@pietroalbini
Copy link
Member

@Manishearth can the branch be called something like rust-1.34.1 (like Cargo does)? Otherwise the commits might go away if you reuse that branch for another point release in the future.

@Manishearth
Copy link
Member

Done. I can also merge it back into mainline if necessary.

@pietroalbini pietroalbini added stable-accepted Accepted for backporting to the compiler in the stable channel. and removed stable-accepted Accepted for backporting to the compiler in the stable channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels Apr 23, 2019
@pnkfelix
Copy link
Member

pnkfelix commented May 2, 2019

removing nomination tag, as this appears to be well in hand.

@pietroalbini
Copy link
Member

This should be fixed now.

@jonas-schievink jonas-schievink added the C-bug Category: This is a bug. label Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. stable-accepted Accepted for backporting to the compiler in the stable channel. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants