Bug 153101 - Web Inspector: Hangs when logging huge JSON object
Summary: Web Inspector: Hangs when logging huge JSON object
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-01-14 11:52 PST by Saam Barati
Modified: 2016-05-09 08:13 PDT (History)
7 users (show)

See Also:


Attachments
sample (115.07 KB, text/plain)
2016-01-14 11:52 PST, Saam Barati
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-01-14 11:52:09 PST
Created attachment 268983 [details]
sample

When logging a huge JSON string, the inspector will hang.
This happened when I logged a huge JSON string in the inspector itself.
When trying to inspect the inspector, it was hanging.

Attached is a sample of the process.
Comment 1 Radar WebKit Bug Importer 2016-01-14 11:52:39 PST
<rdar://problem/24192303>
Comment 2 Joseph Pecoraro 2016-01-14 16:43:02 PST
My initial thought would be regex searching if the string "looks like a stack trace".
Comment 3 Nikita Vasilyev 2016-01-14 20:55:28 PST
Saam, could you post a JSON string that causes the hang?
I can take a look at what's going on there.
Comment 4 Joseph Pecoraro 2016-01-15 11:02:50 PST
(In reply to comment #3)
> Saam, could you post a JSON string that causes the hang?
> I can take a look at what's going on there.

Hmm, I tried just a large, multiline JSON string and saw a lot of time spent in Layout, but not Regex matching =(:

    <script>
    var arr = [];
    for (var i = 0; i < 1e5; ++i)
        arr.push({something: i});
    console.log(JSON.stringify(arr, null, 2));
    </script>

So, I'm not quite sure. Maybe the output itself has to start matching a particular format.
Comment 5 Saam Barati 2016-01-22 22:49:02 PST
(In reply to comment #3)
> Saam, could you post a JSON string that causes the hang?
> I can take a look at what's going on there.

I'll try to reproduce again locally. I'll post
an update with my findings. Maybe this was only
materializing when inspecting the inspector?
Comment 6 Timothy Hatcher 2016-05-09 08:13:23 PDT
This could have been fixed by Joe turning off color swatches for JS resources. It also could have been the hangs we were seeing due to a JSC JIT bug earlier this year.

Lets reopen or file a new bug if we hit this again. Nothing actionable right now.