Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aa05c8b

Browse filesBrowse files
ofrobotstargos
authored andcommitted
trace_events: avoid flusing uninitialized traces
PR-URL: #22812 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
1 parent 967fbeb commit aa05c8b
Copy full SHA for aa05c8b

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Open diff view settings
Collapse file

‎src/tracing/node_trace_buffer.cc‎

Copy file name to clipboardExpand all lines: src/tracing/node_trace_buffer.cc
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ void InternalTraceBuffer::Flush(bool blocking) {
5959
for (size_t i = 0; i < total_chunks_; ++i) {
6060
auto& chunk = chunks_[i];
6161
for (size_t j = 0; j < chunk->size(); ++j) {
62-
agent_->AppendTraceEvent(chunk->GetEventAt(j));
62+
TraceObject* trace_event = chunk->GetEventAt(j);
63+
// Another thread may have added a trace that is yet to be
64+
// initialized. Skip such traces.
65+
// https://github.com/nodejs/node/issues/21038.
66+
if (trace_event->name()) {
67+
agent_->AppendTraceEvent(trace_event);
68+
}
6369
}
6470
}
6571
total_chunks_ = 0;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.