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_async_hello_stack_switching fails under v8 10.7.187 and above: #17846

Closed
sbc100 opened this issue Sep 14, 2022 · 1 comment · Fixed by WebAssembly/binaryen#5044
Closed
Assignees

Comments

@sbc100
Copy link
Collaborator

sbc100 commented Sep 14, 2022

See https://app.circleci.com/pipelines/github/emscripten-core/emscripten/23491/workflows/498e0d1d-cdbf-4e94-bcb3-b03a94d72763/jobs/566465

FAIL: test_async_hello_stack_switching (test_core.core0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 385, in resulting_test
    return func(self, *args)
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 117, in decorated
    func(self, *args, **kwargs)
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/test_core.py", line 248, in metafunc
    f(self)
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/test_core.py", line 8035, in test_async_hello
    self.do_runf('main.c', 'HelloWorld!99')
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 1207, in do_runf
    return self._build_and_run(filename, expected_output, **kwargs)
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 1262, in _build_and_run
    js_output = self.run_js(js_file, engine, args,
  File "/usr/local/google/home/sbc/dev/wasm/emscripten/test/common.py", line 857, in run_js
    self.fail('JS subprocess failed (%s): %s.  Output:\n%s' % (error.cmd, error.returncode, ret))
AssertionError: JS subprocess failed (/usr/local/google/home/sbc/.jsvu/v8-10.7.187 --wasm-staging --wasm-staging --experimental-wasm-stack-switching /tmp/emscripten_test_core0_bqi1sbji/main.js --no-wasm-async-compilation --): 1.  Output:
HelloWorld!99
wasm-function[97]:0x4ea3: RuntimeError: invalid suspender object for suspend
RuntimeError: invalid suspender object for suspend
    at wasm://wasm/0001465a:wasm-function[97]:0x4ea3
    at wasm://wasm/0001465a:wasm-function[10]:0x53f
    at wasm://wasm/0001465a:wasm-function[27]:0xc74
    at wasm://wasm/0001465a:wasm-function[30]:0x17a5
    at wasm://wasm/0001465a:wasm-function[29]:0xf14
    at wasm://wasm/0001465a:wasm-function[28]:0xdad
    at wasm://wasm/0001465a:wasm-function[37]:0x1bd1
    at wasm://wasm/0001465a:wasm-function[9]:0x4c9
    at wasm://wasm/0001465a:wasm-function[7]:0x488
    at wasm://wasm/0001465a:wasm-function[8]:0x4a6
@brendandahl
Copy link
Collaborator

My local version is failing now too after updating v8. I'm not sure what has changed, I'll ask Thibaud.

brendandahl added a commit to brendandahl/binaryen that referenced this issue Sep 15, 2022
Fixes: emscripten-core/emscripten#17846

More detailed explanation of the issue from Thibaud:
- A promising export is entered, generating a suspender s1, which is stored in the global
- The wasm code calls a wrapped import, passing it the value in the global (s1) and suspends
- Another export is entered, generating suspender s2, which is stored in the global
- We call another wrapped import, which suspends s2 (so far so good)
- We return to the event loop and s1 is resumed

And now we are in an inconsistent state: the active suspender is "s1", but the object in the global is "s2".
So the next time we call a wrapped import, there is a mismatch, which is what this runtime error reports.
brendandahl added a commit to WebAssembly/binaryen that referenced this issue Sep 16, 2022
Fixes: emscripten-core/emscripten#17846

More detailed explanation of the issue from Thibaud:
- A promising export is entered, generating a suspender s1, which is stored in the global
- The wasm code calls a wrapped import, passing it the value in the global (s1) and suspends
- Another export is entered, generating suspender s2, which is stored in the global
- We call another wrapped import, which suspends s2 (so far so good)
- We return to the event loop and s1 is resumed

And now we are in an inconsistent state: the active suspender is "s1", but the object in the global is "s2".
So the next time we call a wrapped import, there is a mismatch, which is what this runtime error reports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants