Open Querijn opened 1 year ago
I just ran into this as well. Allocating such a large buffer is a major stability concern - Windows executables normally have only one MB of stack available and this has an extremely high chance of causing a stack overflow.
This used to be a problem for me for mods: I can't control how the application uses its stack amount when I am not working in that application. At one point I modified the allocator to just be a regular one, and since no response came from this ticket, I assumed the project wasn't alive, and didn't bother reporting my other issues.
Alright, thank you, I didn't realize how troublesome this issue is at the time. I'll lower the stack allocation limit going forward.
and since no response came from this ticket, I assumed the project wasn't alive, and didn't bother reporting my other issues.
Understandable. I still try to maintain and develop libschrift, but I struggle to allocate much time to it these days.
A comment on the STACK_ALLOC
macro. It will always allocate stack space of thresh
, even if the needed amount is larger and the actual storage comes from the heap via calloc
. A better option may be to use alloca()
if it's ok to rely on its presence.
Hey there,
I've encountered a stack overflow crash in render_outline due to the fact that in my setup I cannot allocate 256KB onto the stack. STACK_ALLOC requires at least 256KB of memory (sizeof(Cell) 128 128) which is not available.
On my setup, I've lowered this number to 32 * 32 which fits fine.