You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2018/07/24 19:13:25 [alert] 7573#7573: worker process 7574 exited on signal 11 (core dumped)
After analysis, I found the reason finally. This problem occurs when client performed the SSL renegotiation and the current connection is already upgraded to HTTP/2, furthermore, current connection should reuse a TLS session.
When TLS renegotiation happens, the ngx_http_lua_ssl_cert_handler will be called.
Since current connection reused a TLS session, so the cctx inside this function is still NULL, the following if block will not be executed:
if (cctx&&cctx->entered_cert_handler) {
/* not the first time */if (cctx->done) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
"lua_certificate_by_lua: cert cb exit code: %d",
cctx->exit_code);
dd("lua ssl cert done, finally");
returncctx->exit_code;
}
return-1;
}
Then c->data will be treated as the ngx_http_connection_t, we know when the functionngx_http_v2_init called, the c->data will be set to ngx_http_v2_connection_t (rather than the original ngx_http_connection_t). While ngx_http_lua_ssl_cert_handler doesn't distinguish this situation. It just uses the "ngx_http_v2_connection_t" as "ngx_http_connection_t", and some invalid address will be referenced.
The text was updated successfully, but these errors were encountered:
Hello!
Recently I found one of our Nginx worker process exited abnormally (segmentation fault). The backtrace is like:
The coredump point is inside function
ngx_http_lua_ssl_cert_handler
.You can reproduce this problem by the following way.
Then type "R" in the interactive mode (trigger the TLS reneogatitaion).
Now open Nginx's error log and we can see:
After analysis, I found the reason finally. This problem occurs when client performed the SSL renegotiation and the current connection is already upgraded to HTTP/2, furthermore, current connection should reuse a TLS session.
When TLS renegotiation happens, the
ngx_http_lua_ssl_cert_handler
will be called.Since current connection reused a TLS session, so the
cctx
inside this function is stillNULL
, the following if block will not be executed:Then
c->data
will be treated as thengx_http_connection_t
, we know when the functionngx_http_v2_init
called, thec->data
will be set tongx_http_v2_connection_t
(rather than the originalngx_http_connection_t
). Whilengx_http_lua_ssl_cert_handler
doesn't distinguish this situation. It just uses the"ngx_http_v2_connection_t"
as"ngx_http_connection_t"
, and some invalid address will be referenced.The text was updated successfully, but these errors were encountered: