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

Test run-pass/generator/size-moved-locals.rs fails on WASM #62807

Closed
petrochenkov opened this issue Jul 19, 2019 · 5 comments
Closed

Test run-pass/generator/size-moved-locals.rs fails on WASM #62807

petrochenkov opened this issue Jul 19, 2019 · 5 comments
Labels
A-coroutines Area: Coroutines 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

@petrochenkov
Copy link
Contributor

Due to a regression in compiletest some run-pass tests weren't run properly for some time and this is one of the regressions that slipped through during that time.

#62797 (comment)

2019-07-19T15:47:51.8482480Z ---- [run-pass] run-pass/generator/size-moved-locals.rs stdout ----
2019-07-19T15:47:51.8482558Z 
2019-07-19T15:47:51.8482620Z error: test run failed!
2019-07-19T15:47:51.8482703Z status: exit code: 101
2019-07-19T15:47:51.8483190Z command: "/node-v9.2.0-linux-x64/bin/node" "/checkout/src/etc/wasm32-shim.js" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/generator/size-moved-locals/a.wasm"
2019-07-19T15:47:51.8483321Z stdout:
2019-07-19T15:47:51.8483809Z ------------------------------------------
2019-07-19T15:47:51.8483875Z 
2019-07-19T15:47:51.8484103Z ------------------------------------------
2019-07-19T15:47:51.8484188Z stderr:
2019-07-19T15:47:51.8484415Z ------------------------------------------
2019-07-19T15:47:51.8484502Z RuntimeError: unreachable
2019-07-19T15:47:51.8484753Z     at __rust_start_panic (wasm-function[65]:1)
2019-07-19T15:47:51.8485005Z     at rust_panic (wasm-function[60]:39)
2019-07-19T15:47:51.8485317Z     at _ZN3std9panicking20rust_panic_with_hook17hb64f1aeb1f625a2aE (wasm-function[55]:346)
2019-07-19T15:47:51.8485649Z     at _ZN3std9panicking18continue_panic_fmt17h8bffa35d05d676f9E (wasm-function[54]:151)
2019-07-19T15:47:51.8488784Z     at _ZN3std9panicking15begin_panic_fmt17h31b07c0c65ebceb5E (wasm-function[27]:108)
2019-07-19T15:47:51.8489246Z     at _ZN17size_moved_locals4main17h02cd372238a9883dE (wasm-function[0]:144)
2019-07-19T15:47:51.8489585Z     at _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h72d5442d7ee73094E (wasm-function[3]:25)
2019-07-19T15:47:51.8489962Z     at _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17he1adeffeb91504b7E (wasm-function[43]:8)
2019-07-19T15:47:51.8490266Z     at _ZN3std9panicking3try7do_call17h0b8ce620099b0dacE (wasm-function[52]:20)
2019-07-19T15:47:51.8490551Z     at __rust_maybe_catch_panic (wasm-function[64]:5)
2019-07-19T15:47:51.8490861Z     at _ZN3std2rt19lang_start_internal17h07703b904ab9ad19E (wasm-function[61]:264)
2019-07-19T15:47:51.8491106Z     at main (wasm-function[1]:46)
2019-07-19T15:47:51.8491567Z     at Object.<anonymous> (/checkout/src/etc/wasm32-shim.js:126:20)
2019-07-19T15:47:51.8491664Z     at Module._compile (module.js:641:30)
2019-07-19T15:47:51.8491759Z     at Object.Module._extensions..js (module.js:652:10)
2019-07-19T15:47:51.8491833Z     at Module.load (module.js:560:32)
2019-07-19T15:47:51.8491920Z     at tryModuleLoad (module.js:503:12)
2019-07-19T15:47:51.8491992Z     at Function.Module._load (module.js:495:3)
2019-07-19T15:47:51.8492091Z     at Function.Module.runMain (module.js:682:10)
2019-07-19T15:47:51.8492163Z     at startup (bootstrap_node.js:191:16)
2019-07-19T15:47:51.8492209Z 
2019-07-19T15:47:51.8492501Z ------------------------------------------

cc @tmandry

@jonas-schievink jonas-schievink added A-coroutines Area: Coroutines 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. labels Jul 19, 2019
@tmandry
Copy link
Member

tmandry commented Jul 20, 2019

We also disabled ui/async-await/async-fn-size-moved-locals.rs for the same reason. Basically these tests are "change detectors" for generator sizes. I think it's okay to skip these on WASM, but not ideal.

One alternative is to come up with reasonable upper bounds for the size. Since the inner type in these tests is 1024 bytes, we can just check for the right number of copies of that type, with some wiggle room for extra data and padding bytes.

@tmandry
Copy link
Member

tmandry commented Sep 19, 2019

Fixed in #62797

@alexcrichton
Copy link
Member

I think it's fine to skip this on wasm, so closing since there's no need to track re-enabling.

@fzaiser
Copy link

fzaiser commented Jul 25, 2022

We hit the same issue in the Kani Rust verifier. In our code, we simply use layout.size.bytes(), which seems to be the same thing that WASM does. I'm not sure where exactly it happens in the LLVM codegen, but the only places I've found use layout.size.bytes() too. Does anybody know why the LLVM backend behaves differently from WASM?

@celinval
Copy link
Contributor

This could be related to the panic strategy. WASM only supports -C panic=abort (rustwasm/book#76). If you run the test above with LLVM backend with --C abort=panic option, the test will fail because the generator size is different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-coroutines Area: Coroutines 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

6 participants