Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Panic with SimpleJIT + module.define_data #407

@bjorn3

Description

@bjorn3

Relevant code: https://github.com/bjorn3/rustc_codegen_cranelift/blob/static_error/src/constant.rs

Backtrace:

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `true`,
 right: `false`', cranelift/lib/module/src/module.rs:277:9
stack backtrace:
[...]
   7: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:345
   8: <cranelift_module::module::ModuleNamespace<'a, B>>::get_data_definition
             at ./<panic macros>:8
   9: <cranelift_simplejit::backend::SimpleJITBackend as cranelift_module::backend::Backend>::finalize_data
             at cranelift/lib/simplejit/src/backend.rs:317
  10: <cranelift_module::module::Module<B>>::finalize_data
             at ./cranelift/lib/module/src/module.rs:588
  11: rustc_codegen_cranelift::constant::get_global_for_alloc_id
             at src/constant.rs:104
  12: rustc_codegen_cranelift::constant::trans_constant
             at src/constant.rs:42
  13: rustc_codegen_cranelift::base::trans_operand
             at src/base.rs:524
  14: rustc_codegen_cranelift::base::trans_stmt
             at src/base.rs:227
  15: rustc_codegen_cranelift::base::trans_fn
             at src/base.rs:104
  16: rustc_codegen_cranelift::base::trans_mono_item
             at src/base.rs:30
  17: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
             at src/lib.rs:191
[...]

Reproduction:

$ git clone https://github.com/bjorn3/rustc_codegen_cranelift.git
$ cd rustc_codegen_cranelift
$ rustup override set nightly
$ rustup component add rust-src
$ git checkout static_error
$ git submodule update --init
$ ./prepare_libcore.sh
$ ./build.sh

You may need to run ./build.sh a few times before this specific errors shows up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions