WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
107425
Web Inspector: heap profiler shows nodes with distance 0
https://bugs.webkit.org/show_bug.cgi?id=107425
Summary
Web Inspector: heap profiler shows nodes with distance 0
Yury Semikhatsky
Reported
2013-01-21 00:17:11 PST
In some cases we see nodes with distance 0 retaining nodes with distance e.g. 7 All retainers of nodes with distance N should have distance >=N-1.
Attachments
Patch
(5.73 KB, patch)
2013-01-23 06:25 PST
,
Yury Semikhatsky
no flags
Details
Formatted Diff
Diff
Patch
(5.60 KB, patch)
2013-01-23 06:56 PST
,
Yury Semikhatsky
pfeldman
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Yury Semikhatsky
Comment 1
2013-01-22 23:43:36 PST
It was likely broken in
https://bugs.webkit.org/show_bug.cgi?id=100140
where v8::V8::SetGlobalGCPrologueCallback(&V8GCController::gcPrologue) call was replaced with v8::V8::AddGCPrologueCallback(&V8GCController::gcPrologue). Now heap profiler is not aware of the implicit references between DOM node wrappers and event listener functions. Such functions end up as having only weak handle to them and break heap profiler which doesn't expect any alive objects without strong references. The functions appear as having no retainers.
Yury Semikhatsky
Comment 2
2013-01-23 01:51:06 PST
Patch sent to v8:
https://codereview.chromium.org/11953043/
Yury Semikhatsky
Comment 3
2013-01-23 06:25:07 PST
Created
attachment 184217
[details]
Patch
Ilya Tikhonovsky
Comment 4
2013-01-23 06:41:26 PST
Comment on
attachment 184217
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=184217&action=review
> Source/WebCore/inspector/front-end/JSHeapSnapshot.js:240 > + var edgeType = containmentEdges[edgeIndex + edgeTypeOffset]; > + var nodeOrdinal; > + if (edgeType === edgeShortcutType) > + nodeOrdinal = containmentEdges[edgeIndex + edgeToNodeOffset] / nodeFieldCount; > + else if (edgeType === edgeElementType) { > + node.nodeIndex = containmentEdges[edgeIndex + edgeToNodeOffset]; > + if (node.isDocumentDOMTreesRoot()) > + nodeOrdinal = node.nodeIndex / nodeFieldCount; > + else > + continue; > + } else > + continue; > + nodesToVisit[nodesToVisitLength++] = nodeOrdinal; > + flags[nodeOrdinal] |= visitedMarker;
I'd invert the conditions: var edgeType = containmentEdges[edgeIndex + edgeTypeOffset]; var nodeIndex = containmentEdges[edgeIndex + edgeToNodeOffset]; if (edgeType === edgeElementType) { if (!node.isDocumentDOMTreesRoot()) continue; } else if (edgeType !== edgeShortcutType) continue; var nodeOrdinal = nodeIndex / nodeFieldCount; nodesToVisit[nodesToVisitLength++] = nodeOrdinal; flags[nodeOrdinal] |= visitedMarker;
Alexei Filippov
Comment 5
2013-01-23 06:46:33 PST
Comment on
attachment 184217
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=184217&action=review
> Source/WebCore/inspector/front-end/HeapSnapshot.js:781 > + distanceForUserRoot: function(node)
How about initialDistance?
Yury Semikhatsky
Comment 6
2013-01-23 06:56:01 PST
Created
attachment 184224
[details]
Patch
Yury Semikhatsky
Comment 7
2013-01-23 06:57:10 PST
Comment on
attachment 184217
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=184217&action=review
>> Source/WebCore/inspector/front-end/HeapSnapshot.js:781 >> + distanceForUserRoot: function(node) > > How about initialDistance?
I'd like the method name to reflect that is supposed to be called only on potential user roots. If node is not a user root it should return -1.
>> Source/WebCore/inspector/front-end/JSHeapSnapshot.js:240 >> + flags[nodeOrdinal] |= visitedMarker; > > I'd invert the conditions: > > var edgeType = containmentEdges[edgeIndex + edgeTypeOffset]; > var nodeIndex = containmentEdges[edgeIndex + edgeToNodeOffset]; > if (edgeType === edgeElementType) { > if (!node.isDocumentDOMTreesRoot()) > continue; > } else if (edgeType !== edgeShortcutType) > continue; > var nodeOrdinal = nodeIndex / nodeFieldCount; > nodesToVisit[nodesToVisitLength++] = nodeOrdinal; > flags[nodeOrdinal] |= visitedMarker;
done.
Yury Semikhatsky
Comment 8
2013-01-23 07:03:33 PST
Committed
r140535
: <
http://trac.webkit.org/changeset/140535
>
Yury Semikhatsky
Comment 9
2013-01-24 01:09:27 PST
V8 fix was committed
https://code.google.com/p/v8/source/detail?r=13486
, we should wait until it is rolled to Chromium and see if the problems disappears.
Brian Burg
Comment 10
2014-12-12 13:29:17 PST
Closing as invalid, as this bug pertains to the old inspector UI and/or its tests. Please file a new bug (
https://www.webkit.org/new-inspector-bug
) if the bug/feature/issue is still relevant to WebKit trunk.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug