From 51120e06e32502c75010644d8b63086221ea78f9 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 3 Feb 2020 11:14:06 +0300 Subject: Added missing stream argument to error message. Found by Coverity (CID 353386). --- src/nxt_unit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nxt_unit.c') diff --git a/src/nxt_unit.c b/src/nxt_unit.c index 95874db3..27dc4751 100644 --- a/src/nxt_unit.c +++ b/src/nxt_unit.c @@ -871,7 +871,8 @@ nxt_unit_process_new_port(nxt_unit_ctx_t *ctx, nxt_unit_recv_msg_t *recv_msg) if (nxt_slow_path(ioctl(recv_msg->fd, FIONBIO, &nb) == -1)) { nxt_unit_alert(ctx, "#%"PRIu32": new_port: ioctl(%d, FIONBIO, 0) " - "failed: %s (%d)", recv_msg->fd, strerror(errno), errno); + "failed: %s (%d)", + recv_msg->stream, recv_msg->fd, strerror(errno), errno); return NXT_UNIT_ERROR; } -- cgit From 8eba2e5c3d8537521d3e010025e6078bc1fd28d6 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 3 Feb 2020 11:21:21 +0300 Subject: 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(+) (limited to 'src/nxt_unit.c') 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, -- cgit From 7c38650cd12b9d5b14aec5d416fa3b57918cee50 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Tue, 4 Feb 2020 11:39:16 +0300 Subject: Removing duplicate macro definitions. This issue was introduced in 2c7f79bf0a1f. --- src/nxt_unit.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/nxt_unit.c') diff --git a/src/nxt_unit.c b/src/nxt_unit.c index ab622e56..7c3d945c 100644 --- a/src/nxt_unit.c +++ b/src/nxt_unit.c @@ -19,10 +19,6 @@ #include #endif -#define NXT_UNIT_MAX_PLAIN_SIZE 1024 -#define NXT_UNIT_LOCAL_BUF_SIZE \ - (NXT_UNIT_MAX_PLAIN_SIZE + sizeof(nxt_port_msg_t)) - #define NXT_UNIT_MAX_PLAIN_SIZE 1024 #define NXT_UNIT_LOCAL_BUF_SIZE \ (NXT_UNIT_MAX_PLAIN_SIZE + sizeof(nxt_port_msg_t)) -- cgit