software-mansion / live-compositor

Media server for real-time, low latency, programmable video and audio mixing.
https://compositor.live
Other
267 stars 18 forks source link

[wasm] Regression after updating `wgpu` to `23.0.0` #874

Open noituri opened 3 days ago

noituri commented 3 days ago

After 505fc0743899cf28bde20a72961ad4cee7056eaf, web-wasm often panics with a variety of different errors. The panics are not deterministic. Sometimes it works without any issues.

Confirmed on:

The most common errors:

  1. live-compositor.wasm:0x10865c Uncaught (in promise) RuntimeError: memory access out of bounds
    at live-compositor.wasm:0x10865c
    at live-compositor.wasm:0x4b77e6
    at live-compositor.wasm:0x43655f
    at live-compositor.wasm:0x406f79
    at live-compositor.wasm:0x3f8fff
    at live-compositor.wasm:0x416909
    at live-compositor.wasm:0x4a6700
    at LiveCompositorRenderer.render (index.js:385:26)
    at Renderer.render (index.js:2016:38)
    at Queue.onTick (queue.js:46:39)
  2. index.js:1919 Uncaught (in promise) Error: recursive use of an object detected which would lead to unsafe aliasing in rust
    at imports.wbg.__wbindgen_throw (index.js:1919:15)
    at live-compositor.wasm:0x4d112f
    at live-compositor.wasm:0x4d1124
    at live-compositor.wasm:0x4aac2a
    at LiveCompositorRenderer.render (index.js:385:26)
    at Renderer.render (index.js:2016:38)
    at Queue.onTick (queue.js:46:39)
    at async queue.js:15:13
  3. Uncaught RuntimeError: null function or function signature mismatch
    at live-compositor.wasm:0x40a29d
    at live-compositor.wasm:0x4b4f4c
    at live-compositor.wasm:0x499623
    at CLOSURE_DTORS (index.js:171:45)
    at FinalizationRegistry.cleanupSome 
  4. 
    index.js:631 panicked at ndex.crates.io-6f17d22bba15001f/wgpu-core-23.0.0/src/storage.rs:128:46:
    Queue[Id(0,1)] does not exist

Stack:

Error at imports.wbg.__wbg_new_abda76e883ba8a5f (http://localhost:5173/@fs/live_compositor/ts/@live-compositor/browser-render/dist/index.js:615:21) at http://localhost:5173/assets/live-compositor.wasm:wasm-function[6062]:0x4e725b at http://localhost:5173/assets/live-compositor.wasm:wasm-function[3046]:0x417328 at http://localhost:5173/assets/live-compositor.wasm:wasm-function[4313]:0x4888d0 at http://localhost:5173/assets/live-compositor.wasm:wasm-function[2452]:0x3d4421 at http://localhost:5173/assets/live-compositor.wasm:wasm-function[1793]:0x363476 at http://localhost:5173/assets/live-compositor.wasm:wasm-function[2668]:0x3ef090 at http://localhost:5173/assets/live-compositor.wasm:wasm-function[4906]:0x4a556a at LiveCompositorRenderer.render (http://localhost:5173/@fs/live_compositor/ts/@live-compositor/browser-render/dist/index.js:385:26) at Renderer.render (http://localhost:5173/@fs/live_compositor/ts/@live-compositor/browser-render/dist/index.js:2016:38)

noituri commented 6 hours ago

The issue was caused by wasm-bindgen 0.2.95 which is required by wgpu 23.0.0. It was temporarily fixed in https://github.com/software-mansion/live-compositor/pull/882 by downgrading wgpu and wasm-bindgen