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

Panicked when analyzing num-bigint #1259

Open
Chiky777 opened this issue Jun 28, 2024 · 0 comments
Open

Panicked when analyzing num-bigint #1259

Chiky777 opened this issue Jun 28, 2024 · 0 comments

Comments

@Chiky777
Copy link

Issue

I used MIRAI to analyze num-bigint-0.4.2 but it panicked.

Steps to Reproduce

git clone https://github.com/rust-num/num-bigint.git
cd num-bigint
git checkout num-bigint-0.4.2
RUSTFLAGS="-Z always_encode_mir" RUSTC_WRAPPER=mirai MIRAI_FLAGS="--diag=paranoid" MIRAI_LOG="warn" cargo build

Environment

Rust version (rustc --version)

rustc version: 1.74.0-nightly (8ed4537d7 2023-09-09)
platform: x86_64-unknown-linux-gnu

Expected Behavior

No panic during of build

Actual Results

It panicked.

thread 'rustc' panicked at checker/src/constant_domain.rs:667:18:
internal error: entered unreachable code: invalid argument for intrinsic StdIntrinsicsLog2f64
stack backtrace:
   0:     0x7f3c9d562efc - std::backtrace_rs::backtrace::libunwind::trace::h094c2eb17225f35e
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f3c9d562efc - std::backtrace_rs::backtrace::trace_unsynchronized::h615449becf5ed526
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3c9d562efc - std::sys_common::backtrace::_print_fmt::h4f6404afc9c28fa2
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f3c9d562efc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hec8e2f82a9267356
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f3c9d5c915c - core::fmt::rt::Argument::fmt::hc22bff1f3c8d5515
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/core/src/fmt/rt.rs:138:9
   5:     0x7f3c9d5c915c - core::fmt::write::h695f0d13ee2b63c0
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f3c9d55593e - std::io::Write::write_fmt::h4c9769eac3690b0b
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/io/mod.rs:1714:15
   7:     0x7f3c9d562ce4 - std::sys_common::backtrace::_print::h1ecde903242aebf4
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f3c9d562ce4 - std::sys_common::backtrace::print::h5bed2e94889011f9
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f3c9d565dda - std::panicking::panic_hook_with_disk_dump::{{closure}}::h9dff830c2c2c9e7d
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/panicking.rs:280:22
  10:     0x7f3c9d565a98 - std::panicking::panic_hook_with_disk_dump::hcd574b7c614f8fd7
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/panicking.rs:307:9
  11:     0x7f3ca072a899 - <rustc_driver_impl[4a48db23f7fef241]::install_ice_hook::{closure#0} as core[6b93bd2b6a9e1e0b]::ops::function::FnOnce<(&core[6b93bd2b6a9e1e0b]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f3c9d566693 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h61a031d2161fa98e
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/alloc/src/boxed.rs:2021:9
  13:     0x7f3c9d566693 - std::panicking::rust_panic_with_hook::h3dc2c3e3f18f2734
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/panicking.rs:757:13
  14:     0x7f3c9d566411 - std::panicking::begin_panic_handler::{{closure}}::hfec52c7accc59e93
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/panicking.rs:631:13
  15:     0x7f3c9d563426 - std::sys_common::backtrace::__rust_end_short_backtrace::h91bb17702521ee3a
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7f3c9d566152 - rust_begin_unwind
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/panicking.rs:619:5
  17:     0x7f3c9d5c5505 - core::panicking::panic_fmt::hff1a5640486791f2
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/core/src/panicking.rs:72:14
  18:     0x61758d3e48e2 - mirai::constant_domain::ConstantDomain::intrinsic_floating_point_unary::h490a14fec77ea674
  19:     0x61758d396ac7 - <alloc::rc::Rc<mirai::abstract_value::AbstractValue> as mirai::abstract_value::AbstractValueTrait>::intrinsic_floating_point_unary::h2de2886089ecda66
                               at /home/node0/workspace/repo/MIRAI/checker/src/abstract_value.rs:3292:30
  20:     0x61758d3a8a3a - <alloc::rc::Rc<mirai::abstract_value::AbstractValue> as mirai::abstract_value::AbstractValueTrait>::refine_parameters_and_paths::h2ff1b6667f282c50
                               at /home/node0/workspace/repo/MIRAI/checker/src/abstract_value.rs:6122:74
  21:     0x61758d308976 - mirai::body_visitor::BodyVisitor::transfer_and_refine::h9602cef793e94316
                               at /home/node0/workspace/repo/MIRAI/checker/src/body_visitor.rs:1211:30
  22:     0x61758d32bafe - mirai::call_visitor::CallVisitor::transfer_and_refine_normal_return_state::h7450da7954e3d9d0
                               at /home/node0/workspace/repo/MIRAI/checker/src/call_visitor.rs:2929:13
  23:     0x61758d3298be - mirai::call_visitor::CallVisitor::transfer_and_refine_into_current_environment::h84753f0a49e15ced
                               at /home/node0/workspace/repo/MIRAI/checker/src/call_visitor.rs:2580:9
  24:     0x61758d3ba62c - mirai::block_visitor::BlockVisitor::visit_call::h269a68bce7bc8929
                               at /home/node0/workspace/repo/MIRAI/checker/src/block_visitor.rs:766:13
  25:     0x61758d3ba62c - mirai::block_visitor::BlockVisitor::visit_terminator::h58b77dd28177c2cc
                               at /home/node0/workspace/repo/MIRAI/checker/src/block_visitor.rs:311:18
  26:     0x61758d3b7847 - mirai::block_visitor::BlockVisitor::visit_basic_block::hf665c84d5baa98cc
                               at /home/node0/workspace/repo/MIRAI/checker/src/block_visitor.rs:105:13
  27:     0x61758d2ec79e - mirai::fixed_point_visitor::FixedPointVisitor::visit_basic_block::hd094413fc2a9af36
                               at /home/node0/workspace/repo/MIRAI/checker/src/fixed_point_visitor.rs:130:9
  28:     0x61758d2eaf1d - mirai::fixed_point_visitor::FixedPointVisitor::visit_blocks::h5b3adccadee9e1f9
                               at /home/node0/workspace/repo/MIRAI/checker/src/fixed_point_visitor.rs:82:21
  29:     0x61758d30126c - mirai::body_visitor::BodyVisitor::visit_body::h8d1c21c8d8f51439
                               at /home/node0/workspace/repo/MIRAI/checker/src/body_visitor.rs:217:9
  30:     0x61758d319453 - mirai::call_visitor::CallVisitor::create_and_cache_function_summary::h98c780a0b3bbd489
                               at /home/node0/workspace/repo/MIRAI/checker/src/call_visitor.rs:141:31
  31:     0x61758d31a8e8 - mirai::call_visitor::CallVisitor::get_function_summary::h4fe4caa5e059fac3
                               at /home/node0/workspace/repo/MIRAI/checker/src/call_visitor.rs:382:21
  32:     0x61758d3ba46d - mirai::block_visitor::BlockVisitor::visit_call::h269a68bce7bc8929
                               at /home/node0/workspace/repo/MIRAI/checker/src/block_visitor.rs:736:32
  33:     0x61758d3ba46d - mirai::block_visitor::BlockVisitor::visit_terminator::h58b77dd28177c2cc
                               at /home/node0/workspace/repo/MIRAI/checker/src/block_visitor.rs:311:18
  34:     0x61758d3b7847 - mirai::block_visitor::BlockVisitor::visit_basic_block::hf665c84d5baa98cc
                               at /home/node0/workspace/repo/MIRAI/checker/src/block_visitor.rs:105:13
  35:     0x61758d2ec79e - mirai::fixed_point_visitor::FixedPointVisitor::visit_basic_block::hd094413fc2a9af36
                               at /home/node0/workspace/repo/MIRAI/checker/src/fixed_point_visitor.rs:130:9
  36:     0x61758d2eaf1d - mirai::fixed_point_visitor::FixedPointVisitor::visit_blocks::h5b3adccadee9e1f9
                               at /home/node0/workspace/repo/MIRAI/checker/src/fixed_point_visitor.rs:82:21
  37:     0x61758d30126c - mirai::body_visitor::BodyVisitor::visit_body::h8d1c21c8d8f51439
                               at /home/node0/workspace/repo/MIRAI/checker/src/body_visitor.rs:217:9
  38:     0x61758d370e9d - mirai::crate_visitor::CrateVisitor::analyze_body::{{closure}}::h3442d011c3292572
                               at /home/node0/workspace/repo/MIRAI/checker/src/crate_visitor.rs:185:23
  39:     0x61758d370e9d - mirai::crate_visitor::CrateVisitor::analyze_body::hf5ed41f23d7ccdbd
                               at /home/node0/workspace/repo/MIRAI/checker/src/crate_visitor.rs:173:5
  40:     0x61758d370e9d - mirai::crate_visitor::CrateVisitor::analyze_some_bodies::{{closure}}::h2dbfa64b1e6a5e1f
                               at /home/node0/workspace/repo/MIRAI/checker/src/crate_visitor.rs:127:13
  41:     0x61758d370e9d - mirai::crate_visitor::CrateVisitor::analyze_some_bodies::h977f6b0be75f3bdc
                               at /home/node0/workspace/repo/MIRAI/checker/src/crate_visitor.rs:71:5
  42:     0x61758d2b6d2e - mirai::callbacks::MiraiCallbacks::analyze_with_mirai::{{closure}}::h21a684309594e94c
                               at /home/node0/workspace/repo/MIRAI/checker/src/callbacks.rs:172:9
  43:     0x61758d2b6d2e - mirai::callbacks::MiraiCallbacks::analyze_with_mirai::h239fdfaf3650890e
                               at /home/node0/workspace/repo/MIRAI/checker/src/callbacks.rs:131:5
  44:     0x61758d2b6001 - <mirai::callbacks::MiraiCallbacks as rustc_driver_impl::Callbacks>::after_analysis::{{closure}}::{{closure}}::h5cb33de0109802a8
                               at /home/node0/workspace/repo/MIRAI/checker/src/callbacks.rs:118:26
  45:     0x61758d2b6001 - rustc_middle::ty::context::GlobalCtxt::enter::{{closure}}::h33f357414c169b8a
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/compiler/rustc_middle/src/ty/context.rs:595:37
  46:     0x61758d2b6001 - rustc_middle::ty::context::tls::enter_context::{{closure}}::h30321079247bfda6
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/compiler/rustc_middle/src/ty/context/tls.rs:82:9
  47:     0x61758d2b6001 - std::thread::local::LocalKey<T>::try_with::h4de1cea27c0b9f30
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/thread/local.rs:270:16
  48:     0x61758d2b6001 - std::thread::local::LocalKey<T>::with::h22fe88bc3ebb25b4
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/thread/local.rs:246:9
  49:     0x61758d2b6001 - rustc_middle::ty::context::tls::enter_context::h06ed8e3de39d231b
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/compiler/rustc_middle/src/ty/context/tls.rs:79:9
  50:     0x61758d2b6001 - rustc_middle::ty::context::GlobalCtxt::enter::hb19829662c60c5c3
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/compiler/rustc_middle/src/ty/context.rs:595:9
  51:     0x61758d2b6001 - rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>::enter::h18a971047614ece6
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/compiler/rustc_interface/src/queries.rs:71:9
  52:     0x61758d2b6001 - <mirai::callbacks::MiraiCallbacks as rustc_driver_impl::Callbacks>::after_analysis::{{closure}}::h3f0a8c551db226d8
                               at /home/node0/workspace/repo/MIRAI/checker/src/callbacks.rs:115:9
  53:     0x61758d2b6001 - <mirai::callbacks::MiraiCallbacks as rustc_driver_impl::Callbacks>::after_analysis::h6b7fe3fcc64b3a58
                               at /home/node0/workspace/repo/MIRAI/checker/src/callbacks.rs:98:5
  54:     0x7f3c9fc7184d - <rustc_interface[ff58ab769e259856]::interface::Compiler>::enter::<rustc_driver_impl[4a48db23f7fef241]::run_compiler::{closure#1}::{closure#2}, core[6b93bd2b6a9e1e0b]::result::Result<core[6b93bd2b6a9e1e0b]::option::Option<rustc_interface[ff58ab769e259856]::queries::Linker>, rustc_span[4bc5c3472ac21a7b]::ErrorGuaranteed>>
  55:     0x7f3c9fc6aae8 - std[3c984aa0e273a99e]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ff58ab769e259856]::util::run_in_thread_with_globals<rustc_interface[ff58ab769e259856]::interface::run_compiler<core[6b93bd2b6a9e1e0b]::result::Result<(), rustc_span[4bc5c3472ac21a7b]::ErrorGuaranteed>, rustc_driver_impl[4a48db23f7fef241]::run_compiler::{closure#1}>::{closure#0}, core[6b93bd2b6a9e1e0b]::result::Result<(), rustc_span[4bc5c3472ac21a7b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6b93bd2b6a9e1e0b]::result::Result<(), rustc_span[4bc5c3472ac21a7b]::ErrorGuaranteed>>
  56:     0x7f3c9fc6a23e - <<std[3c984aa0e273a99e]::thread::Builder>::spawn_unchecked_<rustc_interface[ff58ab769e259856]::util::run_in_thread_with_globals<rustc_interface[ff58ab769e259856]::interface::run_compiler<core[6b93bd2b6a9e1e0b]::result::Result<(), rustc_span[4bc5c3472ac21a7b]::ErrorGuaranteed>, rustc_driver_impl[4a48db23f7fef241]::run_compiler::{closure#1}>::{closure#0}, core[6b93bd2b6a9e1e0b]::result::Result<(), rustc_span[4bc5c3472ac21a7b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6b93bd2b6a9e1e0b]::result::Result<(), rustc_span[4bc5c3472ac21a7b]::ErrorGuaranteed>>::{closure#1} as core[6b93bd2b6a9e1e0b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  57:     0x7f3c9d571075 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he40f230475481d5a
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/alloc/src/boxed.rs:2007:9
  58:     0x7f3c9d571075 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd8d1d2a8c2bb2577
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/alloc/src/boxed.rs:2007:9
  59:     0x7f3c9d571075 - std::sys::unix::thread::Thread::new::thread_start::h2fc0621e8c4d6f11
                               at /rustc/8ed4537d7c238eb77509d82445cf1cb861a3b5ff/library/std/src/sys/unix/thread.rs:108:17
  60:     0x7f3c9cea6ded - <unknown>
  61:     0x7f3c9cf2a0dc - <unknown>
  62:                0x0 - <unknown>


rustc version: 1.74.0-nightly (8ed4537d7 2023-09-09)
platform: x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

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