Closed Bug 1817784 Opened 1 year ago Closed 9 months ago

The demo using Wasm GC doesn't work

Categories

(Core :: JavaScript: WebAssembly, defect, P2)

Firefox 112
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: bashorov, Unassigned)

References

(Blocks 1 open bug)

Details

Steps to reproduce:

https://zal.im/wasm/creative/

Firefox Nightly 112.0a1 (2023-02-20) (64-bit) shows:

CompileError: wasm validation error: at offset 162765: bad type

The Bugbug bot thinks this bug should belong to the 'Core::JavaScript: WebAssembly' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → JavaScript: WebAssembly
Product: Firefox → Core
Severity: -- → S3
Priority: -- → P2

It looks like this demo is using nullref as a type, I have a patch the implements the bottom types and should fix that.

Once I fixed that though it looks like it's using opcode fb 51 which is ref.is_data. I don't think we're going to add support for that one, and will instead implement the generalized ref.test in V8 milestone 6.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Oh, sorry, my bad. I had published files produced by compiler version before applying workarounds for compatibility with Firefox.

I updated files. Now there are files produced by Kotlin 1.8.20 (includes workarounds -- no usegas of nullref none and unsupported instructions).

So, now with Firefox 112.0a1 (2023-02-23) (64-bit):
I got WebAssembly.Exception if just open the page https://zal.im/wasm/creative/.
It looks like it starts well and does some dom operations successfully but fails later.

If I open Debugger tab in DevTools and refresh, it starts working. I guess Firefox uses different tiers on this case.
As soon as I close DevTools and switch the tab or window, the tab crashes.

I guess Firefox uses different tiers on this case.
As soon as I close DevTools and switch the tab or window, the tab crashes.

The tiers can be controlled by javascript.options.wasm_optimizingjit and javascript.options.wasm_baselinejit options in the about:config. I recommend to not open debugger tab. If you need check console, refrain clicking on the debugger -- otherwise it will enable debug mode and disable optimizingjit tier.

After recent fixes (for Bug 1817782) the demo works in Firefox Nightly.

While playing with wasm_*jit flags I've noticed exception:
Reproducer:

  1. Turn on javascript.options.wasm_gc and javascript.options.wasm_function_references
  2. Open https://zal.im/wasm/creative/.
  3. Open about:config and turn off javascript.options.wasm_baselinejit
  4. Refresh https://zal.im/wasm/creative/.
    Now it fails with RuntimeError: bad cast

If you make hard refresh it starts working.

Should the such scenario work (aka is it bug) ? If so, should I file a separate issue?

(In reply to bashor from comment #7)

While playing with wasm_*jit flags I've noticed exception:
Reproducer:

  1. Turn on javascript.options.wasm_gc and javascript.options.wasm_function_references
  2. Open https://zal.im/wasm/creative/.
  3. Open about:config and turn off javascript.options.wasm_baselinejit
  4. Refresh https://zal.im/wasm/creative/.
    Now it fails with RuntimeError: bad cast

If you make hard refresh it starts working.

Should the such scenario work (aka is it bug) ? If so, should I file a separate issue?

This may be a duplicate of bug 1821061, which we're still working on.

Is this still an issue?

Flags: needinfo?(bashorov)

(In reply to Ryan Hunt [:rhunt] from comment #9)

Is this still an issue?

I think this could be closed.

The issue was fixed, but now there is another one 🤷‍♂️ -- https://bugzilla.mozilla.org/show_bug.cgi?id=1843392

Flags: needinfo?(bashorov)
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.