Commit a1d7ed7
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: #22523
PR-URL: #24123
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>1 parent abe3eda commit a1d7ed7Copy full SHA for a1d7ed7
File tree
Expand file treeCollapse file tree
2 files changed
+12
-4
lines changedOpen diff view settings
Filter options
- src/tracing
- test/parallel
Expand file treeCollapse file tree
2 files changed
+12
-4
lines changedOpen diff view settings
Collapse file
src/tracing/node_trace_writer.h
Copy file name to clipboardExpand all lines: src/tracing/node_trace_writer.h+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
61 | 61 | |
62 | 62 | |
63 | 63 | |
64 | | - |
| 64 | + |
65 | 65 | |
66 | 66 | |
67 | 67 | |
|
Collapse file
test/parallel/test-tracing-no-crash.js
Copy file name to clipboardExpand all lines: test/parallel/test-tracing-no-crash.js+11-3Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
8 | 8 | |
9 | 9 | |
10 | 10 | |
11 | | - |
12 | | - |
13 | | - |
| 11 | + |
| 12 | + |
| 13 | + |
14 | 14 | |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
0 commit comments