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

Invalid wasm (trying to access parent frame stack values) with latest nightly (wasm32-unknown-unknown) #50869

Closed
DarrenTsung opened this issue May 18, 2018 · 2 comments
Labels
C-bug Category: This is a bug. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@DarrenTsung
Copy link

Hi, I'm running into an issue I believe introduced in the nightly compiler sometime after nightly (8ff4b4206 2018-05-08). I filed another issue in wasm-bindgen earlier: rustwasm/wasm-bindgen#199, but believe that it is a compiler change that caused this to occur.

I've created a test-case repository here: https://github.com/DarrenTsung/wasm-validation-64.

On my current nightly, the wasm code produced fails validation with wasmi with the error: Trying to access parent frame stack values., but this does not occur with nightly-2018-05-09.

I've included the rustc version that I ran against in the test-case repository, but please let me know if any other information would be useful!

@kennytm kennytm added O-wasm Target: WASM (WebAssembly), http://webassembly.org/ C-bug Category: This is a bug. labels May 18, 2018
@cuviper cuviper added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 19, 2018
@alexcrichton
Copy link
Member

Thanks for the report here @DarrenTsung, I've been able to reproduce with these instructions!

It looks like somewhere along the way LLVM is producing an invalid object file for wasm. Using wasm-validate I get:

error: type mismatch in call, expected [i32, i32] but got [i32]

Sure enough using llc to reassemble one of the intermediate bytecode files I'm also able to generate the same error.

I've opened an upstream bug to track this for LLVM

@alexcrichton
Copy link
Member

This has been fixed in upstream LLVM and I've sent a PR to update our LLVM with that fix

kennytm added a commit to kennytm/rust that referenced this issue May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants