Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 33106442561e29aec6760903d306bb78c3eee2fc
https://github.com/WebKit/WebKit/commit/33106442561e29aec6760903d306bb78c3eee2fc
Author: Patrick Angle <[email protected]>
Date: 2023-05-22 (Mon, 22 May 2023)
Changed paths:
M LayoutTests/inspector/debugger/async-stack-trace-truncate-expected.txt
M LayoutTests/inspector/debugger/async-stack-trace-truncate.html
M Source/JavaScriptCore/inspector/AsyncStackTrace.cpp
M Source/JavaScriptCore/inspector/ScriptCallStack.cpp
M Source/JavaScriptCore/inspector/ScriptCallStack.h
Log Message:
-----------
Web Inspector: Deeply nested async stack traces are not fully truncated
https://bugs.webkit.org/show_bug.cgi?id=254244
rdar://105900359
Reviewed by Yusuke Suzuki.
As of 252630@main, ScriptCallStack holds a reference to its parent
AsyncStackTrace to enable providing async stack
traces in places where previously the async context was being lost. However
when this was added, the truncation
functionality used to ensure that AsyncStackTrace did not create an infinitely
nested set of objects did not take the
new reference into account. In practice, we should break that relationship any
time we are removing the parent of the
AsyncStackTrace. This allows us to correctly release ownership of
AsyncStackTraces as we nest deeper, then preventing us
from recursing during their deconstruction later.
* LayoutTests/inspector/debugger/async-stack-trace-truncate-expected.txt:
* LayoutTests/inspector/debugger/async-stack-trace-truncate.html:
- Add test case that creates a nested set of AsyncStackTrace/ScriptCallStack
that will exceed the size of the stack if
not correctly truncated.
* Source/JavaScriptCore/inspector/AsyncStackTrace.cpp:
(Inspector::AsyncStackTrace::remove):
Remove the ScriptCallStack's parent at the same time we remove the
AsyncStackTrace's parent.
* Source/JavaScriptCore/inspector/ScriptCallStack.cpp:
(Inspector::ScriptCallStack::removeParentStackTrace):
* Source/JavaScriptCore/inspector/ScriptCallStack.h:
Originally-landed-as: 259548.467@safari-7615-branch (69eae63cd374).
rdar://105900359
Canonical link: https://commits.webkit.org/264354@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes