Skip to content

Compiler panic: bpos.to_usize() >= mbc.pos.to_usize() + mbc.bytes #46773

Closed
@delehef

Description

@delehef
rustc --version --verbose
=========================

rustc 1.24.0-nightly (77efd6800 2017-12-15)
binary: rustc
commit-hash: 77efd6800c57ba83923dddbbabf03c7afa6a34a4
commit-date: 2017-12-15
host: x86_64-unknown-linux-gnu
release: 1.24.0-nightly
LLVM version: 4.0

rustc panics with the following backtrace:

thread 'rustc' panicked at 'assertion failed: bpos.to_usize() >= mbc.pos.to_usize() + mbc.bytes', /checkout/src/libsyntax/codemap.rs:586:16
stack backtrace:
   0:     0x7f288d0be2cb - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hf03debd250282e5d
                               at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x7f288d0b61fe - std::sys_common::backtrace::print::hc2b1571ec4035b57
                               at /checkout/src/libstd/sys_common/backtrace.rs:68
                               at /checkout/src/libstd/sys_common/backtrace.rs:57
   2:     0x7f288d0c7590 - std::panicking::default_hook::{{closure}}::hbb73a80a69f92519
                               at /checkout/src/libstd/panicking.rs:381
   3:     0x7f288d0c728b - std::panicking::default_hook::hcff6bf77544d5956
                               at /checkout/src/libstd/panicking.rs:391
   4:     0x7f288d0c7a6b - std::panicking::rust_panic_with_hook::h414a68738005788f
                               at /checkout/src/libstd/panicking.rs:577
   5:     0x7f2887d99863 - std::panicking::begin_panic::hf89d9d83300ab923
   6:     0x7f2888008e82 - syntax::codemap::CodeMap::bytepos_to_file_charpos::h05cb956309f8610a
   7:     0x7f288800644f - syntax::codemap::CodeMap::lookup_char_pos::hfa0c0a7f87d3c8bf
   8:     0x7f288800730a - syntax::codemap::CodeMap::span_to_filename::h7ba024b765fb18a4
   9:     0x7f2888009188 - <syntax::codemap::CodeMap as rustc_errors::CodeMapper>::span_to_filename::h76575b8deb828350
  10:     0x7f2887aaa686 - rustc_errors::emitter::EmitterWriter::fix_multispan_in_std_macros::h5c5d0294a14a3b1d
  11:     0x7f2887aa6a56 - <rustc_errors::emitter::EmitterWriter as rustc_errors::emitter::Emitter>::emit::h827806157bd8e50d
  12:     0x7f2887ab8c44 - rustc_errors::Handler::emit_db::hdf22b8fa97bffc91
  13:     0x7f2887aa036d - rustc_errors::diagnostic_builder::DiagnosticBuilder::emit::h82d0bf9edc975904
  14:     0x7f288b00815d - rustc_borrowck::borrowck::check_loans::CheckLoanCtxt::report_error_if_loans_conflict::he15fb3fbd96594b0
  15:     0x7f288aff1a76 - <rustc::middle::dataflow::DataFlowContext<'a, 'tcx, O>>::each_bit_on_entry::h22cfa9abf7662a2b
  16:     0x7f288b00766b - <rustc_borrowck::borrowck::check_loans::CheckLoanCtxt<'a, 'tcx> as rustc::middle::expr_use_visitor::Delegate<'tcx>>::borrow::h13af95cc19c1ed24
  17:     0x7f288920274d - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  18:     0x7f288920383e - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  19:     0x7f2889202ad1 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  20:     0x7f28892030c9 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  21:     0x7f28892030bd - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  22:     0x7f28892028f1 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  23:     0x7f2889203021 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  24:     0x7f2889202eec - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  25:     0x7f2889203ae2 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_local::h7254fd9416a0b3f4
  26:     0x7f2889202914 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  27:     0x7f28892030c9 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  28:     0x7f2889203021 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  29:     0x7f2889202eec - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  30:     0x7f2889203ae2 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_local::h7254fd9416a0b3f4
  31:     0x7f2889202914 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  32:     0x7f28892028f1 - rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr::h2043d4449837b4ee
  33:     0x7f288b007ead - rustc_borrowck::borrowck::check_loans::check_loans::hf65b6e2d7f341e6b
  34:     0x7f288b011af2 - rustc_borrowck::borrowck::borrowck::h55097c950cdf8de8
  35:     0x7f288908a1a2 - rustc::dep_graph::graph::DepGraph::with_task_impl::hc936e4888d26fd84
  36:     0x7f2888d7928e - rustc_errors::Handler::track_diagnostics::hb7e3dbdf5a363cd7
  37:     0x7f2888c822c0 - rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check::hd0785b60d313bd66
  38:     0x7f2889118aa2 - rustc::ty::maps::<impl rustc::ty::maps::queries::borrowck<'tcx>>::force::h21c9a049284db670
  39:     0x7f2889119220 - rustc::ty::maps::<impl rustc::ty::maps::queries::borrowck<'tcx>>::try_get::h696a9faacabc8bae
  40:     0x7f2888f3dc4a - rustc::ty::maps::TyCtxtAt::borrowck::h838bd68468de71a5
  41:     0x7f2888ca6870 - rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::borrowck::h708b97814046c0a4
  42:     0x7f288b0113df - rustc_borrowck::borrowck::check_crate::h449a99ff1a4ce179
  43:     0x7f288d5033e8 - <std::thread::local::LocalKey<T>>::with::h4fd1ef26c0a5991b
  44:     0x7f288d5086a6 - <std::thread::local::LocalKey<T>>::with::hcf2ee49dc727d320
  45:     0x7f288d55eaac - rustc::ty::context::TyCtxt::create_and_enter::h5b7a23885092ff7b
  46:     0x7f288d4b3f70 - rustc_driver::driver::compile_input::h25bdc15f9a01b342
  47:     0x7f288d539ea8 - rustc_driver::run_compiler::h1ec6f4bd93a58850
  48:     0x7f288d511941 - std::sys_common::backtrace::__rust_begin_short_backtrace::hdcf43b2f9f3b4406
  49:     0x7f288d0fca5e - __rust_maybe_catch_panic
                               at /checkout/src/libpanic_unwind/lib.rs:101
  50:     0x7f288d528bb2 - <F as alloc::boxed::FnBox<A>>::call_box::hd509f195fdeaea34
  51:     0x7f288d0b8b77 - std::sys_common::thread::start_thread::h706ddf8f441bf6eb
                               at /checkout/src/liballoc/boxed.rs:827
  52:     0x7f288d0d3288 - std::sys::unix::thread::Thread::new::thread_start::h51e87d4de9fb4e14
                               at /checkout/src/libstd/sys/unix/thread.rs:90
  53:     0x7f2886dfa567 - start_thread
                               at /builddir/glibc-2.26/nptl/pthread_create.c:465
  54:     0x7f288cda752e - clone
                               at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  55:                0x0 - <unknown>

error: Could not compile `msa`.

Unfortunately, although it compiles nicely on stable, I can't publish the code yet; so I'm not sure this bug report is actually useful :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions