From 8eba2e5c3d8537521d3e010025e6078bc1fd28d6 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 3 Feb 2020 11:21:21 +0300 Subject: [PATCH] Initializing local buffer ctx_impl field for correct release. Uninitialized ctx_impl field may cause crash in application process. To reproduce the issue, need to trigger shared memory buffer send error on application side. In our case, send error caused by router process crash. This issue was introduced in 2c7f79bf0a1f. --- src/nxt_unit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nxt_unit.c b/src/nxt_unit.c index 27dc4751..ab622e56 100644 --- a/src/nxt_unit.c +++ b/src/nxt_unit.c @@ -3207,6 +3207,7 @@ nxt_unit_get_outgoing_buf(nxt_unit_ctx_t *ctx, nxt_unit_process_t *process, mmap_buf->port_id = *port_id; mmap_buf->process = process; mmap_buf->free_ptr = NULL; + mmap_buf->ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); nxt_unit_debug(ctx, "outgoing mmap allocation: (%d,%d,%d)", (int) hdr->id, (int) c,