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

Segmentation fault when increasing the stack size on Windows 7 #17416

Closed
5 tasks
a-roberts opened this issue Dec 1, 2017 · 5 comments
Closed
5 tasks

Segmentation fault when increasing the stack size on Windows 7 #17416

a-roberts opened this issue Dec 1, 2017 · 5 comments
Labels
memory Issues and PRs related to the memory management or memory footprint. windows Issues and PRs related to the Windows platform.

Comments

@a-roberts
Copy link

Reproduce:
node --stack-size=3000 -p ''.

Version: any Node version.
Platform: Windows 7 64-bit and I'm using Git bash. With a regular command prompt (cmd.exe), the command returns instantly with no output: including with node --stack-size=3000 -p process.
Subsystem: my guess is V8.

For background we've been running CITGM and hit the RangeCheck call stack size exceeded problem on all platforms with CITGM so increased the stack size to 5k to actually run CITGM successfully. Then noticed the seg faults on Windows 7 only.

Suggested plan:

  • Ensure we're getting dump files for analysis to give us further clues). Checked at the usual places on Windows and can't see any
  • Attach a debugger to V8 and compare behaviour when it works and when it doesn't
  • Get our pointer addresses and use gdb (I'm used to Linux debugging so find an awesome Windows equivalent if not available) on the attached process to check we can access this memory (in our address space)
  • Check the mmap operation's are legit (to and from addresses)
  • Why Windows 7 only? I don't see this on Windows 2012, 2016, 8 or 10

@gibfahn @bnoordhuis @mhdawson

@vsemozhetbyt vsemozhetbyt added memory Issues and PRs related to the memory management or memory footprint. windows Issues and PRs related to the Windows platform. labels Dec 1, 2017
@bnoordhuis
Copy link
Member

It seems to be a common misunderstanding but --stack_size=... doesn't change the size of the stack, it tells node/V8 how big it is. If you set it to a value that's bigger than the actual size, it runs over.

It's been discussed in the past to make it change the stack size (and I even remember writing some code to that effect) but ultimately it never happened.

@gibfahn
Copy link
Member

gibfahn commented Dec 1, 2017

It seems to be a common misunderstanding but --stack_size=... doesn't change the size of the stack, it tells node/V8 how big it is. If you set it to a value that's bigger than the actual size, it runs over.

How does it run over so quickly? I'd have thought it would blow when the stack grew past a certain amount, rather than immediately.

@gireeshpunathil
Copy link
Member

a wild guess is that v8 may be writing some housekeeping stuff at the floor of the stack after doing the math (roof + --stack_size) , but lands up in an unmapped area?

Can be easily verified if you have the core dump with you - launch it in windbg and look at the stack bounds, current rspand what code is accessing it.

@bnoordhuis
Copy link
Member

I suppose we should close this out because ultimately there's no bug to fix. If someone wants to change --stack_size from "assume this big" to "make this big", please open a feature request or pull request.

@sneurlax
Copy link

This is occurring for me on Linux today, as well, when using a stack-size over 327680000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory Issues and PRs related to the memory management or memory footprint. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

6 participants