Unverified Commit 71a4cb7d authored by Anna Henningsen's avatar Anna Henningsen
Browse files

tracing: fix static destruction order issue

Sometimes, the `parallel/test-tracing-no-crash` would not work as
expected, at least on Windows, because there is a static destruction
race between tearing down the `NodeTraceWriter` instance and the
per-process options struct. If the per-process options were destroyed
before the `NodeTraceWriter`, the reference to the tracing filename
would be gone before opening the file was attempted.

This can be solved by creating a copy of the string when creating the
`NodeTraceWriter` instance rather than taking a reference.

Fixes: https://github.com/nodejs/node/issues/22523

PR-URL: https://github.com/nodejs/node/pull/24123


Reviewed-By: default avatarRefael Ackermann <refack@gmail.com>
Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
Reviewed-By: default avatarRichard Lau <riclau@uk.ibm.com>
Reviewed-By: default avatarJoyee Cheung <joyeec9h3@gmail.com>
parent f8c3e258
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment