Increase the stack size to 128 KB#143
Conversation
It is 64 KB by default, but aom needs at least 64800 bytes for decoding frames (see the arrays allocated in "av1/common/restoration.c" with size RESTORATION_PROC_UNIT_PELS). We already allocate at least 200 MB for the memory, so using 128 KB for the stack sounds reasonable (it is 1 MB by default on some x86 OS for instance). Fix renpy/renpy#5871
|
This fixes the problem, but possibly but after changing the codec to |
|
I initially set the stack size to 1 MB and nothing broke, so at least there is no technical problem with increasing it to more than 128 KB if needed to switch to dav1d. As with aom, it is probably only needed for frames/images that use the SGRPROJ restoration filter. |
|
I've merged 128 for now. 1MB probably makes sense for the master branch, especially since there's only one thread on the web platform, so we don't have to worry about the stack size of it. (At least until threading on the web works.) |
Since we only have the one thread. Per discussion in #143.
|
I just bumped it up to 1024KB - there's no reason not to have it this big, as again, one thread. |
It is 64 KB by default, but aom needs at least 64800 bytes for decoding frames (see the arrays allocated in "av1/common/restoration.c" with size
RESTORATION_PROC_UNIT_PELS). IMHO, allocating 64 KB from the stack is criminal, but that's Google code, so I guess they know better...We already allocate at least 200 MB for the memory, so using 128 KB for the stack sounds reasonable (it is 1 MB by default on some x86 OS for instance).
The cause of the avif decode crash shows up when compiling the web version with
-sASSERTIONS=2(which I didn't use of course, because I love spending hours debugging wasm instructions🥴). Also, the "-fsanitize" build options that are supposed to debug memory problems don't work at all with Ren'Py.On a side note, upgrading libavif and aom to the latest version (v1.1.1 and v3.10.0 respectively) seems to work well with Ren'Py (but the
AVIF_CODEC_AOMcmake parameter for libavif needs to be set to "SYSTEM" instead of "1" now).Fix renpy/renpy#5871
(New PR against the fix branch this time)