Skip to content

Unable to codegen micro-http crate #265

@nchong-at-aws

Description

@nchong-at-aws

The following fails (nb: must be on Linux x86 machine):

git clone https://github.com/firecracker-microvm/micro-http.git
cd micro-http
RUST_BACKTRACE=1 RUSTFLAGS="-Z trim-diagnostic-paths=no -Z codegen-backend=gotoc --cfg=rmc" RUSTC=rmc-rustc cargo build --target x86_64-unknown-linux-gnu -j 1

with RMC version: #261

Backtrace

   Compiling micro_http v0.1.0 (/local/home/ncchong/micro-http)
thread 'rustc' panicked at 'assertion failed: self.typ().is_equal_on_machine(new_typ, mm)', compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/expr.rs:425:13
stack backtrace:
   0: rust_begin_unwind
             at /local/home/ncchong/rmc/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /local/home/ncchong/rmc/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /local/home/ncchong/rmc/library/core/src/panicking.rs:50:5
   3: rustc_codegen_llvm::gotoc::cbmc::goto_program::expr::Expr::cast_to_machine_equivalent_type
             at /local/home/ncchong/rmc/compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/expr.rs:425:13
   4: rustc_codegen_llvm::gotoc::intrinsic::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_intrinsic
             at /local/home/ncchong/rmc/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs:347:29
   5: <rustc_codegen_llvm::gotoc::hooks::Intrinsic as rustc_codegen_llvm::gotoc::hooks::GotocHook>::handle
             at /local/home/ncchong/rmc/compiler/rustc_codegen_llvm/src/gotoc/hooks.rs:274:21
   6: rustc_codegen_llvm::gotoc::statement::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_funcall
             at /local/home/ncchong/rmc/compiler/rustc_codegen_llvm/src/gotoc/statement.rs:258:28
   7: rustc_codegen_llvm::gotoc::statement::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_terminator
             at /local/home/ncchong/rmc/compiler/rustc_codegen_llvm/src/gotoc/statement.rs:62:17
   8: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_block
             at /local/home/ncchong/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:51:29
   9: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_function::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:145:71
  10: core::iter::traits::iterator::Iterator::for_each::call::{{closure}}
             at /local/home/ncchong/rmc/library/core/src/iter/traits/iterator.rs:733:29
  11: core::iter::adapters::map::map_fold::{{closure}}
             at /local/home/ncchong/rmc/library/core/src/iter/adapters/map.rs:82:21
  12: <core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::fold::enumerate::{{closure}}
             at /local/home/ncchong/rmc/library/core/src/iter/adapters/enumerate.rs:104:27
  13: core::iter::traits::iterator::Iterator::fold
             at /local/home/ncchong/rmc/library/core/src/iter/traits/iterator.rs:2153:21
  14: <core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::fold
             at /local/home/ncchong/rmc/library/core/src/iter/adapters/enumerate.rs:110:9
  15: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
             at /local/home/ncchong/rmc/library/core/src/iter/adapters/map.rs:122:9
  16: core::iter::traits::iterator::Iterator::for_each
             at /local/home/ncchong/rmc/library/core/src/iter/traits/iterator.rs:736:9
  17: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_function
             at /local/home/ncchong/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:145:13
  18: <rustc_codegen_llvm::gotoc::GotocCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
             at /local/home/ncchong/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:316:47
  19: rustc_interface::passes::start_codegen::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/passes.rs:1060:9
  20: rustc_data_structures::profiling::VerboseTimingGuard::run
             at /local/home/ncchong/rmc/compiler/rustc_data_structures/src/profiling.rs:573:9
  21: rustc_session::utils::<impl rustc_session::session::Session>::time
             at /local/home/ncchong/rmc/compiler/rustc_session/src/utils.rs:16:9
  22: rustc_interface::passes::start_codegen
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/passes.rs:1059:19
  23: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/queries.rs:295:20
  24: rustc_interface::passes::QueryContext::enter::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/passes.rs:799:42
  25: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_middle/src/ty/context.rs:1744:50
  26: rustc_middle::ty::context::tls::set_tlv
             at /local/home/ncchong/rmc/compiler/rustc_middle/src/ty/context.rs:1728:9
  27: rustc_middle::ty::context::tls::enter_context
             at /local/home/ncchong/rmc/compiler/rustc_middle/src/ty/context.rs:1744:9
  28: rustc_interface::passes::QueryContext::enter
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/passes.rs:799:9
  29: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/queries.rs:286:13
  30: rustc_interface::queries::Query<T>::compute
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/queries.rs:40:28
  31: rustc_interface::queries::Queries::ongoing_codegen
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/queries.rs:284:9
  32: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_driver/src/lib.rs:414:13
  33: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/queries.rs:435:19
  34: rustc_driver::run_compiler::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_driver/src/lib.rs:313:22
  35: rustc_interface::interface::create_compiler_and_run::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/interface.rs:208:13
  36: rustc_span::with_source_map
             at /local/home/ncchong/rmc/compiler/rustc_span/src/lib.rs:873:5
  37: rustc_interface::interface::create_compiler_and_run
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/interface.rs:202:5
  38: rustc_interface::interface::run_compiler::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/interface.rs:224:12
  39: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/util.rs:158:13
  40: scoped_tls::ScopedKey<T>::set
             at /home/ncchong/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  41: rustc_span::with_session_globals
             at /local/home/ncchong/rmc/compiler/rustc_span/src/lib.rs:104:5
  42: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/util.rs:156:9
  43: rustc_interface::util::scoped_thread::{{closure}}
             at /local/home/ncchong/rmc/compiler/rustc_interface/src/util.rs:131:24

Metadata

Metadata

Assignees

Labels

[C] BugThis is a bug. Something isn't working.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions