Skip to content

ICE: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32 #131292

Open
@matthiaskrgr

Description

@matthiaskrgr

cc #129503
snippet:

use std::arch::asm;

unsafe fn f6() {
    asm!(concat!(r#"lJ𐏿Æ�.𐏿�"#, "{}/day{:02}.txt"));
}

Version information

rustc 1.83.0-nightly (5a4ee43c3 2024-10-05)
binary: rustc
commit-hash: 5a4ee43c387110736440cecc375cb5aedc441dbc
commit-date: 2024-10-05
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

thread 'rustc' panicked at compiler/rustc_span/src/lib.rs:2151:17:
assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32
stack backtrace:
   0:     0x7e01e91249fa - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h585b06d402bc00d5
   1:     0x7e01e9803426 - core::fmt::write::h62d1c51a5a367817
   2:     0x7e01eaa1a651 - std::io::Write::write_fmt::hd7881933ac2a1e16
   3:     0x7e01e9124852 - std::sys::backtrace::BacktraceLock::print::ha0ac5d8e3803f857
   4:     0x7e01e9126d26 - std::panicking::default_hook::{{closure}}::h7a48a96dd6d0b686
   5:     0x7e01e9126b70 - std::panicking::default_hook::h4ad77b5924a748da
   6:     0x7e01e81db8ff - std[f6927571c1bb7893]::panicking::update_hook::<alloc[1b6d6df6cca9b2d3]::boxed::Box<rustc_driver_impl[83de0f0d7a3bbaf8]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x7e01e9127438 - std::panicking::rust_panic_with_hook::h15ea114d0f0705b7
   8:     0x7e01e91271d6 - std::panicking::begin_panic_handler::{{closure}}::h51c98e91577ce4f1
   9:     0x7e01e9124ea9 - std::sys::backtrace::__rust_end_short_backtrace::h9be02724e7705975
  10:     0x7e01e9126ecc - rust_begin_unwind
  11:     0x7e01e5ec1b50 - core::panicking::panic_fmt::h29396fab03b6c714
  12:     0x7e01e646cf0c - core::panicking::panic::h3f429d995616bbb3
  13:     0x7e01e73ee83e - <rustc_span[b73f4c38f6b79966]::source_map::SourceMap>::lookup_char_pos
  14:     0x7e01ea3e57ad - <rustc_errors[33bfe5951055d2f3]::emitter::FileWithAnnotatedLines>::collect_annotations
  15:     0x7e01ea3ed084 - <rustc_errors[33bfe5951055d2f3]::emitter::HumanEmitter>::emit_messages_default_inner::{closure#0}
  16:     0x7e01ea3e1b64 - <rustc_errors[33bfe5951055d2f3]::emitter::HumanEmitter>::emit_messages_default
  17:     0x7e01ea3e0c87 - <rustc_errors[33bfe5951055d2f3]::emitter::HumanEmitter as rustc_errors[33bfe5951055d2f3]::emitter::Emitter>::emit_diagnostic
  18:     0x7e01ea3f89dc - <rustc_errors[33bfe5951055d2f3]::DiagCtxtInner>::emit_diagnostic::{closure#3}
  19:     0x7e01ea3fc18a - rustc_interface[a7beddea6b2aa80d]::callbacks::track_diagnostic::<core[e1b34d82e9cff2ed]::option::Option<rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>
  20:     0x7e01ea3fa325 - <rustc_errors[33bfe5951055d2f3]::DiagCtxtInner>::emit_diagnostic
  21:     0x7e01ea3fa1df - <rustc_errors[33bfe5951055d2f3]::DiagCtxtHandle>::emit_diagnostic
  22:     0x7e01ea9df04b - <rustc_span[b73f4c38f6b79966]::ErrorGuaranteed as rustc_errors[33bfe5951055d2f3]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  23:     0x7e01e800233d - rustc_builtin_macros[fc5150b54e0ce307]::asm::expand_preparsed_asm
  24:     0x7e01e8002e04 - rustc_builtin_macros[fc5150b54e0ce307]::asm::expand_asm
  25:     0x7e01e5cf7ff3 - <rustc_expand[f98748099334edfe]::expand::MacroExpander>::fully_expand_fragment
  26:     0x7e01ea9954cd - <rustc_expand[f98748099334edfe]::expand::MacroExpander>::expand_crate
  27:     0x7e01e9cb0f11 - rustc_interface[a7beddea6b2aa80d]::passes::resolver_for_lowering_raw
  28:     0x7e01e9cb04b5 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 16usize]>>
  29:     0x7e01e9cb04a3 - <rustc_query_impl[7b31fe52c1943d23]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2} as core[e1b34d82e9cff2ed]::ops::function::FnOnce<(rustc_middle[4aa8808438232afe]::ty::context::TyCtxt, ())>>::call_once
  30:     0x7e01ea6d3fc6 - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::SingleCache<rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  31:     0x7e01ea6d3c61 - rustc_query_impl[7b31fe52c1943d23]::query_impl::resolver_for_lowering_raw::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7e01ea521252 - rustc_interface[a7beddea6b2aa80d]::interface::run_compiler::<core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>, rustc_driver_impl[83de0f0d7a3bbaf8]::run_compiler::{closure#0}>::{closure#1}
  33:     0x7e01ea5d9150 - std[f6927571c1bb7893]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[a7beddea6b2aa80d]::util::run_in_thread_with_globals<rustc_interface[a7beddea6b2aa80d]::util::run_in_thread_pool_with_globals<rustc_interface[a7beddea6b2aa80d]::interface::run_compiler<core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>, rustc_driver_impl[83de0f0d7a3bbaf8]::run_compiler::{closure#0}>::{closure#1}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#0}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>
  34:     0x7e01ea5d9817 - <<std[f6927571c1bb7893]::thread::Builder>::spawn_unchecked_<rustc_interface[a7beddea6b2aa80d]::util::run_in_thread_with_globals<rustc_interface[a7beddea6b2aa80d]::util::run_in_thread_pool_with_globals<rustc_interface[a7beddea6b2aa80d]::interface::run_compiler<core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>, rustc_driver_impl[83de0f0d7a3bbaf8]::run_compiler::{closure#0}>::{closure#1}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#0}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#1} as core[e1b34d82e9cff2ed]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7e01ea5da701 - std::sys::pal::unix::thread::Thread::new::thread_start::h4498a525a6fc6a9e
  36:     0x7e01ebd6d39d - <unknown>
  37:     0x7e01ebdf249c - <unknown>
  38:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.83.0-nightly (5a4ee43c3 2024-10-05) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [resolver_for_lowering_raw] getting the resolver for lowering
end of query stack
error: aborting due to 1 previous error


Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions