Firefox and computer freeze with high CPU use when opening http://pythonfiddle.com/

VERIFIED FIXED in Firefox 27, Firefox OS v1.2

Status

()

VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: epinal99-bugzilla2, Assigned: jandem)

Tracking

({memory-footprint, power, regression})

26 Branch
mozilla29
x86_64
Windows 7
memory-footprint, power, regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox26 wontfix, firefox27+ verified, firefox28+ verified, firefox29+ verified, b2g-v1.2 fixed, b2g-v1.3 fixed)

Details

(Whiteboard: [MemShrink])

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
STR:
Open http://pythonfiddle.com/ and start to type something in the code textarea (or just wait for 10/15 sec).

Result: Both browser and computer freeze, high CPU use.

Regression range:
good=2013-09-03
bad=2013-09-04
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=d54e0cce6c17&tochange=e3785e299ab6
(Reporter)

Updated

5 years ago
status-firefox26: --- → affected
tracking-firefox27: --- → ?
tracking-firefox28: --- → ?
tracking-firefox29: --- → ?
Keywords: regression, regressionwindow-wanted

Comment 1

5 years ago
I think this is peek memory usage problem.

Regression range
Good Peek memory usage 400MB :
http://hg.mozilla.org/integration/mozilla-inbound/rev/f66ac3e480ca
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0 ID:20130902085957
Bad Peek memory usage 2400MB:
http://hg.mozilla.org/integration/mozilla-inbound/rev/abb25a18b5a5
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0 ID:20130902100557
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=f66ac3e480ca&tochange=abb25a18b5a5

Regressed by:
abb25a18b5a5	Brian Hackett — Bug 906788 - Construct TypeObject newScript information using MIR, r=jandem.
Blocks: 906788
Component: Untriaged → JavaScript Engine
Keywords: regressionwindow-wanted → footprint, power
Product: Firefox → Core

Updated

5 years ago
Component: JavaScript Engine → JavaScript Engine: JIT

Comment 2

5 years ago
Er
s/Peek/Peak/g

Comment 3

5 years ago
Reproduce with Firefox Nightly 29.0a1 (2014-01-11) on Ubuntu 12.04 (3.8.0-35-generic x86_64)

In terminal, i could see ###!!! [Child][MessageChannel] Error: Channel error: cannot send/recv
Whiteboard: [MemShrink]
Given :bhackett is on vacation, NI on :jandem to see if he can help here.
Flags: needinfo?(jdemooij)
tracking as this is a recent release regression.

Updated

5 years ago
status-firefox27: --- → affected
status-firefox28: --- → affected
tracking-firefox27: ? → +
tracking-firefox28: ? → +
tracking-firefox29: ? → +
(Assignee)

Comment 6

5 years ago
Created attachment 8359397 [details] [diff] [review]
Patch

We're running the TI new-script analysis on a huge script (bytecode length 548304 bytes)

This patch limits it to scripts <= 2000 bytes. I think the analysis is unlikely to be useful or worth it for scripts that are (much) larger than that, and because we run this analysis immediately (usecount == 0) compile time matters.
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Attachment #8359397 - Flags: review?(kvijayan)
Flags: needinfo?(jdemooij)
(Assignee)

Comment 7

5 years ago
Comment on attachment 8359397 [details] [diff] [review]
Patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Bug 906788.
User impact if declined: Memory peaks, OOM crashes.
Testing completed (on m-c, etc.): -
Risk to taking this patch (and alternatives if risky): Very low, it just adds a size limit.
String or IDL/UUID changes made by this patch: None.
Attachment #8359397 - Flags: approval-mozilla-beta?
Attachment #8359397 - Flags: approval-mozilla-aurora?
(Assignee)

Comment 8

5 years ago
Comment on attachment 8359397 [details] [diff] [review]
Patch

This could avoid b2g memory usage problems as well.
Attachment #8359397 - Flags: approval-mozilla-b2g26?
Comment on attachment 8359397 [details] [diff] [review]
Patch

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

::: js/src/jit/IonAnalysis.cpp
@@ +2149,5 @@
>  
>      if (!script->compileAndGo() || !script->canBaselineCompile())
>          return true;
>  
> +    if (script->length() > 2000)

Consider making this a proper named constant (#define), or an ion option.  We should be careful about littering tuning constants around the code.
Attachment #8359397 - Flags: review?(kvijayan) → review+
Waiting for inbound/central landing before approving on branches.
(Assignee)

Comment 11

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/689e99a56512

(In reply to Kannan Vijayan [:djvj] from comment #9)
> Consider making this a proper named constant (#define), or an ion option. 

I added a "static const uint32_t MAX_SCRIPT_SIZE".
status-b2g-v1.2: --- → affected
status-b2g-v1.3: --- → affected
status-firefox26: affected → wontfix
status-firefox29: --- → affected
https://hg.mozilla.org/mozilla-central/rev/689e99a56512
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
status-firefox29: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla29

Updated

5 years ago
Attachment #8359397 - Flags: approval-mozilla-beta?
Attachment #8359397 - Flags: approval-mozilla-beta+
Attachment #8359397 - Flags: approval-mozilla-b2g26?
Attachment #8359397 - Flags: approval-mozilla-b2g26+
Attachment #8359397 - Flags: approval-mozilla-aurora?
Attachment #8359397 - Flags: approval-mozilla-aurora+
(In reply to Loic from comment #0)
> STR:
> Open http://pythonfiddle.com/ and start to type something in the code
> textarea (or just wait for 10/15 sec).
> 
> Result: Both browser and computer freeze, high CPU use.
> 
> Regression range:
> good=2013-09-03
> bad=2013-09-04
> http://hg.mozilla.org/mozilla-central/
> pushloghtml?fromchange=d54e0cce6c17&tochange=e3785e299ab6

Loic, can you please help verify this is fixed for you now ?
(Reporter)

Comment 14

5 years ago
I tested with the latest Nightly (Built from http://hg.mozilla.org/mozilla-central/rev/81bced59e8b3), no more freeze when loading and typing, but the CPU use stays high even the page is idle (maybe should I file a new report?) and it's not the case with an old version like FF17.
https://hg.mozilla.org/releases/mozilla-aurora/rev/fdddb7783576
https://hg.mozilla.org/releases/mozilla-beta/rev/762cbe46246d
https://hg.mozilla.org/releases/mozilla-b2g26_v1_2/rev/27e469d3cab0
status-b2g-v1.2: affected → fixed
status-b2g-v1.3: affected → fixed
status-firefox27: affected → fixed
status-firefox28: affected → fixed
Loic, please verify this is fixed in the latest Nightly, Aurora, and Beta builds.
Flags: needinfo?(epinal99-bugzilla)
(Reporter)

Comment 17

5 years ago
Yes, it's fixed for me in FF27+.

But the high CPU use is still present in these 3 builds.
Flags: needinfo?(epinal99-bugzilla)
(In reply to Loic from comment #17)
> Yes, it's fixed for me in FF27+.
> 
> But the high CPU use is still present in these 3 builds.

Can you do a comparison of CPU usage between Firefox 25, 27, 28, 29, latest Chrome, and latest IE?
Flags: needinfo?(epinal99-bugzilla)
(Reporter)

Comment 19

5 years ago
The regression range about the CPU use:
good=2014-01-14
bad=2014-01-15
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=34dddf6f7ec1&tochange=81bced59e8b3

One of my 4 cores is completely used by Nightly when this website is loaded.
The patch is probably not optimal.
Flags: needinfo?(epinal99-bugzilla)
(In reply to Loic from comment #19)
> The patch is probably not optimal.

The patch here was only intended to address your system becoming locked up completely. If that's no longer happening then this is resolved. That said, you should report a new bug report, referencing this bug report, to improve the CPU usage in Firefox. Particularly if it is significantly worse than the competition. I will leave that up to you.
Status: RESOLVED → VERIFIED
status-firefox27: fixed → verified
status-firefox28: fixed → verified
status-firefox29: fixed → verified
(Reporter)

Updated

5 years ago
Blocks: 961124
You need to log in before you can comment on or make changes to this bug.