Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Compiler unexpectedly panicked when execute cargo mirai #1234

Open
AiDaiP opened this issue Aug 26, 2023 · 0 comments
Open

Compiler unexpectedly panicked when execute cargo mirai #1234

AiDaiP opened this issue Aug 26, 2023 · 0 comments

Comments

@AiDaiP
Copy link

AiDaiP commented Aug 26, 2023

Issue

Compiler unexpectedly panicked when execute cargo mirai in timing_channels.

Steps to Reproduce

cd examples/tag_analysis/timing_channels 
MIRAI_FLAGS="--constant_time SecretTaintKind"  cargo mirai

The output is:

    Checking timing_channels v0.1.0 (/home/aidai/rust_fuzz/MIRAI/examples/tag_analysis/timing_channels)
error: internal compiler error: the following error was constructed but not emitted

warning: the branch condition may have a SecretTaintKind tag
  --> examples/tag_analysis/timing_channels/src/lib.rs:45:16
   |
45 |             if secret[i] != public[i] {
   |                ^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at compiler/rustc_errors/src/diagnostic_builder.rs:775:21:
error was constructed but not emitted
stack backtrace:
   0:     0x7f854dc3519c - std::backtrace_rs::backtrace::libunwind::trace::haf256adafafbe58d
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f854dc3519c - std::backtrace_rs::backtrace::trace_unsynchronized::hfe1951132ff691c0
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f854dc3519c - std::sys_common::backtrace::_print_fmt::h9a0fe52434930c36
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f854dc3519c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h24adccbf3e1ada83
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f854dc9b89c - core::fmt::rt::Argument::fmt::h18ba555e398addfe
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/core/src/fmt/rt.rs:138:9
   5:     0x7f854dc9b89c - core::fmt::write::hbf3ee2d80be74759
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f854dc2790e - std::io::Write::write_fmt::hfc2b3251522ff943
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/io/mod.rs:1714:15
   7:     0x7f854dc34f85 - std::sys_common::backtrace::_print::hfdc8ddb5f3ddee36
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f854dc34f85 - std::sys_common::backtrace::print::h316f264b298c7a30
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f854dc380da - std::panicking::panic_hook_with_disk_dump::{{closure}}::h136bbb963feeea4a
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/panicking.rs:278:22
  10:     0x7f854dc37d73 - std::panicking::panic_hook_with_disk_dump::hd91a018a982a84f7
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/panicking.rs:312:9
  11:     0x7f8550ef4799 - rustc_driver_impl[2c2bb0da6cfb3826]::install_ice_hook::{closure#0}
  12:     0x7f854dc38980 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hd99b1fe24ccd07b5
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/alloc/src/boxed.rs:2021:9
  13:     0x7f854dc38980 - std::panicking::rust_panic_with_hook::h1593161995c9c003
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/panicking.rs:733:13
  14:     0x7f854dc386c1 - std::panicking::begin_panic_handler::{{closure}}::h6b4a934e37237346
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/panicking.rs:619:13
  15:     0x7f854dc356d6 - std::sys_common::backtrace::__rust_end_short_backtrace::h365e31c6291fdffa
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7f854dc38452 - rust_begin_unwind
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/panicking.rs:617:5
  17:     0x7f854dc97c53 - core::panicking::panic_fmt::hbd2564497e278309
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/core/src/panicking.rs:67:14
  18:     0x7f854fb60cc7 - <rustc_errors[4345527545ed2164]::diagnostic_builder::DiagnosticBuilderInner as core[8e2a8f22f3da315]::ops::drop::Drop>::drop
  19:     0x55d6d1e74ee6 - core::ptr::drop_in_place<rustc_errors::diagnostic_builder::DiagnosticBuilderInner>::he06e27b03426f1e9
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/core/src/ptr/mod.rs:497:1
  20:     0x55d6d1e74ee6 - core::ptr::drop_in_place<rustc_errors::diagnostic_builder::DiagnosticBuilder<()>>::h98319bea3129a12f
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/core/src/ptr/mod.rs:497:1
  21:     0x55d6d1e74ee6 - mirai::block_visitor::BlockVisitor::check_tag_existence_on_value::he03a8b1dee02691f
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/block_visitor.rs:1408:21
  22:     0x55d6d1e6f0be - mirai::block_visitor::BlockVisitor::visit_switch_int::h4754770542abfa3e
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/block_visitor.rs:376:34
  23:     0x55d6d1e6f0be - mirai::block_visitor::BlockVisitor::visit_terminator::h1e5295fba8d3d163
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/block_visitor.rs:290:17
  24:     0x55d6d1e6cc17 - mirai::block_visitor::BlockVisitor::visit_basic_block::hbdaf333ba38e17ac
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/block_visitor.rs:104:13
  25:     0x55d6d1dd13e0 - mirai::body_visitor::BodyVisitor::visit_basic_block::h9a1ac79840a6643b
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/body_visitor.rs:1100:9
  26:     0x55d6d1dd13e0 - mirai::body_visitor::BodyVisitor::check_for_errors::haace6816c4e0bcce
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/body_visitor.rs:817:13
  27:     0x55d6d1dccbef - mirai::body_visitor::BodyVisitor::visit_body::h738f15ea4af98a00
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/body_visitor.rs:236:13
  28:     0x55d6d1d6d386 - mirai::crate_visitor::CrateVisitor::analyze_body::{{closure}}::h772d7c8f19bebc9c
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/crate_visitor.rs:185:23
  29:     0x55d6d1d6d386 - mirai::crate_visitor::CrateVisitor::analyze_body::h85e258c91eb83ebf
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/crate_visitor.rs:173:5
  30:     0x55d6d1d6d386 - mirai::crate_visitor::CrateVisitor::analyze_some_bodies::{{closure}}::hf21618d4e789c71d
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/crate_visitor.rs:127:13
  31:     0x55d6d1d6d386 - mirai::crate_visitor::CrateVisitor::analyze_some_bodies::h8669f50b365285f8
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/crate_visitor.rs:71:5
  32:     0x55d6d1d64830 - mirai::callbacks::MiraiCallbacks::analyze_with_mirai::{{closure}}::h8a89e8152112d7a5
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/callbacks.rs:172:9
  33:     0x55d6d1d64830 - mirai::callbacks::MiraiCallbacks::analyze_with_mirai::h7593c6b1a14ec673
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/callbacks.rs:131:5
  34:     0x55d6d1d63c57 - <mirai::callbacks::MiraiCallbacks as rustc_driver_impl::Callbacks>::after_analysis::{{closure}}::{{closure}}::h413d7e0e3e1db7d3
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/callbacks.rs:118:26
  35:     0x55d6d1d63c57 - rustc_middle::ty::context::GlobalCtxt::enter::{{closure}}::h7a356c4231d6cc76
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/compiler/rustc_middle/src/ty/context.rs:587:37
  36:     0x55d6d1d63c57 - rustc_middle::ty::context::tls::enter_context::{{closure}}::hfb68763f7847365e
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/compiler/rustc_middle/src/ty/context/tls.rs:82:9
  37:     0x55d6d1d63c57 - std::thread::local::LocalKey<T>::try_with::hb891c9076e5be573
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/thread/local.rs:270:16
  38:     0x55d6d1d63c57 - std::thread::local::LocalKey<T>::with::h0b1f59fc89779a71
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/thread/local.rs:246:9
  39:     0x55d6d1d63c57 - rustc_middle::ty::context::tls::enter_context::hcc535926aab8be59
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/compiler/rustc_middle/src/ty/context/tls.rs:79:9
  40:     0x55d6d1d63c57 - rustc_middle::ty::context::GlobalCtxt::enter::h08f2d195a8c5a3fc
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/compiler/rustc_middle/src/ty/context.rs:587:9
  41:     0x55d6d1d63c57 - rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>::enter::h1be76edd6e6a4d6b
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/compiler/rustc_interface/src/queries.rs:71:9
  42:     0x55d6d1d63c57 - <mirai::callbacks::MiraiCallbacks as rustc_driver_impl::Callbacks>::after_analysis::{{closure}}::h8ebbce694d548fe6
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/callbacks.rs:115:9
  43:     0x55d6d1d63c57 - <mirai::callbacks::MiraiCallbacks as rustc_driver_impl::Callbacks>::after_analysis::h266abf5427205d26
                               at /home/aidai/rust_fuzz/MIRAI/checker/src/callbacks.rs:98:5
  44:     0x7f855015ff17 - <rustc_interface[b10bd5cb1b971de9]::interface::Compiler>::enter::<rustc_driver_impl[2c2bb0da6cfb3826]::run_compiler::{closure#1}::{closure#2}, core[8e2a8f22f3da315]::result::Result<core[8e2a8f22f3da315]::option::Option<rustc_interface[b10bd5cb1b971de9]::queries::Linker>, rustc_span[9abd768efbccd329]::ErrorGuaranteed>>
  45:     0x7f8550158fc8 - std[b7e5a9c79ea9fbed]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b10bd5cb1b971de9]::util::run_in_thread_pool_with_globals<rustc_interface[b10bd5cb1b971de9]::interface::run_compiler<core[8e2a8f22f3da315]::result::Result<(), rustc_span[9abd768efbccd329]::ErrorGuaranteed>, rustc_driver_impl[2c2bb0da6cfb3826]::run_compiler::{closure#1}>::{closure#0}, core[8e2a8f22f3da315]::result::Result<(), rustc_span[9abd768efbccd329]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8e2a8f22f3da315]::result::Result<(), rustc_span[9abd768efbccd329]::ErrorGuaranteed>>
  46:     0x7f855015874e - <<std[b7e5a9c79ea9fbed]::thread::Builder>::spawn_unchecked_<rustc_interface[b10bd5cb1b971de9]::util::run_in_thread_pool_with_globals<rustc_interface[b10bd5cb1b971de9]::interface::run_compiler<core[8e2a8f22f3da315]::result::Result<(), rustc_span[9abd768efbccd329]::ErrorGuaranteed>, rustc_driver_impl[2c2bb0da6cfb3826]::run_compiler::{closure#1}>::{closure#0}, core[8e2a8f22f3da315]::result::Result<(), rustc_span[9abd768efbccd329]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8e2a8f22f3da315]::result::Result<(), rustc_span[9abd768efbccd329]::ErrorGuaranteed>>::{closure#1} as core[8e2a8f22f3da315]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:     0x7f854dc43125 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb18992c0c074fb04
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/alloc/src/boxed.rs:2007:9
  48:     0x7f854dc43125 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha4998f5f9033c44e
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/alloc/src/boxed.rs:2007:9
  49:     0x7f854dc43125 - std::sys::unix::thread::Thread::new::thread_start::h3370231efa79af31
                               at /rustc/474709a9a2a74a8bcf0055fadb335d0ca0d2d939/library/std/src/sys/unix/thread.rs:108:17
  50:     0x7f854d90a609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  51:     0x7f854d6de133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  52:                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 attach the file at `/home/aidai/rust_fuzz/MIRAI/rustc-ice-2023-08-26T08:07:28.420140337Z-2350301.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -Z always_encode_mir

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
warning: `timing_channels` (lib) generated 1 warning
error: could not compile `timing_channels` (lib); 1 warning emitted

Expected Behavior

Compiler should not panic.

Actual Results

Compiler unexpectedly panicked.

Environment

rustc --version
rustc 1.70.0 (90c541806 2023-05-31)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant