mirror of
https://github.com/gohugoio/hugo.git
synced 2026-11-25 17:14:34 +01:00
The `avif.wasm` module was linked with wasm-ld's default 64 KiB stack, which is too small for libaom at the slower speeds (e.g. the CDEF search in `av1_cdef_mse_calc_block`). The guest overflowed its stack and trapped with `out of bounds memory access`. Link with a 1 MiB stack; peak usage measured at `encoderSpeed` 1 is between 96 and 128 KiB. Related fixes: * Surface a crashed WASM instance's error right away instead of a generic `timeout` after 30 seconds: the crash was only reported once all instances in the pool had exited. * Respect the global `timeout` config option for WASM calls (was hardcoded to 30 seconds) and improve the timeout error message. * Don't leave a partial or empty file in the file cache when `create` fails. A failed AVIF encode left an empty file in `resources/_gen` which was published as a valid image on the next build. * Fix the error message for `Process` (`failed to image`). * Close the AVIF dispatcher in `Dispatchers.Close`. Fixes #15522 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>