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

Standarize Singlepass traps #903

Closed
mikhailOK opened this issue Oct 24, 2019 · 4 comments
Closed

Standarize Singlepass traps #903

mikhailOK opened this issue Oct 24, 2019 · 4 comments
Labels
bug Something isn't working 📦 lib-compiler-singlepass About wasmer-compiler-singlepass

Comments

@mikhailOK
Copy link

Describe the bug

Running a wasm code that just crashes gives different errors in singlepass backend and singlepass + metering

Singlepass backend: RuntimeError::Trap { msg }
Singlepass backend with metering: RuntimeError::Error { data } where type of data is not a string or ExecutionLimitExceededError

Steps to reproduce

Wat code:

(module
              (type (;0;) (func))
              (func (;0;) (type 0) (unreachable))
              (export "hello" (func 0))
            )

versions:

wasmer-runtime = { version = "0.9.0", features = ["singlepass"] }
wasmer-runtime-core = { version = "0.9.0"}
wasmer-middleware-common = "0.9.0"
wasmer-singlepass-backend = "0.9.0"

singlepass compiler:
wasmer_singlepass_backend::SinglePassCompiler::new()
singlepass compiler with metering:

    use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
    <StreamingCompiler<SinglePassMCG, _, _, _, _>>::new(move || {
        let mut chain = MiddlewareChain::new();
        chain.push(Metering::new(limit));
        chain
    })

Expected behavior

Code compiled with metering should return the same error as without

Actual behavior

Additional context

@mikhailOK mikhailOK added the bug Something isn't working label Oct 24, 2019
@syrusakbary
Copy link
Member

Hi @mikhailOK, thanks for the report! It seems like a bug.

Would you like to help us on resolving it? We can provide as much guidance as needed! :)

@Hywan Hywan added the 📦 lib-compiler-singlepass About wasmer-compiler-singlepass label Nov 4, 2019
@mikhailOK
Copy link
Author

Actually I was wrong, it's not related to metering: it's actually cranelift vs singlepass (with or without metering)

@syrusakbary syrusakbary changed the title Singlepass backend + metering error on wasm trap Standarize Singlepass traps Nov 19, 2019
@syrusakbary
Copy link
Member

In the refactor, all compilers return the same errors (and we test it so). We should be able to close this issue once the refactor lands

@syrusakbary
Copy link
Member

Thanks to the refactor, all compilers now behave the same way regarding traps.

Closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-compiler-singlepass About wasmer-compiler-singlepass
Projects
None yet
Development

No branches or pull requests

3 participants