It seems that on 32-bit ARM, the original reason for the lower limit has
disappeared over time, and raising the stack limit there again to the same
984KB as on ia32/x64 might be worth a shot.

However, what Node/Debian cares about is arm64, and I see no reason to
assume that anything has changed there since the limit was lowered. So I
wouldn't be comfortable raising it.

Since (per crbug.com/v8/10575) the issue was specific to WebView, maybe the
best path forward would be for Node to float a patch. V8 itself doesn't
know what product it's getting embedded into.

FWIW, there is no guarantee that the same stack size allows the same
recursion depth on different platforms. In particular, 32-bit platforms
will allow significantly higher recursion depths than 64-bit platforms per
kilobyte of stack space, because most spilled values are register-sized.
There could also be platform-specific differences between different 64-bit
architectures, in particular in optimized code.

The "proper" fix is to design JS applications such that they don't even
approach the stack limit. If 984 vs 864 makes a given app work or fail,
then it's walking on very thin ice either way.


On Fri, Mar 10, 2023 at 4:00 PM 'James Addison' via v8-dev <
[email protected]> wrote:

> Hi folks,
>
> Debian bug #1030284[1] and the related NodeJS GitHub issue #41163[2]
> report ARM-specific RangeError exceptions from the vendored V8 library
> in NodeJS.  The bug(s) are reproducible with v18.13 of NodeJS.
>
> The cause of the difference-in-behaviour appears to be that V8 sets[3]
> a lower stack size for ARM: 864K as compared to 984K.
>
> Would it be safe to increase the stack size on ARM to 984K to restore
> consistency with most other architectures?
>
> (I've offered a patch to make that change, and others have confirmed
> that it allows a provided repro case to pass; I'm worried about any
> potential unsafe side-effects of the change, though)
>
> Thank you,
> James
>
> [1] - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1030284
>
> [2] - https://github.com/nodejs/node/issues/41163
>
> [3] -
> https://github.com/nodejs/node/blob/2bb4b59fa5529569ad38d3bf7d36666c926d8e47/deps/v8/src/common/globals.h#L74-L86
>
> --
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/v8-dev/CALDQ5NzeykWdpd79RcwDwJiWN-tYm%3DE1soUi8bxB1X%3DnjM5Z1g%40mail.gmail.com
> .
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/CAKSzg3Tnw06NZJhSoE7YzJww0rX5%3DZU%3DYb63Gocuy%3Dz-49hw0Q%40mail.gmail.com.

Reply via email to