Closed Bug 1392760 Opened 7 years ago Closed 5 years ago

Console freezes when inspecting deeply nested proxy

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(firefox57 wontfix, firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox57 --- wontfix
firefox68 --- fixed

People

(Reporter: Oriol, Assigned: Oriol)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Enter this code to the console:

      var proxy = {};
      for (var i=0; i<100; ++i) proxy = new Proxy(proxy, proxy);
      proxy;

The console stops working (or the browser freezes in non-e10s).

That's because a proxy grip always contains a grip of the target and the handler.
When I do:

      var proxy = {};
      for (var i=0; i<50; ++i) proxy = new Proxy(proxy, proxy);
      proxy;

I see a freeze, but when I do:

      var proxy = {};
      for (var i=0; i<100; ++i) proxy = new Proxy(proxy, proxy);
      proxy;

I see broken behavior where the chrome doesn't freeze but no evaluation result returns and it breaks future input into the console
Whiteboard: [console-html][triage]
Flags: qe-verify+
Priority: -- → P4
QA Contact: iulia.cristescu
Whiteboard: [console-html][triage] → [reserve-console-html]
See Also: → 1405067
Related with https://github.com/devtools-html/devtools-core/issues/602, I think the solution should be:

 - Proxy grips stop exposing a grip of the target and the handler
 - A preview of the target is created and exposed as the preview of the proxy
 - A new protocol request is added to ask for the target and the handler when the proxy is inspected

This will require some changes in object inspector, and maybe reps. And VariablesView should also be adapted (unless it's going to be removed soon).

So for the moment it may be easier to just stop exposing a grip of the target and the handler when hooks.getGripDepth() > 1
(In reply to Oriol Brufau [:Oriol] from comment #2)
> This will require some changes in object inspector, and maybe reps. And
> VariablesView should also be adapted (unless it's going to be removed soon).

Let's not add any specific fixes to the Variables View. It still needs to work at least until the Browser Console is migrated to the new frontend and we figure something out what do do Scratchpad, but we're planning to remove it at that point.
Flags: qe-verify+
Priority: P4 → P2
QA Contact: iulia.cristescu
Whiteboard: [reserve-console-html] → [newconsole-mvp]
Not specific to new frontend
Whiteboard: [newconsole-mvp]
Product: Firefox → DevTools
Assignee: nobody → oriol-bugzilla
Status: NEW → ASSIGNED
Type: enhancement → defect

(In reply to Brian Grinstead [:bgrins] from comment #3)

Let's not add any specific fixes to the Variables View. It still needs to
work at least until the Browser Console is migrated to the new frontend and
we figure something out what do do Scratchpad, but we're planning to remove
it at that point.

Any news about removing VariablesView? I had to include a fix for it to avoid breaking Scratchpad. Why not switch Scratchpad to use reps?

(In reply to Oriol Brufau [:Oriol] from comment #6)

(In reply to Brian Grinstead [:bgrins] from comment #3)

Let's not add any specific fixes to the Variables View. It still needs to
work at least until the Browser Console is migrated to the new frontend and
we figure something out what do do Scratchpad, but we're planning to remove
it at that point.

Any news about removing VariablesView? I had to include a fix for it to avoid breaking Scratchpad. Why not switch Scratchpad to use reps?

The general plan is to add true multiline support to the webconsole and then remove Scratchpad (since the Browser Console + editor mode would cover most of the same ground), rather than modifying Scratchpad to support reps.

Keywords: checkin-needed

Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a0a023dac829
Avoid exponential behavior when inspecting nested proxies. r=nchevobbe

Keywords: checkin-needed
Backout by dvarga@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/57f669c6fab1
Backed out changeset a0a023dac829 for debugger failure at object-inspector/types

Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1b3234069aba
Avoid exponential behavior when inspecting nested proxies. r=nchevobbe

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
See Also: → 1552648
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: