From 97e61aad736da5fe1ad136a1d3055e16698f7d2b Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 1 Dec 2021 18:05:50 +0300 Subject: [PATCH] Fixing prototype process crash. A prototype stores linked application processes structures. When an application process terminates, it's removed from the list. To avoid double removal, the pointer to the next element should be set to NULL. The issue was introduced in c8790d2a89bb. --- docs/changes.xml | 7 +++++++ src/nxt_application.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/docs/changes.xml b/docs/changes.xml index ba86da5e..2bbec889 100644 --- a/docs/changes.xml +++ b/docs/changes.xml @@ -52,6 +52,13 @@ fastcgi_finish_request() was called in the OPcache preloading script. + + +a prototype process could crash on an application process exit; the bug had +appeared in 1.26.0. + + + diff --git a/src/nxt_application.c b/src/nxt_application.c index 589821fb..82385ec4 100644 --- a/src/nxt_application.c +++ b/src/nxt_application.c @@ -1147,6 +1147,8 @@ nxt_proto_process_remove(nxt_task_t *task, nxt_pid_t pid) process = lhq.value; nxt_queue_remove(&process->link); + process->link.next = NULL; + break; default: