WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
259441
WASM module memory errors
https://bugs.webkit.org/show_bug.cgi?id=259441
Summary
WASM module memory errors
jrx
Reported
2023-07-24 03:21:03 PDT
We had a weird bug using Tauri + Leptos (Rust/WASM) framework. Those are using the system webview in order to run a UI (Electron style ... but without chrome) On our linux machines (Ubuntu or Fedora), it randomly crashes. more details here :
https://github.com/rustwasm/wasm-bindgen/issues/3470
Narrowed it with this very light example :
https://github.com/jrouaix/wasm_pbm
- this is 100% sure NOT related to Tauri - we also reproduced it without Leptos Do you folks have an idea where I should dig more or ask for help in order to resolve the issue ? (i'm very surprise to be the first to step into something so easy to reproduce)
Attachments
Add attachment
proposed patch, testcase, etc.
Justin Michaud
Comment 1
2023-07-24 13:39:15 PDT
This issue can be caused by a wide variety of problems. Does your example work correctly in Chrome or Firefox? Does it reproduce on the latest version of epiphany? If you increase the amount of memory that rust asks for up front, does the issue go away? If you lower it, does the issue reproduce in the other browsers? What about stack size? This could be a: 1) random bug in rust or any linked frameworks 2) we run out of memory, but don't signal this to memory.grow successfully 3) we run out of memory, produce the correct status code in memory.grow, but rust doesn't give you a good error 4) the rust sdk goes down a completely different code path for some reason Cutting down the example further, and perhaps placing some logging around allocations would be super helpful here.
Justin Michaud
Comment 2
2023-07-24 13:41:20 PDT
On the WebKit side, there are some options you can try running with. GTK folks can explain how to pass them in, I only know how to do it on macOS. useWebAssemblyFastMemory=0 useOMGJIT=0 useOMGJIT=0 useWasmLLInt=0
jrx
Comment 3
2023-07-25 02:43:50 PDT
It's working perfectly on Chrome & Firefox I was running `Web 42.4` epiphany version that is 11 months old ! Reinstalled with flatpack : epiphany 44.4 / WebKitGTK 2.40.4 reproduced exactly same problem
jrx
Comment 4
2023-07-25 03:19:16 PDT
Tried on another project with `yew` (another Rust wasm framework) => same same, got a wasm crash after about 20 reloads
jrx
Comment 5
2023-07-27 06:29:26 PDT
So perhaps using WASM & Webkit on Linux is so niche nobody spot this bug yet ? I wonder if there could be an exploit of some kind. I'm not security researcher.
Radar WebKit Bug Importer
Comment 6
2023-07-31 03:21:15 PDT
<
rdar://problem/113131117
>
dietmar
Comment 7
2023-12-29 04:07:42 PST
Just uploaded another test using Yew:
https://github.com/maurerdietmar/webkit-yew-bug
Wewbkit is currently unable to run WASM code reliable.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug