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

Engine::new().set_target(Some(Windows)) crashes Module::compile #3508

Closed
fschutt opened this issue Jan 19, 2023 · 1 comment
Closed

Engine::new().set_target(Some(Windows)) crashes Module::compile #3508

fschutt opened this issue Jan 19, 2023 · 1 comment
Assignees
Labels
priority-high High priority issue
Milestone

Comments

@fschutt
Copy link
Contributor

fschutt commented Jan 19, 2023

When initializing the Engine from CompilerOptions::get_engine(), compiling a module crashes with

  3: wasmer_compiler::engine::code_memory::CodeMemory::allocate
   4: wasmer_compiler::engine::inner::EngineInner::allocate
   5: wasmer_compiler::engine::artifact::Artifact::from_parts
   6: wasmer_compiler::engine::artifact::Artifact::new
   7: wasmer_compiler::engine::inner::Engine::compile
   8: wasmer::sys::module::Module::from_binary
   9: wasmer_cli::commands::create_exe::get_module_infos
  10: wasmer_cli::commands::create_exe::CreateExe::execute
  11: wasmer_cli::cli::wasmer_main_inner
  12: wasmer_cli::cli::wasmer_main

... if the target is set to Windows.

Minimal example:

use std::str::FromStr;

use wasmer::*; // v3.1.0

const WASM_BYTES: &[u8] = include_bytes!("qjs.wasm");

fn main() {
    let engine = EngineBuilder::new(Box::new(wasmer_compiler_cranelift::Cranelift::default()) as Box<_>)
    .set_target(Some(Target::new(Triple::from_str("x86_64-windows-gnu").unwrap(), [CpuFeature::SSE2].into_iter().collect())));
    let store = Store::new(engine.engine());
    let module = Module::new(&store, WASM_BYTES).unwrap();
    println!("{:#?}", module.name());
}

This can be disabled by setting the target.operating_system to anything but Windows.

@ptitSeb ptitSeb self-assigned this Jan 19, 2023
@syrusakbary syrusakbary added the priority-high High priority issue label Jan 24, 2023
@syrusakbary syrusakbary added this to the v3.2 milestone Jan 24, 2023
ptitSeb added a commit that referenced this issue Feb 3, 2023
…unwind info that needs Windows syscall for now (for #3508)
@ptitSeb
Copy link
Contributor

ptitSeb commented Feb 6, 2023

Fixed with #3573

@ptitSeb ptitSeb closed this as completed Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-high High priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants