LUAL_BUFFERSIZE defines how much luaL_Buffer allocates from the stack. Apparently, 4-8K is too much for the kernel stack.