diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-07-31 02:32:33 +0200 |
---|---|---|
committer | Andrey Pechkurov <apechkurov@gmail.com> | 2020-08-03 10:27:15 +0300 |
commit | 2ba93e1db4992e73af42c47b445a54c2a767bd6e (patch) | |
tree | 6dca28679742685200c6ed74f365fe5f008ce563 /lib/internal/async_hooks.js | |
parent | a9c5b873ca47555aeaaaffa9c7374358f33cc28e (diff) | |
download | node-new-2ba93e1db4992e73af42c47b445a54c2a767bd6e.tar.gz |
async_hooks: fix resource stack for deep stacks
460c81dc0e0 introduced a bug where the execution resource was not
stored properly if we needed to call into C++ to extend the stack size.
Fix that bug by always storing the resource.
Refs: https://github.com/nodejs/node/pull/34319
Fixes: https://github.com/nodejs/node/issues/34556
PR-URL: https://github.com/nodejs/node/pull/34573
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'lib/internal/async_hooks.js')
-rw-r--r-- | lib/internal/async_hooks.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index f4d4f1da49..9463d1d334 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -499,11 +499,11 @@ function hasAsyncIdStack() { // This is the equivalent of the native push_async_ids() call. function pushAsyncContext(asyncId, triggerAsyncId, resource) { const offset = async_hook_fields[kStackLength]; + execution_async_resources[offset] = resource; if (offset * 2 >= async_wrap.async_ids_stack.length) return pushAsyncContext_(asyncId, triggerAsyncId); async_wrap.async_ids_stack[offset * 2] = async_id_fields[kExecutionAsyncId]; async_wrap.async_ids_stack[offset * 2 + 1] = async_id_fields[kTriggerAsyncId]; - execution_async_resources[offset] = resource; async_hook_fields[kStackLength]++; async_id_fields[kExecutionAsyncId] = asyncId; async_id_fields[kTriggerAsyncId] = triggerAsyncId; |