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 a534175

Browse filesBrowse files
santigimenodanielleadams
authored andcommitted
http2: fix crash on Http2Stream::diagnostic_name()
It can happen that the Http2Stream::session_ has already been deleted when the Http2Stream destructor is called, causing `diagnostic_name()` to crash. Observed when running some http2 tests on Windows with the debug logs activated. PR-URL: #45123 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 0cbd2c6 commit a534175
Copy full SHA for a534175

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Collapse file

‎src/node_http2.cc‎

Copy file name to clipboardExpand all lines: src/node_http2.cc
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,9 +2060,12 @@ void Http2Stream::MemoryInfo(MemoryTracker* tracker) const {
20602060
}
20612061

20622062
std::string Http2Stream::diagnostic_name() const {
2063+
const Http2Session* sess = session();
2064+
const std::string sname =
2065+
sess ? sess->diagnostic_name() : "session already destroyed";
20632066
return "HttpStream " + std::to_string(id()) + " (" +
2064-
std::to_string(static_cast<int64_t>(get_async_id())) + ") [" +
2065-
session()->diagnostic_name() + "]";
2067+
std::to_string(static_cast<int64_t>(get_async_id())) + ") [" + sname +
2068+
"]";
20662069
}
20672070

20682071
// Notify the Http2Stream that a new block of HEADERS is being processed.

0 commit comments

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