lua-nginx-module
lua-nginx-module copied to clipboard
bugfix: lua panic handling in ngx.socket.tcp
If luaL_pushresult() encounters a buffer larger than 2GB, it triggers a Lua panic. This panic is handled by ngx_http_lua_atpanic(), which performs a longjmp() back to the last setjmp() call point (e.g., ngx_http_lua_log_by_chunk()), potentially causing a SEGFAULT or ABORT signal if stack protection is enabled.
The fix sets the handler that manages Lua panics directly within ngx_http_lua_socket_push_input_data().
I hereby granted the copyright of the changes in this pull request to the authors of this lua-nginx-module project.