From db42527b1b2656141af0d8280e59e23be6af67d6 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 7 Dec 2020 17:56:18 +0300 Subject: Node.js: avoided use of request struct for debug logging. This fixes a crash on exit of Node.js application. The crash reproduced on Ubuntu 20.10 with Node.js v15.1.0. Tests 'test_node_websockets_two_clients' and 'test_node_websockets_7_13_1__7_13_2'. The reason of the crash is using request struct which was already freed. The issue was introduced in 5be509fda29e. --- src/nodejs/unit-http/unit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nodejs') diff --git a/src/nodejs/unit-http/unit.cpp b/src/nodejs/unit-http/unit.cpp index b166707e..0e049865 100644 --- a/src/nodejs/unit-http/unit.cpp +++ b/src/nodejs/unit-http/unit.cpp @@ -1000,19 +1000,19 @@ Unit::websocket_set_sock(napi_env env, napi_callback_info info) void Unit::conn_destroy(napi_env env, void *r, void *finalize_hint) { - nxt_unit_req_debug((nxt_unit_request_info_t *) r, "conn_destroy: %p", r); + nxt_unit_req_debug(NULL, "conn_destroy: %p", r); } void Unit::sock_destroy(napi_env env, void *r, void *finalize_hint) { - nxt_unit_req_debug((nxt_unit_request_info_t *) r, "sock_destroy: %p", r); + nxt_unit_req_debug(NULL, "sock_destroy: %p", r); } void Unit::resp_destroy(napi_env env, void *r, void *finalize_hint) { - nxt_unit_req_debug((nxt_unit_request_info_t *) r, "resp_destroy: %p", r); + nxt_unit_req_debug(NULL, "resp_destroy: %p", r); } -- cgit