Open Bug 1622169 Opened 5 years ago Updated 2 years ago

Full parent process hang viewing large JSON document in Response panel

Categories

(DevTools :: Netmonitor, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: dveditz, Unassigned)

References

(Blocks 2 open bugs)

Details

(4 keywords)

Attachments

(3 files)

This bug was reported to security@ by "Hello weinull"

Parent process is completely hung by viewing a large JSON file in the devtools network "Response" tab. It's not that large a file, nor deeply nested, just a 20,000 x 4 array.

  1. open DevTools, either the Console showing "requests" or the Networking tab
  2. load the attached "big.json" file
  3. click on the request to show the details panels
  4. click on the "Response" tab

Doesn't hang immediately, and doesn't give any indication it's loading (other bugs on file for that, like bug 1571190) but after a few seconds (10 at most) the whole application beach-balls and the parent process goes to 100% CPU. I stopped waiting after 5 minutes or so. A smaller file in the same format comes back relatively quickly so maybe this would eventually. Or maybe there's something O(n²) going on and it wouldn't.

The full-page JSON-viewer handles the same file just fine.

Thanks for the report Daniel!

I can easily reproduce it on my machine.

This is most likely caused by auto-expanding the JSON preview tree, which is rendering parsed HTTP response in the JSON section (within the Response side panel). The tree has huge amount if items and the rendering takes a lot of time.

There is bug 1264908 that should speed the underlying Tree component

We could at least not expand the huge tree automatically (till bug 1264908 is fixed). The amount of expanded nodes should actually be limited but, seems to be broken.

See some pointers:

  1. https://searchfox.org/mozilla-central/rev/278046367dab878316f60f0bd7f740cf73f3c447/devtools/client/netmonitor/src/components/PropertiesView.js#312

This place calls getExpandedNodes to get list of nodes that should be expanded (list of unique node paths). The function has two arguments that should limit the amount of expanded

  • maxLevel: AUTO_EXPAND_MAX_LEVEL,
  • maxNodes: AUTO_EXPAND_MAX_NODES,

The constants are defined here:
https://searchfox.org/mozilla-central/rev/278046367dab878316f60f0bd7f740cf73f3c447/devtools/client/netmonitor/src/constants.js#552

  1. Here is implementation of getExpandedNodes
    https://searchfox.org/mozilla-central/rev/278046367dab878316f60f0bd7f740cf73f3c447/devtools/client/shared/components/tree/TreeView.js#176

It looks like the bug is in getExpandedNodes

Honza

Priority: -- → P3
Whiteboard: good-first-bug

The amount of expanded nodes should actually be limited but, seems to be broken.

So TreeView's handling of maxNodes should kick in but doesn't? https://searchfox.org/mozilla-central/rev/f36cb2af46edd2659f446b7acdb2154e230ee445/devtools/client/shared/components/tree/TreeView.js#194

Keywords: good-first-bug
Whiteboard: good-first-bug
Assignee: nobody → hmanilla

This good-first-bug hasn't had any activity for 6 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: hmanilla → nobody

Can I work on this?

Sure go ahead!
Assigned to you.

Assignee: nobody → mustafa.abdelmogoud

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: mustafa.abdelmogoud → nobody

Hello everybody,

I tried reproducing the bug on my computer and this is the behavior I encountered:

  1. The panel shows "No payload for this request"
  2. After a few seconds the browser stops responding (see image Bug 1622169-Not Responding.png)
  3. After another few seconds the panel displays the JSON (see image Bug 1622169-JSON.png)

I tested it on both Firefox and Nightly
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0

I hope this helps.

Regards,
Alessia

Attached image Bug 1622169-JSON.png
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: