Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertion failed: w < 128 in building ipnet #414

Closed
avanhatt opened this issue Aug 10, 2021 · 0 comments · Fixed by #605
Closed

assertion failed: w < 128 in building ipnet #414

avanhatt opened this issue Aug 10, 2021 · 0 comments · Fixed by #605
Assignees
Labels
[C] Bug This is a bug. Something isn't working.

Comments

@avanhatt
Copy link
Contributor

RMC panics with assertion failed: w < 128.

Steps:

git clone [email protected]:krisprice/ipnet.git
cd ipnet
RUSTC=rmc-rustc RUSTFLAGS="-Z trim-diagnostic-paths=no -Z codegen-backend=gotoc --cfg=rmc" cargo +nightly build --target x86_64-unknown-linux-gnu -j 1

Output

    Updating crates.io index
 Downloading crates ...
  Downloaded serde_test v1.0.127
   Compiling serde v1.0.127
   Compiling ipnet v2.3.1 (/home/ubuntu/ipnet)
thread 'rustc' panicked at 'assertion failed: w < 128', compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/typ.rs:748:9
stack backtrace:
   0: rust_begin_unwind
             at /home/ubuntu/rmc/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /home/ubuntu/rmc/library/core/src/panicking.rs:93:14
   2: core::panicking::panic
             at /home/ubuntu/rmc/library/core/src/panicking.rs:50:5
   3: rustc_codegen_llvm::gotoc::cbmc::goto_program::typ::Type::max_int
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/typ.rs:748:9
   4: rustc_codegen_llvm::gotoc::cbmc::goto_program::typ::Type::max_int_expr
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/typ.rs:755:28
   5: rustc_codegen_llvm::gotoc::cbmc::goto_program::expr::Expr::saturating_add
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/expr.rs:1231:79
   6: rustc_codegen_llvm::gotoc::intrinsic::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_intrinsic
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs:373:33
   7: <rustc_codegen_llvm::gotoc::hooks::Intrinsic as rustc_codegen_llvm::gotoc::hooks::GotocHook>::handle
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/hooks.rs:274:21
   8: rustc_codegen_llvm::gotoc::statement::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_funcall
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/statement.rs:281:28
   9: rustc_codegen_llvm::gotoc::statement::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_terminator
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/statement.rs:63:17
  10: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_block
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:133:28
  11: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_function::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:304:71
  12: core::iter::traits::iterator::Iterator::for_each::call::{{closure}}
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:730:29
  13: core::iter::adapters::map::map_fold::{{closure}}
             at /home/ubuntu/rmc/library/core/src/iter/adapters/map.rs:84:21
  14: <core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::fold::enumerate::{{closure}}
             at /home/ubuntu/rmc/library/core/src/iter/adapters/enumerate.rs:106:27
  15: core::iter::traits::iterator::Iterator::fold
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:2170:21
  16: <core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::fold
             at /home/ubuntu/rmc/library/core/src/iter/adapters/enumerate.rs:112:9
  17: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
             at /home/ubuntu/rmc/library/core/src/iter/adapters/map.rs:124:9
  18: core::iter::traits::iterator::Iterator::for_each
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:733:9
  19: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_function
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:304:13
  20: <rustc_codegen_llvm::gotoc::GotocCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:488:35
  21: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::call_with_panic_debug_info::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:109:13
  22: std::thread::local::LocalKey<T>::try_with
             at /home/ubuntu/rmc/library/std/src/thread/local.rs:399:16
  23: std::thread::local::LocalKey<T>::with
             at /home/ubuntu/rmc/library/std/src/thread/local.rs:375:9
  24: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::call_with_panic_debug_info
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:107:9
  25: <rustc_codegen_llvm::gotoc::GotocCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:487:25
  26: rustc_interface::passes::start_codegen::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:1056:9
  27: rustc_data_structures::profiling::VerboseTimingGuard::run
             at /home/ubuntu/rmc/compiler/rustc_data_structures/src/profiling.rs:611:9
  28: rustc_session::utils::<impl rustc_session::session::Session>::time
             at /home/ubuntu/rmc/compiler/rustc_session/src/utils.rs:16:9
  29: rustc_interface::passes::start_codegen
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:1055:19
  30: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:254:20
  31: rustc_interface::passes::QueryContext::enter::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:780:42
  32: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_middle/src/ty/context.rs:1784:50
  33: rustc_middle::ty::context::tls::set_tlv
             at /home/ubuntu/rmc/compiler/rustc_middle/src/ty/context.rs:1768:9
  34: rustc_middle::ty::context::tls::enter_context
             at /home/ubuntu/rmc/compiler/rustc_middle/src/ty/context.rs:1784:9
  35: rustc_interface::passes::QueryContext::enter
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:780:9
  36: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:245:13
  37: rustc_interface::queries::Query<T>::compute
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:38:28
  38: rustc_interface::queries::Queries::ongoing_codegen
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:243:9
  39: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_driver/src/lib.rs:407:13
  40: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:394:19
  41: rustc_driver::run_compiler::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_driver/src/lib.rs:312:22
  42: rustc_interface::interface::create_compiler_and_run::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/interface.rs:209:13
  43: rustc_span::with_source_map
             at /home/ubuntu/rmc/compiler/rustc_span/src/lib.rs:911:5
  44: rustc_interface::interface::create_compiler_and_run
             at /home/ubuntu/rmc/compiler/rustc_interface/src/interface.rs:203:5
  45: rustc_interface::interface::run_compiler::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/interface.rs:225:12
  46: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/util.rs:157:13
  47: scoped_tls::ScopedKey<T>::set
             at /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  48: rustc_span::create_session_globals_then
             at /home/ubuntu/rmc/compiler/rustc_span/src/lib.rs:105:5
  49: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/util.rs:155:9
  50: rustc_interface::util::scoped_thread::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/util.rs:130:24
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: 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.56.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z trim-diagnostic-paths=no -Z codegen-backend=gotoc -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
end of query stack

[RMC] current codegen item: codegen_function: core::num::<impl u128>::saturating_add

RMC unexpectedly panicked during code generation.

If you are seeing this message, please file an issue here instead of on the Rust compiler: https://github.com/model-checking/rmc/issues/new?labels=bug&template=bug_report.md
error: could not compile `ipnet`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Bug This is a bug. Something isn't working.
Projects
None yet
2 participants