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

Deep nesting causes stackoverflow in windows #765

Open
RedX2501 opened this issue May 16, 2014 · 2 comments
Open

Deep nesting causes stackoverflow in windows #765

RedX2501 opened this issue May 16, 2014 · 2 comments
Labels

Comments

@RedX2501
Copy link
Contributor

I have 266 ninja files and they are quite deeply nested.

I had to remove the try _except block at fake-main to be able to see any error message at all

With VS2012 Express i get the message:

First-chance exception at 0x77810DA9 (ntdll.dll) in ninja.exe: 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x00192FFC).
Unhandled exception at 0x77810DA9 (ntdll.dll) in ninja.exe: 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x00192FFC).

Which happens reproducibly at source line:
util:cc:282
int ReadFile(const string& path, string* contents, string* err) {
FILE* f = fopen(path.c_str(), "r");

I will post more information on this later when i get a change to analyze the depth of the include tree.

@nico
Copy link
Collaborator

nico commented May 17, 2014

Yes, the manifest parser creates parser objects recursively for nested files. It will overflow stacks on posix too, with enough nesting.

Can you outline the structure of your ninja files? The ones created by cmake always have a nesting level of 1 (one file for all the build edges, and one with the rules iirc), and the ones written by gyp have a nesting depth of either 2 (a global file defining common rules and then several hundred "subninja" files for including ninja files containing projects) or sometimes 3 (for fat binaries, the 2nd level can include one ninja file per arch). A nesting depth of 266 sounds pretty high.

@jhasse jhasse added the bug label Nov 16, 2018
@jonesmz

This comment was marked as abuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants