Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: lua panic handling in ngx.socket.tcp #2376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pracj3am
Copy link
Contributor

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.

@pracj3am pracj3am force-pushed the pracj3am/socket-tcp-panic branch 2 times, most recently from 1b1a7ff to 94801d8 Compare November 16, 2024 10:01
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().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant