Bug 122907 - Web Inspector: Infinite loop when inspecting codepen.io websites
Summary: Web Inspector: Infinite loop when inspecting codepen.io websites
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-10-16 10:47 PDT by Alexandru Chiculita
Modified: 2014-02-28 13:16 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandru Chiculita 2013-10-16 10:47:51 PDT
1. Open http://codepen.io/RachelSeale/pen/wBqyu
2. Right click and start the inspector
3. Make sure the DOM tree is selected
4. Hide the Styles panel
5. Close the Inspector
6. Start the inspector again and go to the DOM tree.

Result: Infinite loop in the WebInspector window and process goes up to 100% CPU usage.

There's a for (;;) loop in scrollCursorIntoView and it never gets out of it. Note that the line numbers in codemirror.js might be skewed as I needed to add some instrumentation to catch this.

scrollCursorIntoView@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/External/CodeMirror/codemirror.js:2634:35
endOperation@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/External/CodeMirror/codemirror.js:1389:27
runInOp@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/External/CodeMirror/codemirror.js:1436:39
operation@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/External/CodeMirror/codemirror.js:3214:42
_resetContent@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/CSSStyleDeclarationTextEditor.js:991:35
style@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/CSSStyleDeclarationTextEditor.js:127:27
refresh@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/ComputedStyleDetailsPanel.js:64:35
_refreshPreservingScrollPosition@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/StyleDetailsPanel.js:142:21
_nodeStylesRefreshed@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/StyleDetailsPanel.js:153:50
dispatch@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/Object.js:180:55
dispatchEventToListeners@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/Object.js:187:17
fetchedComputedStyle@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/DOMNodeStyles.js:243:42
fetchedComputedStyle@[native code]
dispatch@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/InspectorBackend.js:220:31
dispatchNextQueuedMessageFromBackend@file:///Users/achicu/code/webkit/WebKitBuild/named_flows/Release/WebInspectorUI.framework/Resources/Main.js:319:34
[native code]
Comment 1 Radar WebKit Bug Importer 2013-10-16 10:48:30 PDT
<rdar://problem/15242526>
Comment 2 Joseph Pecoraro 2013-10-16 11:05:22 PDT
Good find! Some people have been mentioning inspector hangs that I haven't been able to reproduce. For starters we can try to make a CodeMirror reduction and file a CodeMirror issue, and if needed create a fix ourselves.
Comment 3 Timothy Hatcher 2014-02-28 13:13:43 PST
The for (;;) is now in scrollPosIntoView, which scrollCursorIntoView calls.
Comment 4 Timothy Hatcher 2014-02-28 13:16:38 PST
Those step no longer reproduce a hang. Perhaps our updated CodeMirror fixed it?