New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 600334 link

Starred by 7 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

Dev tools hangs with 100% CPU usage after changing DOM

Reported by mans...@oxplot.com, Apr 4 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36

Steps to reproduce the problem:
1. Open kill-dev-tools.html in the attachment.
2. Bring up dev tools (ie press F12).
3. In the Elements tab, double click on the content of the <p> element and move the caret to the left of the first character and press Backspace to remove the leading space.
4. Press Enter to make the change.
5. Attempt to interact with the Dev tools.

What is the expected behavior?
Dev tools should work as normal.

What went wrong?
Dev tools becomes unresponsive and consumes 100% of one CPU core (see the screenshot attached).

Did this work before? N/A 

Chrome version: 49.0.2623.110  Channel: stable
OS Version: 
Flash Version:
 
kill-dev-tools-screenshot.png
26.0 KB View Download

Comment 1 by mans...@oxplot.com, Apr 4 2016

Forgot to attach the test file. Here it is.
kill-dev-tools.html
123 bytes View Download
Owner: lushnikov@chromium.org
Status: Assigned (was: Unconfirmed)
Andrey, please take a look.
Labels: Needs-Feedback
Hmm, failed to reproduce this. Could you please capture a video/screencast?

Comment 4 by mans...@oxplot.com, Apr 5 2016

OK, tried again and it's not clear to me what exactly trips it. I captured a screencast. These are the order of the keys just before the freeze:

1. Moved the caret before the first character.
2. Pressed backspace *twice*.
3. Pressed Down, Up, Left.

Sometimes just moving around the first few characters does the trick, not necessarily in the order above.
kill-dev-tools.mkv
199 KB Download
Cc: lushnikov@chromium.org
Components: -Platform>DevTools Blink>Editing
Owner: yosin@chromium.org
Thanks to the video, I managed to repro this.

@yosin, could you please take a look?

This stucks in an infinite loop inside blink. I've captured to stack traces with gdb:

#0  0x00007f53a5a96bbb in blink::InlineBox::nextLeafChild() const ()
#1  0x00007f53a5779551 in blink::InlineBoxPosition blink::computeInlineBoxPositionTemplate<blink::EditingAlgorithm<blink::NodeTraversal> >(blink::PositionTemplate<blink::EditingAlgorithm<blink::NodeTraversal> > const&, blink::TextAffinity, blink::TextDire
ction) ()
#2  0x00007f53a577e090 in blink::rightPositionOf(blink::VisiblePositionTemplate<blink::EditingAlgorithm<blink::NodeTraversal> > const&) ()
#3  0x00007f53a576b036 in blink::SelectionEditor::modifyMovingRight(blink::TextGranularity) ()
#4  0x00007f53a576c10c in blink::SelectionEditor::modify(blink::FrameSelection::EAlteration, blink::SelectionDirection, blink::TextGranularity, blink::EUserTriggered) ()
#5  0x00007f53a575ded3 in blink::FrameSelection::modify(blink::FrameSelection::EAlteration, blink::SelectionDirection, blink::TextGranularity, blink::EUserTriggered) ()
#6  0x00007f53a576beb5 in blink::SelectionEditor::modify(blink::FrameSelection::EAlteration, blink::SelectionDirection, blink::TextGranularity, blink::EUserTriggered) ()
#7  0x00007f53a575ded3 in blink::FrameSelection::modify(blink::FrameSelection::EAlteration, blink::SelectionDirection, blink::TextGranularity, blink::EUserTriggered) ()
#8  0x00007f53a57956ff in blink::Editor::Command::execute(WTF::String const&, blink::Event*) const ()
#9  0x00007f53a57957f2 in blink::Editor::executeCommand(WTF::String const&, WTF::String const&) ()
#10 0x00007f53a51f83f2 in blink::WebLocalFrameImpl::executeCommand(blink::WebString const&, blink::WebString const&, blink::WebNode const&) ()
#11 0x00007f53a6ea4016 in content::RenderViewImpl::handleCurrentKeyboardEvent() ()
#12 0x00007f53a51b5577 in blink::EditorClientImpl::handleKeyboardEvent() ()
#13 0x00007f53a575b538 in blink::Editor::handleKeyboardEvent(blink::KeyboardEvent*) ()
#14 0x00007f53a54eac5d in blink::EventHandler::defaultKeyboardEventHandler(blink::KeyboardEvent*) ()
#15 0x00007f53a54ceac9 in blink::EventDispatcher::dispatchEventPostProcess(void*) ()
#16 0x00007f53a54ce76e in blink::EventDispatcher::dispatch() ()
#17 0x00007f53a54ce041 in blink::EventDispatcher::dispatchEvent(blink::Node&, blink::EventDispatchMediator*) ()
#18 0x00007f53a54ea9e1 in blink::EventHandler::keyEvent(blink::PlatformKeyboardEvent const&) ()
#19 0x00007f53a5215b86 in blink::WebViewImpl::handleKeyEvent(blink::WebKeyboardEvent const&) ()
#20 0x00007f53a5214dcf in blink::WebViewImpl::handleInputEvent(blink::WebInputEvent const&) ()



and the next one:


#0  0x00007f53a577df69 in blink::rightPositionOf(blink::VisiblePositionTemplate<blink::EditingAlgorithm<blink::NodeTraversal> > const&) ()
#1  0x00007f53a576b036 in blink::SelectionEditor::modifyMovingRight(blink::TextGranularity) ()
#2  0x00007f53a576c10c in blink::SelectionEditor::modify(blink::FrameSelection::EAlteration, blink::SelectionDirection, blink::TextGranularity, blink::EUserTriggered) ()
#3  0x00007f53a575ded3 in blink::FrameSelection::modify(blink::FrameSelection::EAlteration, blink::SelectionDirection, blink::TextGranularity, blink::EUserTriggered) ()
#4  0x00007f53a576beb5 in blink::SelectionEditor::modify(blink::FrameSelection::EAlteration, blink::SelectionDirection, blink::TextGranularity, blink::EUserTriggered) ()
#5  0x00007f53a575ded3 in blink::FrameSelection::modify(blink::FrameSelection::EAlteration, blink::SelectionDirection, blink::TextGranularity, blink::EUserTriggered) ()
#6  0x00007f53a57956ff in blink::Editor::Command::execute(WTF::String const&, blink::Event*) const ()
#7  0x00007f53a57957f2 in blink::Editor::executeCommand(WTF::String const&, WTF::String const&) ()
#8  0x00007f53a51f83f2 in blink::WebLocalFrameImpl::executeCommand(blink::WebString const&, blink::WebString const&, blink::WebNode const&) ()
#9  0x00007f53a6ea4016 in content::RenderViewImpl::handleCurrentKeyboardEvent() ()
#10 0x00007f53a51b5577 in blink::EditorClientImpl::handleKeyboardEvent() ()
#11 0x00007f53a575b538 in blink::Editor::handleKeyboardEvent(blink::KeyboardEvent*) ()
#12 0x00007f53a54eac5d in blink::EventHandler::defaultKeyboardEventHandler(blink::KeyboardEvent*) ()
#13 0x00007f53a54ceac9 in blink::EventDispatcher::dispatchEventPostProcess(void*) ()
#14 0x00007f53a54ce76e in blink::EventDispatcher::dispatch() ()
#15 0x00007f53a54ce041 in blink::EventDispatcher::dispatchEvent(blink::Node&, blink::EventDispatchMediator*) ()
#16 0x00007f53a54ea9e1 in blink::EventHandler::keyEvent(blink::PlatformKeyboardEvent const&) ()
#17 0x00007f53a5215b86 in blink::WebViewImpl::handleKeyEvent(blink::WebKeyboardEvent const&) ()
#18 0x00007f53a5214dcf in blink::WebViewImpl::handleInputEvent(blink::WebInputEvent const&) ()

Comment 6 by mans...@oxplot.com, Jul 9 2016

This is still an issue with current stable release and I hit it multiple times a week.
Easy repro steps:

1. navigate to the following URL:
data:text/html,<p>test test test test test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test testtest test test</p>

2. open devtools
3. open elements panel, expand "P" tag
4. double-click the text inside "P". The input field should appear with text highlighted
5. press "left" arrow key to move cursor to the beginning of the text.

 Issue 610175  has been merged into this issue.

Comment 9 Deleted

Comment 10 Deleted

On #c7 case, I can't move caret to beginning of text by ArrowLeft, caret stops second character.
Note: If P contains text fit in one line, it doesn't happen.
ArrowRight can cause infinite loop, it stuck on double-quote character.
From "kill-dev-tools.html", computeInlineBoxPosition(Position("In dev tool...", 0)) returns inline box position for double quote before "In dev tool...".
Since bidi-level of "In dev tool ..." is 2 and double quote is 0.
Labels: -Needs-Feedback
Bidi level 2 comes from following rule:
text-node { unicode-bidi: -webkit-isolate; }
Status: Started (was: Assigned)
In review: http://crrev.com/2220923002
This patch fixes an issue of computeInlineBox(), but not fix ArrowLeft key issue.
Even if this patch, ArrowLeft key doesn't locate caret at start of text of unicode-bidi:isolate.
Project Member

Comment 15 by bugdroid1@chromium.org, Aug 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ec6d070e13bb453972f0c385e090df9e2e5f9478

commit ec6d070e13bb453972f0c385e090df9e2e5f9478
Author: yosin <yosin@chromium.org>
Date: Mon Aug 08 10:34:38 2016

Make computeInlineBoxPosition() to handle unicode-bidi:isolate correctly

This patch makes |computeInlineBoxPosition()| to handle "unicode-bidi:isolate"
correctly for position at start of text by checking text direction and
bidi embedding level rather than only checking bidi embedding level.

BUG= 600334 
TEST=run-webkit-unit-tests --gtest_filter=VisibleUnitsTest.computeInlineBoxPositionBidiIsolate

Review-Url: https://codereview.chromium.org/2220923002
Cr-Commit-Position: refs/heads/master@{#410325}

[modify] https://crrev.com/ec6d070e13bb453972f0c385e090df9e2e5f9478/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
[modify] https://crrev.com/ec6d070e13bb453972f0c385e090df9e2e5f9478/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp

Cc: kojii@chromium.org sergeyv@chromium.org
 Issue 632137  has been merged into this issue.
Issue 636665 has been merged into this issue.

Comment 18 by yosin@chromium.org, Aug 23 2016

Status: Fixed (was: Started)
Fixed for infinite loop.
I file issue 640130 for ArrowLeft key issue.

Sign in to add a comment