Closed Bug 859170 Opened 11 years ago Closed 11 years ago

Trying to select [...] for a very long message printed to the web console will hang Firefox

Categories

(DevTools :: Console, defect)

defect
Not set
critical

Tracking

(firefox21 affected, firefox22 affected, firefox23 fixed)

RESOLVED FIXED
Firefox 23
Tracking Status
firefox21 --- affected
firefox22 --- affected
firefox23 --- fixed

People

(Reporter: jsmith, Assigned: msucan)

Details

(Keywords: hang, testcase)

Attachments

(2 files, 1 obsolete file)

Attached file Test Case
STR:

1. Load the attached test case
2. Open up the web console
3. Select [...]

Expected:

I'd expect a truncated string within a dialog to appear with some ... to indicate the string is too long to display.

Actual:

Firefox will get hung at this point.
Severity: normal → critical
Keywords: hang, testcase
Thanks for the bug report! Going to submit a patch ASAP.
Assignee: nobody → mihai.sucan
Attached patch proposed patch (obsolete) — Splinter Review
This is the proposed patch. The problem seems to be related to the veeery slow rendering of big text nodes. This is why the entire Firefox UI hangs.

The approach for this fix is to limit the text node length for strings coming from the LongStringActor. The constant I picked is based on my system: I picked a value that is rendered instantly. I did not limit the length of strings at the protocol level - if you think we should, please let me know.

The test uses the new waitForMessages() helper, with improvements. I expect I will continue to improve that, on a case-by-case basis (whenever I need it).

Try push: https://tbpl.mozilla.org/?tree=Try&rev=1dcaa73b3baa

Jason, Panos: do you believe we should make a patch for Aurora as well? This doesn't seem to be a hang that users would encounter often.

Thank you!
Attachment #735951 - Flags: review?(past)
Status: NEW → ASSIGNED
OS: Windows 7 → All
Comment on attachment 735951 [details] [diff] [review]
proposed patch

Review of attachment 735951 [details] [diff] [review]:
-----------------------------------------------------------------

(In reply to Mihai Sucan [:msucan] from comment #2)
> Jason, Panos: do you believe we should make a patch for Aurora as well? This
> doesn't seem to be a hang that users would encounter often.

I don't see how we could make a useful fix without a new warning message and Aurora is string-frozen.
Attachment #735951 - Flags: review?(past) → review+
Attached patch test fixesSplinter Review
Previous try push failed. 500000 chars in a text node is too much for debug builds on the try servers - had failures.

Lowered to 200000 chars and made other minor test changes and now I had a green try push:

https://tbpl.mozilla.org/?tree=Try&rev=1bd2a9d431d4

Thanks for the review. I intend to land this patch tomorrow, once bug 859858 reaches fx-team from inbound.
Attachment #735951 - Attachment is obsolete: true
(In reply to Panos Astithas [:past] from comment #3)
> Comment on attachment 735951 [details] [diff] [review]
> proposed patch
> 
> Review of attachment 735951 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> (In reply to Mihai Sucan [:msucan] from comment #2)
> > Jason, Panos: do you believe we should make a patch for Aurora as well? This
> > doesn't seem to be a hang that users would encounter often.
> 
> I don't see how we could make a useful fix without a new warning message and
> Aurora is string-frozen.

If a patch for aurora is needed we can simply limit how much we display from the long string (as we do now), and have no additional warning.
(In reply to Mihai Sucan [:msucan] from comment #5)
> If a patch for aurora is needed we can simply limit how much we display from
> the long string (as we do now), and have no additional warning.

I expect this to result in new bugs filed: "console doesn't display long strings correctly". IMHO behavior that could be interpreted to indicate data corruption should be avoided.
(In reply to Panos Astithas [:past] from comment #6)
> (In reply to Mihai Sucan [:msucan] from comment #5)
> > If a patch for aurora is needed we can simply limit how much we display from
> > the long string (as we do now), and have no additional warning.
> 
> I expect this to result in new bugs filed: "console doesn't display long
> strings correctly". IMHO behavior that could be interpreted to indicate data
> corruption should be avoided.

For Aurora and Beta one would prefer such data corruption over a complete browser freeze that, depending on the string length, can result in a forced kill, which in turn results in more data loss.
Landed in fx-team:

https://hg.mozilla.org/integration/fx-team/rev/501a15ed1e2b
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/501a15ed1e2b
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 23
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: