]> git.kaiwu.me - njs.git/commit
Modules: release work started while logging unhandled rejections
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 11 Nov 2026 01:56:57 +0000 (17:56 -0800)
committerDmitry Volyntsev <xeioexception@gmail.com>
Thu, 12 Nov 2026 22:29:31 +0000 (14:29 -0800)
commit0cb35d2adf68052f3179ef86cefe98be71e4201b
tree6e881b2da4c78fe2479336aeecd1724343e00f17
parent76bf6406543d451bb86f1aeede23f74d671ce9be
Modules: release work started while logging unhandled rejections

Context teardown cleared pending events before logging an unhandled
rejection.  Converting the rejection reason to a string runs user code,
which could start a timer or a fetch() after the cleanup.  The timer or
connection then outlived the request pool, resulting in use-after-free
with both engines.

Log unhandled rejections before clearing events.
nginx/ngx_js.c
nginx/t/js_teardown.t [new file with mode: 0644]