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

Issue 658525 link

Starred by 14 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Console attempting to display large strings freezes

Reported by ree...@gmail.com, Oct 22 2016

Issue description

Chrome Version       : 54.0.2840.59 (Official Build) m (64-bit)
URLs (if applicable) : N/A
Other browsers tested:
         Internet Explorer 11: Pass

What steps will reproduce the problem?
1.) Go to a random web-page of your choice
2.) Open the console (Control+Shift+J)
3.) Paste the following

var really_long_string = (new Array(10*1024*1024)).join("x");
console.log(really_long_string);
console.log("Done!");

4.) Press Enter
5.) Wait 5 seconds
6.) Attempt to highlight the text


What is the expected result?
Either "Done" is displayed, the text is highlighted, or a timeout error is shown

What happens instead?
The console becomes unresponsive for an extended period of time with no hint of response
 

Comment 1 by woxxom@gmail.com, Oct 24 2016

Even with much smaller strings the console becomes REALLY unresponsive.

Javascript profiler shows 99% of time is spent in just one statement:

this.element.scrollTop = 10000000;

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/ui/ViewportControl.js

Comment 2 by woxxom@gmail.com, Oct 24 2016

re: #1, but even if I comment out that statement in resources.pak it doesn't solve the issue, it just shows 99% of time is spent in Program, that is the browser itself.

Comment 3 by ree...@gmail.com, Oct 24 2016

Works as well on Firefox 49.0.2

Note that both Firefox and IE trim the displayed result whilst Chrome attempts to display the entire result.
Components: Platform>DevTools
Labels: -Pri-3 M-56 OS-Linux OS-Mac OS-Windows Pri-2
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on MAC 10.11.6, Windows 10 and Ubuntu 14.04 using chrome reported version #54.0.2840.59 and latest canary #56.0.2901.0

Attaching a screen cast for reference

This is a non regression as it is observed from M35, M40, M45 and M50 old builds.

Hence, marking it as untriaged to get more inputs from dev team.

Thanks,
658525.mp4
5.5 MB View Download
Cc: lushnikov@chromium.org
Components: -Platform>DevTools Platform>DevTools>UX
Owner: l...@chromium.org
Status: Assigned (was: Untriaged)

Comment 6 by l...@chromium.org, Oct 28 2016

Thank you for the report.  Btw, you may already know this, but copying some value to your clipboard can be done with "copy(really_long_string)" which shouldn't be slow.

We need to do something better to clip super long text.  There's already a "const maxTextContentLength = 10000;" in our codebase that we could use.

Firefox handles this with a clickable "[...]" that expands the full text when needed.  It also shows an informative "The string you are trying to view is too long to be displayed", something we could warn as well.

Comment 7 by woxxom@gmail.com, Nov 2 2016

The issue manifests itself in devtools Application panel. The entire UI freezes trying to display very long strings in localStorage, sessionStorage - because it uses CSS ellipsis overflow instead of truncating internally and providing a ... expander button.

Comment 8 by woxxom@gmail.com, Feb 21 2017

As test case for #7 run the following code in the devtools console:

localStorage['!!!!!!!TEST!!!!!!!'] = Array(100000).fill(0).map((e,i) => String.fromCharCode(i)).join(''); console.log('value written');

Then reopen devtools and go to Application -> Local Storage -> current site's storage

EXPECTED: values displayed immediately
OBSERVED: devtools freezes for 10+ seconds, then displays the values

 Issue 701679  has been merged into this issue.

Comment 10 by l...@chromium.org, Mar 28 2017

Cc: kozyatinskiy@chromium.org l...@chromium.org ranjitkan@chromium.org tkonch...@chromium.org
 Issue 640799  has been merged into this issue.

Comment 11 by l...@chromium.org, Apr 5 2017

Cc: chowse@chromium.org pfeldman@chromium.org
Some screenshots of an ellipsis button proposal.  chowse@, pfeldman@, thoughts?
expandableContent2.png
123 KB View Download
expandableContent1.png
66.3 KB View Download

Comment 12 by l...@chromium.org, May 5 2017

Another proposal: text is 'Show all'
expandableContent0.png
70.9 KB View Download
showAllContent1.png
75.7 KB View Download
Project Member

Comment 13 by bugdroid1@chromium.org, Dec 5 2017

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

commit 75dc9ac62c29d37959df99c9d995b7447b323a31
Author: Erik Luo <luoe@chromium.org>
Date: Tue Dec 05 22:44:54 2017

DevTools: hide super long console text behind expandable button

Rendering console logs with lots of text can stall DevTools. In this CL,
very long text will get truncated. A 'Show N more' button reveals the
full text and a 'Copy' button copies the full text to clipboard.

Screenshot: https://imgur.com/a/0dHJI

Bug:  658525 
Change-Id: Ic27e4836b8aaf9069f7ff0643b39ded4a83ce91f
Reviewed-on: https://chromium-review.googlesource.com/597012
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521869}
[add] https://crrev.com/75dc9ac62c29d37959df99c9d995b7447b323a31/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-truncate-long-messages-expected.txt
[add] https://crrev.com/75dc9ac62c29d37959df99c9d995b7447b323a31/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-truncate-long-messages.js
[modify] https://crrev.com/75dc9ac62c29d37959df99c9d995b7447b323a31/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
[modify] https://crrev.com/75dc9ac62c29d37959df99c9d995b7447b323a31/third_party/WebKit/Source/devtools/front_end/console/consoleView.css

Comment 14 by l...@chromium.org, Dec 5 2017

Labels: -M-56 M-65
Status: Fixed (was: Assigned)
A fix is bound for M65 release.  There will be 'Show N more' and 'Copy' buttons for the cases when we aren't able to show long data without incurring a performance hit.

Comment 15 by l...@chromium.org, Dec 31 2017

Cc: sc00335...@techmahindra.com
 Issue 797918  has been merged into this issue.

Sign in to add a comment