Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase (or sync) the max callstack size with nodejs #10270

Open
timocov opened this issue Apr 14, 2024 · 0 comments
Open

Increase (or sync) the max callstack size with nodejs #10270

timocov opened this issue Apr 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@timocov
Copy link

timocov commented Apr 14, 2024

What version of Bun is running?

1.1.3

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

// nodejs max limit
// const arraySize = 125077;

// bun max limit
const arraySize = 65536;

const data = Array(arraySize + 1).fill(0);
const otherData = [];
otherData.push(...data);

What is the expected behavior?

No failure.

What do you see instead?

RangeError: Maximum call stack size exceeded.

Additional information

I'm actually not sure if it is a real issue in Bun and should be fixed because I don't think the max value is declared anywhere (but on the other side, I'd not expect to see a UB in JavaScript in this case 😄). I also tried Firefox and it seems they have even higher than in nodejs (sorry I haven't checked the exact value). But maybe it is worth to increase the limit to at least what nodejs provides so users would see the same behavior between runtimes? Feel free to close it if you don't think it is worth it tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant