On Mon, Sep 11, 2017 at 5:37 PM, Geoffrey Sneddon <m...@gsnedders.com> wrote:
> Chrome limits the DOM at 513 deep (where the root element is one
> deep), Safari likewise but doesn't paint anything. Edge appears to
> have no limit, so that TC simply hangs in an infinite loop (presumably
> it will eventually go OOM and crash, though I wonder if its
> performance isn't linear?).

Indeed, Chrome has a depth limit of 513 elements including the root
(with the depth extending to 514 when counting the text node leaves).

However, Blink does something more complex than Gecko in order to
enforce the limit. Consider the appearance of
https://hsivonen.com/test/moz/deeptree/font/4000.html in Firefox and
Chrome. The visual formatting of the page is as if Chrome didn't have
a depth limit.

I'm rather unhappy about the prospect of having to examine another
browser's HTML parser beyond reading the spec in order to achieve
interop. :-(

On Mon, Sep 11, 2017 at 5:24 PM, Boris Zbarsky <bzbar...@mit.edu> wrote:
> On 9/11/17 10:08 AM, Henri Sivonen wrote:
>>
>> What kind of style would have the maximum stack frame size? Is
>> display: table-cell enough to trigger the worst case?
>
>
> I suspect that display:table-cell is the worst case, but at only about 70%
> confidence.
>
> That said, I can't think of a worse case offhand.

Indeed, when the divs are styled as display: table-cell, the stack
overflows sooner than in the default styling case. So much so that our
current limit of 200 isn't enough to keep 32-bit Windows builds from
crashing with a stack overflow.

With the tests at https://hsivonen.com/test/moz/deeptree/ today, I see
the following:
Linux 64 (Ubuntu 16.04):
Plain div crashes between 3070 and 3080.
Div as table-cell crashes between 1080 and 1090.
The font crash threshold is somewhere above 4000.

Windows 64 (Windows 10):
Plain div crashes between 740 and 750.
Div as table-cell crashes between 240 and 250.
font crashes between 1910 and 1920

WoW (Windows 10):
Plain div crashes between 510 and 520.
Div as table-cell crashes somewhere below 200.
font crashes between 1480 and 1490

On Mon, Sep 11, 2017 at 6:39 PM, Jan de Mooij <jdemo...@mozilla.com> wrote:
> On Mon, Sep 11, 2017 at 5:27 PM, <khagar...@gmail.com> wrote:
>
>> On Monday, September 11, 2017 at 1:41:43 PM UTC+2, Henri Sivonen wrote:
>> > Can we ask Windows to give us more stack space?
>> > --
>> Don't know if it's possible to set it dynamically at runtime, but Visual
>> Studio supports setting it at compile time (in linker options).
>>
>
> Yes, we already set the stack size to 2 MB on Win64 [0].

Is there a reason not to increase the stack size on 32-bit Windows?

Is there a reason not to increase the stack size on 64-bit Windows to
the Linux/Mac ballpark?

-- 
Henri Sivonen
hsivo...@hsivonen.fi
https://hsivonen.fi/
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to