Hi, I'm not sure if you are still looking for examples of this panic. I've included detail as per the template below, but it is worth noting that I am cross-compiling to run on QEMU riscv32, following the guide at https://operating-system-in-1000-lines.vercel.app/en/, so this may not be suitable for replication.
Prior to this error I used
$ cargo doc --open
which was successful.
Code
main.rs
//! Following the guide OS in 1,000 Lines
//!
//! [OS in 1,000 Lines]{operating-system-in-1000-lines.vercel.app/en/)
#![no_std] // 32-bit RISC-V does not yet have a standard library
#![no_main] // We are providing our own entry point to the code
use core::arch::asm;
use os1k::{main, memset};
unsafe extern "C" {
static __bss: u8;
static __bss_end: u8;
static __stack_top: u8;
}
#[unsafe(no_mangle)]
fn kernel_main() -> ! {
let bss = &raw const __bss;
let bss_end = &raw const __bss_end;
//SAFETY: bss is aligned from linker. Memory between bss and bss_end is contiguous and valid for writing.
unsafe{ memset(bss.cast_mut(), 0, bss_end as usize - bss as usize ); }
main();
}
#[unsafe(no_mangle)]
#[unsafe(link_section = ".text.boot")]
fn boot() -> ! {
let stack_top = &raw const __stack_top;
unsafe{asm!(
"mv sp, {stack_top}",
"j {kernel_main}",
stack_top = in(reg) stack_top,
kernel_main = sym kernel_main,
options(readonly, noreturn)
)}
}
lib.rs
//! OS in 1,000 Lines in Rust
//!
//! Using the guide [OS in 1,000 Lines](operating-system-in-1000-lines.vercel.app/en/) by [Seiya Nuta](https://github.com/nuta).
//!
//! This is a custom operating system written in just 1,000 lines of code. The Rust version
//! closely follows the C version, but does make use of Rust `core` crate functions.
//! Since the target system is 32-bit RISC-V, we do not have a standard library and need to
//! create our own equivalents.
//!
//! This targets the QEMU `virt` system.
#![no_std]
use core::arch::asm;
use core::fmt::Write;
use core::panic::PanicInfo;
mod print;
pub mod sbi;
/// Rust panic handler.
#[panic_handler]
pub fn panic_handler(_info: &PanicInfo) -> ! { loop{} }
/// Fills a buffer with the same byte.
///
/// Takes a raw pointer `buf` to a buffer of size `n` bytes, and fills with `c`.
///
/// # Safety
/// - `buf` must be properly aligned even if the buffer is zero sized.
/// - `buf` must be valid for `n` contiguous writes.
pub unsafe fn memset(buf: *mut u8, c: u8, n: usize) -> *mut u8 {
unsafe{ buf.write_bytes(c, n) };
buf
}
/// Main thread.
pub fn main() -> ! {
let s = "\n\nHello World!\n";
print!("{}",s);
println!("🦀");
loop {
unsafe{asm!("wfi")}
}
}
sbi.rs
//! Supervisor Binary Interface calls.
use core::arch::asm;
use core::ffi::{c_int, c_long}; // On our system this will be i32
// Struct holding SBI extension call ids.
//
// * `eid` is the extension id
// * `fid` is the function id
//
// Note that for legacy SBI calls `fid` is ignored.
// SBI extension IDs (EIDs) and SBI function IDs (FIDs) are encoded as signed 32-bit integers
#[expect(dead_code)] // For now we are using legacy calls so expect dead code for fid
struct Extension {
eid: c_long,
fid: c_long,
}
// Extension: Console Putchar - Write data to debug console.
const CONSOLE_PUT_CHAR: Extension = Extension{ eid:1, fid:0 };
// This function is not expected to be called directly
fn sbi_call_legacy(arg0: c_long, extension: Extension) -> Result<(), c_long> {
let value;
unsafe{asm!(
"ecall",
inout("a0") arg0 => value,
in("a7") extension.eid,
)}
if value == 0 {
Ok(())
} else {
Err(value)
}
}
// Writes to the debug console.
//
// Calls SBI function `sbi_console_putchar` which writes `c_int` to the debug console.
// Although `c_int` is 4 bytes on 32-bit RISC-V, we work in bytes (`u8`) to support UTF-8 multi-byte chars.
// Note - The underlying SBI call will block if there remain any pending bytes to be transmitted
// or if the receiving terminal is not yet ready to receive the byte.
//
// # Panics
//
// Panics on error as unable to print any messages.
pub fn put_char(b: &u8) {
sbi_call_legacy(*b as c_int, CONSOLE_PUT_CHAR).unwrap();
}
print.rs
//! Print macros.
use core::{fmt, fmt::Write};
use crate::sbi::put_char;
pub struct StdErr;
impl Write for crate::print::StdErr {
// Takes a UTF-8 string `s` and converts to bytes for debug console via legacy SBI ecall.
fn write_str(&mut self, s: &str) -> fmt::Result {
for b in s.as_bytes() {
put_char(&b);
}
Ok(()) // Assume success - we can't print an error message if this fails anyway.
}
}
/// Formatted print to console.
///
/// This macro accepts a format string and a list of arguments. Arguments will be formatted according to the specified format string
/// and the result will be printed on the console.
#[macro_export]
macro_rules! print {
( $($arg:tt)* ) => {
write!(crate::print::StdErr, $($arg)*).ok();
};
}
/// Formatted print to console with newline.
///
/// This macro accepts a format string and a list of arguments. Arguments will be formatted according to the specified format string
/// with an added newline, and the result will be printed on the console.
#[macro_export]
macro_rules! println {
( $($arg:tt)* ) => {
writeln!(crate::print::StdErr, $($arg)*).ok();
};
}
Cargo.toml
[package]
name = "os1k"
version = "0.1.0"
edition = "2024"
[dependencies]
.cargo/config.toml
[build]
target = "riscv32i-unknown-none-elf"
rustflags = [
"-g",
"-O",
"-C", "link-args=--Map=kernel.map --script=kernel.ld",
]
[target.riscv32i-unknown-none-elf]
runner = "./run.sh
In case this is useful, the linker script `kernel.ld'
ENTRY(boot)
SECTIONS {
. = 0x80200000;
.text :{
KEEP(*(.text.boot));
*(.text .text.*);
}
.rodata : ALIGN(4) {
*(.rodata .rodata.*);
}
.data : ALIGN(4) {
*(.data .data.*);
}
.bss : ALIGN(4) {
__bss = .;
*(.bss .bss.* .sbss .sbss.*);
__bss_end = .;
}
. = ALIGN(4);
. += 128 * 1024; /* 128KB */
__stack_top = .;
/DISCARD/ : { *(.eh_frame*) }
}
Meta
rustc --version --verbose:
rustc 1.88.0 (6b00bc388 2025-06-23)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: aarch64-unknown-linux-gnu
release: 1.88.0
LLVM version: 20.1.5
Error output
$ cargo build
Compiling os1k v0.1.0 (/home/thomas/src/os1k)
error: internal compiler error: encountered incremental compilation error with shallow_lint_levels_on(os1k[7a0c]::sbi::Extension)
|
= help: This is a known issue with the compiler. Run `cargo clean -p os1k` or `cargo clean` to allow your project to compile
= note: Please follow the instructions below to create a bug report with the provided information
= note: See <https://github.com/rust-lang/rust/issues/84970> for more information
thread 'rustc' panicked at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/compiler/rustc_query_system/src/query/plumbing.rs:739:9:
Found unstable fingerprints for shallow_lint_levels_on(os1k[7a0c]::sbi::Extension): ShallowLintLevelMap { expectations: [(Stable { hir_id: HirId(DefId(0:22 ~ os1k[7a0c]::sbi::Extension).0), attr_index: 0, lint_index: Some(0) }, LintExpectation { reason: None, emission_span: src/sbi.rs:13:10: 13:19 (#0), is_unfulfilled_lint_expectations: false, lint_tool: None })], specs: {0: {LintId { lint: Lint { name: "DEAD_CODE", default_level: Warn, desc: "detect unused, unexported items", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Expect, lint_id: Some(Stable { hir_id: HirId(DefId(0:22 ~ os1k[7a0c]::sbi::Extension).0), attr_index: 0, lint_index: Some(0) }), src: Node { name: "dead_code", span: src/sbi.rs:13:10: 13:19 (#0), reason: None } }}} }
stack backtrace:
0: 0xfffecae93a48 - std::backtrace_rs::backtrace::libunwind::trace::h9431951fd116cc44
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
1: 0xfffecae93a48 - std::backtrace_rs::backtrace::trace_unsynchronized::h66500b5a90e76ee8
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
2: 0xfffecae93a48 - std::sys::backtrace::_print_fmt::h563afe87969bcd97
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/backtrace.rs:66:9
3: 0xfffecae93a48 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h6393d514ac6e9cd2
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/backtrace.rs:39:26
4: 0xfffec803462c - core::fmt::rt::Argument::fmt::h0b3711449485f0f6
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/fmt/rt.rs:181:76
5: 0xfffec803462c - core::fmt::write::h3d5451b97dda5b0e
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/fmt/mod.rs:1446:25
6: 0xfffecae89948 - std::io::default_write_fmt::hb3470b74804a88d1
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/io/mod.rs:639:11
7: 0xfffecae89948 - std::io::Write::write_fmt::hdd3503b3866de1d7
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/io/mod.rs:1914:13
8: 0xfffecae93908 - std::sys::backtrace::BacktraceLock::print::h9d5d0fd803c544d7
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/backtrace.rs:42:9
9: 0xfffecae972e8 - std::panicking::default_hook::{{closure}}::h9d6dd5a1dde1b6c9
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:300:22
10: 0xfffecae96fd4 - std::panicking::default_hook::h1e41c9e87247723c
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:327:9
11: 0xfffeca0af780 - std[9aa260371de5c072]::panicking::update_hook::<alloc[6614c4bc27d633a5]::boxed::Box<rustc_driver_impl[b9fda2760f87d2ee]::install_ice_hook::{closure#1}>>::{closure#0}
12: 0xfffecae97ba0 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h56711fc79aca3c37
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:1980:9
13: 0xfffecae97ba0 - std::panicking::rust_panic_with_hook::h6e7e6d3e8b95d45e
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:841:13
14: 0xfffecae9789c - std::panicking::begin_panic_handler::{{closure}}::hac60eebb8a81f899
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:706:13
15: 0xfffecae93f30 - std::sys::backtrace::__rust_end_short_backtrace::h62db1ed7db49b861
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/backtrace.rs:168:18
16: 0xfffecae97594 - __rustc[4794b31dd7191200]::rust_begin_unwind
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:697:5
17: 0xfffec8022600 - core::panicking::panic_fmt::h53676893f0005007
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/panicking.rs:75:14
18: 0xfffeca604e4c - rustc_query_system[86cd55f56848bc76]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[ae51ec946f7918a2]::ty::context::TyCtxt>
19: 0xfffec8493c00 - rustc_query_system[86cd55f56848bc76]::query::plumbing::try_execute_query::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_data_structures[f8e9235482a13ecb]::vec_cache::VecCache<rustc_hir[d57107e7368e0b23]::hir_id::OwnerId, rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[86cd55f56848bc76]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt, true>
20: 0xfffec8491ca0 - rustc_query_impl[8c0185b84419c985]::query_impl::shallow_lint_levels_on::get_query_incr::__rust_end_short_backtrace
21: 0xfffec8590de4 - rustc_passes[96a159fbe4885691]::dead::live_symbols_and_ignored_derived_traits
22: 0xfffec94b0370 - rustc_query_impl[8c0185b84419c985]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8c0185b84419c985]::query_impl::live_symbols_and_ignored_derived_traits::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 8usize]>>
23: 0xfffec97298e4 - rustc_query_system[86cd55f56848bc76]::query::plumbing::try_execute_query::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_query_system[86cd55f56848bc76]::query::caches::SingleCache<rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt, true>
24: 0xfffec9728e20 - rustc_query_impl[8c0185b84419c985]::plumbing::force_from_dep_node::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_query_system[86cd55f56848bc76]::query::caches::SingleCache<rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>>
25: 0xfffec972a02c - <rustc_query_impl[8c0185b84419c985]::plumbing::query_callback<rustc_query_impl[8c0185b84419c985]::query_impl::live_symbols_and_ignored_derived_traits::QueryType>::{closure#0} as core[16bde87991666963]::ops::function::FnOnce<(rustc_middle[ae51ec946f7918a2]::ty::context::TyCtxt, rustc_query_system[86cd55f56848bc76]::dep_graph::dep_node::DepNode, rustc_query_system[86cd55f56848bc76]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
26: 0xfffec8498c74 - <rustc_query_system[86cd55f56848bc76]::dep_graph::graph::DepGraphData<rustc_middle[ae51ec946f7918a2]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt>
27: 0xfffec84989f4 - <rustc_query_system[86cd55f56848bc76]::dep_graph::graph::DepGraphData<rustc_middle[ae51ec946f7918a2]::dep_graph::DepsType>>::try_mark_green::<rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt>
28: 0xfffec8498564 - rustc_query_system[86cd55f56848bc76]::query::plumbing::ensure_must_run::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_query_system[86cd55f56848bc76]::query::caches::DefaultCache<rustc_span[45812a152ae16db8]::def_id::LocalModDefId, rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt>
29: 0xfffec978b55c - rustc_query_impl[8c0185b84419c985]::query_impl::check_mod_deathness::get_query_incr::__rust_end_short_backtrace
30: 0xfffec9674fc4 - rustc_interface[e39fef92bd5ffa79]::passes::analysis
31: 0xfffec9727a0c - rustc_query_impl[8c0185b84419c985]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8c0185b84419c985]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 0usize]>>
32: 0xfffec972ae4c - rustc_query_system[86cd55f56848bc76]::query::plumbing::try_execute_query::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_query_system[86cd55f56848bc76]::query::caches::SingleCache<rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt, true>
33: 0xfffec972a960 - rustc_query_impl[8c0185b84419c985]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
34: 0xfffec966018c - rustc_interface[e39fef92bd5ffa79]::passes::create_and_enter_global_ctxt::<core[16bde87991666963]::option::Option<rustc_interface[e39fef92bd5ffa79]::queries::Linker>, rustc_driver_impl[b9fda2760f87d2ee]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
35: 0xfffec95d5dbc - rustc_interface[e39fef92bd5ffa79]::interface::run_compiler::<(), rustc_driver_impl[b9fda2760f87d2ee]::run_compiler::{closure#0}>::{closure#1}
36: 0xfffec957ca84 - std[9aa260371de5c072]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[e39fef92bd5ffa79]::util::run_in_thread_with_globals<rustc_interface[e39fef92bd5ffa79]::util::run_in_thread_pool_with_globals<rustc_interface[e39fef92bd5ffa79]::interface::run_compiler<(), rustc_driver_impl[b9fda2760f87d2ee]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
37: 0xfffec957bb2c - <<std[9aa260371de5c072]::thread::Builder>::spawn_unchecked_<rustc_interface[e39fef92bd5ffa79]::util::run_in_thread_with_globals<rustc_interface[e39fef92bd5ffa79]::util::run_in_thread_pool_with_globals<rustc_interface[e39fef92bd5ffa79]::interface::run_compiler<(), rustc_driver_impl[b9fda2760f87d2ee]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[16bde87991666963]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
38: 0xfffecae9b0ec - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h175e2bed7734a07a
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:1966:9
39: 0xfffecae9b0ec - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcfaf068421bbef73
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:1966:9
40: 0xfffecae9b0ec - std::sys::pal::unix::thread::Thread::new::thread_start::h9909ea7a9d24fe08
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/pal/unix/thread.rs:97:17
41: 0xfffec6d4d284 - start_thread
42: 0xfffec6db804c - thread_start
43: 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: rustc 1.88.0 (6b00bc388 2025-06-23) running on aarch64-unknown-linux-gnu
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -C link-args=--Map=kernel.map --script=kernel.ld
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [shallow_lint_levels_on] looking up lint levels for `sbi::Extension`
#1 [live_symbols_and_ignored_derived_traits] finding live symbols in crate
... and 1 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 check_mod_deathness(os1k[7a0c])
end of try_mark_green dep node stack
error: could not compile `os1k` (lib) due to 1 previous error
Backtrace
$ RUST_BACKTRACE=full cargo build
Compiling os1k v0.1.0 (/home/thomas/src/os1k)
error: internal compiler error: encountered incremental compilation error with shallow_lint_levels_on(os1k[7a0c]::sbi::Extension)
|
= help: This is a known issue with the compiler. Run `cargo clean -p os1k` or `cargo clean` to allow your project to compile
= note: Please follow the instructions below to create a bug report with the provided information
= note: See <https://github.com/rust-lang/rust/issues/84970> for more information
thread 'rustc' panicked at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/compiler/rustc_query_system/src/query/plumbing.rs:739:9:
Found unstable fingerprints for shallow_lint_levels_on(os1k[7a0c]::sbi::Extension): ShallowLintLevelMap { expectations: [(Stable { hir_id: HirId(DefId(0:22 ~ os1k[7a0c]::sbi::Extension).0), attr_index: 0, lint_index: Some(0) }, LintExpectation { reason: None, emission_span: src/sbi.rs:13:10: 13:19 (#0), is_unfulfilled_lint_expectations: false, lint_tool: None })], specs: {0: {LintId { lint: Lint { name: "DEAD_CODE", default_level: Warn, desc: "detect unused, unexported items", edition_lint_opts: None, report_in_external_macro: false, future_incompatible: None, is_externally_loaded: false, feature_gate: None, crate_level_only: false, eval_always: false } }: LevelAndSource { level: Expect, lint_id: Some(Stable { hir_id: HirId(DefId(0:22 ~ os1k[7a0c]::sbi::Extension).0), attr_index: 0, lint_index: Some(0) }), src: Node { name: "dead_code", span: src/sbi.rs:13:10: 13:19 (#0), reason: None } }}} }
stack backtrace:
0: 0xffffad983a48 - std::backtrace_rs::backtrace::libunwind::trace::h9431951fd116cc44
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
1: 0xffffad983a48 - std::backtrace_rs::backtrace::trace_unsynchronized::h66500b5a90e76ee8
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
2: 0xffffad983a48 - std::sys::backtrace::_print_fmt::h563afe87969bcd97
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/backtrace.rs:66:9
3: 0xffffad983a48 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h6393d514ac6e9cd2
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/backtrace.rs:39:26
4: 0xffffaab2462c - core::fmt::rt::Argument::fmt::h0b3711449485f0f6
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/fmt/rt.rs:181:76
5: 0xffffaab2462c - core::fmt::write::h3d5451b97dda5b0e
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/fmt/mod.rs:1446:25
6: 0xffffad979948 - std::io::default_write_fmt::hb3470b74804a88d1
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/io/mod.rs:639:11
7: 0xffffad979948 - std::io::Write::write_fmt::hdd3503b3866de1d7
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/io/mod.rs:1914:13
8: 0xffffad983908 - std::sys::backtrace::BacktraceLock::print::h9d5d0fd803c544d7
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/backtrace.rs:42:9
9: 0xffffad9872e8 - std::panicking::default_hook::{{closure}}::h9d6dd5a1dde1b6c9
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:300:22
10: 0xffffad986fd4 - std::panicking::default_hook::h1e41c9e87247723c
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:327:9
11: 0xffffacb9f780 - std[9aa260371de5c072]::panicking::update_hook::<alloc[6614c4bc27d633a5]::boxed::Box<rustc_driver_impl[b9fda2760f87d2ee]::install_ice_hook::{closure#1}>>::{closure#0}
12: 0xffffad987ba0 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h56711fc79aca3c37
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:1980:9
13: 0xffffad987ba0 - std::panicking::rust_panic_with_hook::h6e7e6d3e8b95d45e
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:841:13
14: 0xffffad98789c - std::panicking::begin_panic_handler::{{closure}}::hac60eebb8a81f899
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:706:13
15: 0xffffad983f30 - std::sys::backtrace::__rust_end_short_backtrace::h62db1ed7db49b861
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/backtrace.rs:168:18
16: 0xffffad987594 - __rustc[4794b31dd7191200]::rust_begin_unwind
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:697:5
17: 0xffffaab12600 - core::panicking::panic_fmt::h53676893f0005007
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/panicking.rs:75:14
18: 0xffffad0f4e4c - rustc_query_system[86cd55f56848bc76]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[ae51ec946f7918a2]::ty::context::TyCtxt>
19: 0xffffaaf83c00 - rustc_query_system[86cd55f56848bc76]::query::plumbing::try_execute_query::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_data_structures[f8e9235482a13ecb]::vec_cache::VecCache<rustc_hir[d57107e7368e0b23]::hir_id::OwnerId, rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[86cd55f56848bc76]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt, true>
20: 0xffffaaf81ca0 - rustc_query_impl[8c0185b84419c985]::query_impl::shallow_lint_levels_on::get_query_incr::__rust_end_short_backtrace
21: 0xffffab080de4 - rustc_passes[96a159fbe4885691]::dead::live_symbols_and_ignored_derived_traits
22: 0xffffabfa0370 - rustc_query_impl[8c0185b84419c985]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8c0185b84419c985]::query_impl::live_symbols_and_ignored_derived_traits::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 8usize]>>
23: 0xffffac2198e4 - rustc_query_system[86cd55f56848bc76]::query::plumbing::try_execute_query::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_query_system[86cd55f56848bc76]::query::caches::SingleCache<rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt, true>
24: 0xffffac218e20 - rustc_query_impl[8c0185b84419c985]::plumbing::force_from_dep_node::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_query_system[86cd55f56848bc76]::query::caches::SingleCache<rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 8usize]>>, false, false, false>>
25: 0xffffac21a02c - <rustc_query_impl[8c0185b84419c985]::plumbing::query_callback<rustc_query_impl[8c0185b84419c985]::query_impl::live_symbols_and_ignored_derived_traits::QueryType>::{closure#0} as core[16bde87991666963]::ops::function::FnOnce<(rustc_middle[ae51ec946f7918a2]::ty::context::TyCtxt, rustc_query_system[86cd55f56848bc76]::dep_graph::dep_node::DepNode, rustc_query_system[86cd55f56848bc76]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
26: 0xffffaaf88c74 - <rustc_query_system[86cd55f56848bc76]::dep_graph::graph::DepGraphData<rustc_middle[ae51ec946f7918a2]::dep_graph::DepsType>>::try_mark_previous_green::<rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt>
27: 0xffffaaf889f4 - <rustc_query_system[86cd55f56848bc76]::dep_graph::graph::DepGraphData<rustc_middle[ae51ec946f7918a2]::dep_graph::DepsType>>::try_mark_green::<rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt>
28: 0xffffaaf88564 - rustc_query_system[86cd55f56848bc76]::query::plumbing::ensure_must_run::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_query_system[86cd55f56848bc76]::query::caches::DefaultCache<rustc_span[45812a152ae16db8]::def_id::LocalModDefId, rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt>
29: 0xffffac27b55c - rustc_query_impl[8c0185b84419c985]::query_impl::check_mod_deathness::get_query_incr::__rust_end_short_backtrace
30: 0xffffac164fc4 - rustc_interface[e39fef92bd5ffa79]::passes::analysis
31: 0xffffac217a0c - rustc_query_impl[8c0185b84419c985]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8c0185b84419c985]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 0usize]>>
32: 0xffffac21ae4c - rustc_query_system[86cd55f56848bc76]::query::plumbing::try_execute_query::<rustc_query_impl[8c0185b84419c985]::DynamicConfig<rustc_query_system[86cd55f56848bc76]::query::caches::SingleCache<rustc_middle[ae51ec946f7918a2]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[8c0185b84419c985]::plumbing::QueryCtxt, true>
33: 0xffffac21a960 - rustc_query_impl[8c0185b84419c985]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
34: 0xffffac15018c - rustc_interface[e39fef92bd5ffa79]::passes::create_and_enter_global_ctxt::<core[16bde87991666963]::option::Option<rustc_interface[e39fef92bd5ffa79]::queries::Linker>, rustc_driver_impl[b9fda2760f87d2ee]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
35: 0xffffac0c5dbc - rustc_interface[e39fef92bd5ffa79]::interface::run_compiler::<(), rustc_driver_impl[b9fda2760f87d2ee]::run_compiler::{closure#0}>::{closure#1}
36: 0xffffac06ca84 - std[9aa260371de5c072]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[e39fef92bd5ffa79]::util::run_in_thread_with_globals<rustc_interface[e39fef92bd5ffa79]::util::run_in_thread_pool_with_globals<rustc_interface[e39fef92bd5ffa79]::interface::run_compiler<(), rustc_driver_impl[b9fda2760f87d2ee]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
37: 0xffffac06bb2c - <<std[9aa260371de5c072]::thread::Builder>::spawn_unchecked_<rustc_interface[e39fef92bd5ffa79]::util::run_in_thread_with_globals<rustc_interface[e39fef92bd5ffa79]::util::run_in_thread_pool_with_globals<rustc_interface[e39fef92bd5ffa79]::interface::run_compiler<(), rustc_driver_impl[b9fda2760f87d2ee]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[16bde87991666963]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
38: 0xffffad98b0ec - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h175e2bed7734a07a
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:1966:9
39: 0xffffad98b0ec - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcfaf068421bbef73
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/alloc/src/boxed.rs:1966:9
40: 0xffffad98b0ec - std::sys::pal::unix::thread::Thread::new::thread_start::h9909ea7a9d24fe08
at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/sys/pal/unix/thread.rs:97:17
41: 0xffffa983d284 - start_thread
42: 0xffffa98a804c - thread_start
43: 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: rustc 1.88.0 (6b00bc388 2025-06-23) running on aarch64-unknown-linux-gnu
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -C link-args=--Map=kernel.map --script=kernel.ld
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [shallow_lint_levels_on] looking up lint levels for `sbi::Extension`
#1 [live_symbols_and_ignored_derived_traits] finding live symbols in crate
#2 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 check_mod_deathness(os1k[7a0c])
end of try_mark_green dep node stack
Hi, I'm not sure if you are still looking for examples of this panic. I've included detail as per the template below, but it is worth noting that I am cross-compiling to run on QEMU riscv32, following the guide at https://operating-system-in-1000-lines.vercel.app/en/, so this may not be suitable for replication.
Prior to this error I used
$ cargo doc --openwhich was successful.
Code
main.rs
lib.rs
sbi.rs
print.rs
Cargo.toml
.cargo/config.toml
In case this is useful, the linker script `kernel.ld'
Meta
rustc --version --verbose:Error output
Backtrace