Using malloc/free for the http fields hash.
This is required due to lack of a graceful shutdown: there is a small gap between the runtime's memory pool release and router process's exit. Thus, a worker thread may start processing a request between these two operations, which may result in an http fields hash access and subsequent crash. To simplify issue reproduction, it makes sense to add a 2 sec sleep before exit() in nxt_runtime_exit().
This commit is contained in:
@@ -303,7 +303,7 @@ nxt_router_start(nxt_task_t *task, void *data)
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = nxt_http_init(task, rt);
|
||||
ret = nxt_http_init(task);
|
||||
if (nxt_slow_path(ret != NXT_OK)) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user