Skip to content

"inconvenient" stack overflow when using spread operator - changing stack size does not work #16870

@olydis

Description

@olydis
  • Version: 7.10 (or most likely earlier) until 9.1.0 as far as I can tell
  • Platform: Windows 10
  • Subsystem: x64

Happy about recent ES features, we did stuff like someArray.push(...someOtherArray) which turns out to be problematic for large someOtherArray (say, 1 million elements), causing a stack overflow presumably because of the huge number of "arguments". There is the obvious workaround of loop-pushing (...with some helper method, since it's ugly to do that in tons of places), but given that the spread array doesn't even have too large for this to happen, I was also investigating stack size. I read about the --stack-size/--stack_size parameter, but setting that to anything significantly larger than 1000 on my Windows box caused the process to just silently crash instead of getting the nice stack overflow error.

I'm not expecting any magic, the error and its reason makes sense to me, I just wondered:

  • is there a plan regarding enabling scenarios like push(...LARGE_ARRAY) since I assume that's the pattern people will happily use these days, unaware of the caveat
  • is there any plan/way to support larger stacks on Windows?

Now that I wrote this, I think maybe these questions make more sense on the V8 side, but maybe you have valuable insights/ideas to share 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues that look for answers.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions