How can you allocate big chunks using FixedBufferAllocator?

Because of the stack overflow, the code is jumping to garbage, triggering the illegal instruction. You can increase the stack size with Build.Step.Compile.stack_size.
Whether you will crash or not is not directly related to the size of the buffer. If you allocate a huge buffer but never write beyond the stack limit, you won’t crash. Therefore, if you called this code with less data or if the stack size was bigger, you might not get a crash. Note that the default stack size on Linux is 10x bigger than Windows, so this could explain why it didn’t crash before.

2 Likes