Bug 242780 - mozilla.github.io/translate fails with wasm streaming error
Summary: mozilla.github.io/translate fails with wasm streaming error
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-07-14 18:21 PDT by Karl Dubost
Modified: 2023-03-07 16:47 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Dubost 2022-07-14 18:21:54 PDT
Steps to reproduce:
1. with macOS Ventura on Safari Version 16.0 (18614.1.19.1.5)
2. Go to https://mozilla.github.io/translate/

Expected:
page loads and menu are initialized.

Actual:
drop down menu stays blank and the page is inactive.

The console displays:

```
[Debug] Message 'import' received from main script (worker.js, line 33)
[Warning] wasm streaming compile failed: CompileError: WebAssembly.Module doesn't parse at byte 1088: can't get 0th Type's return value (bergamot-translator-worker.js, line 734)
[Warning] falling back to ArrayBuffer instantiation (bergamot-translator-worker.js, line 735)
[Warning] failed to asynchronously prepare wasm: CompileError: WebAssembly.Module doesn't parse at byte 1088: can't get 0th Type's return value (bergamot-translator-worker.js, line 723)
[Warning] CompileError: WebAssembly.Module doesn't parse at byte 1088: can't get 0th Type's return value (bergamot-translator-worker.js, line 647)
[Error] Unhandled Promise Rejection: RuntimeError: abort(CompileError: WebAssembly.Module doesn't parse at byte 1088: can't get 0th Type's return value). Build with -s ASSERTIONS=1 for more info.
	(anonymous function)
	rejectPromise
	promiseReactionJob
```

the message seems to be generated by 
https://github.com/WebKit/WebKit/blob/612c245823a515c8c70c2ad486957bd8a850f0f9/Source/JavaScriptCore/wasm/WasmStreamingParser.cpp#L63-L70


This is currently working both in Firefox and Chrome.
Comment 1 Radar WebKit Bug Importer 2022-07-14 18:22:36 PDT
<rdar://problem/97047187>
Comment 2 Yusuke Suzuki 2023-03-07 16:47:31 PST
Fixed with SIMD support.