Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRun cargo with a large stack #1908
Conversation
alexcrichton
added some commits
Aug 15, 2015
rust-highfive
assigned
huonw
Aug 16, 2015
This comment has been minimized.
This comment has been minimized.
rust-highfive
commented
Aug 16, 2015
|
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
referenced this pull request
Aug 16, 2015
Closed
Stack overflow (still) in `cargo build` #1897
This comment has been minimized.
This comment has been minimized.
|
I built Cargo on a mac with this PR and managed to build Servo with it. Thanks Alex! |
This comment has been minimized.
This comment has been minimized.
|
Travis & appveyor both failed? r=me if they're spurious. |
This comment has been minimized.
This comment has been minimized.
|
@bors: r=huonw Yeah those were fixed in the "update deps" PR |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 17, 2015
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit 0139707
into
rust-lang:master
Aug 17, 2015
alexcrichton
deleted the
alexcrichton:moar-stack
branch
Aug 17, 2015
SimonSapin
added a commit
to servo/servo
that referenced
this pull request
Aug 20, 2015
josiahdaniels
added a commit
to josiahdaniels/servo
that referenced
this pull request
Sep 28, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
alexcrichton commentedAug 16, 2015
There have been a number of reports of Cargo triggering a stack overflow in the
algorithm implemented in
cargo::core::resolve, and although many attempts havebeen made to reduce the stack space of the two relevant recursive functions it
seems likely that this will not always be enough. For now, before moving the
recursion to the heap manually, spawn the main thread with a large stack (e.g.
mirror what the compiler does) to ensure that the same scenarios happen across
platforms at least.
Currently on my machine I get a 2MB stack on Linux and a 512K stack on OSX, so
bumping this up to 8MB should be more than enough for the recursion in this
algorithm. I also hope that with nonzeroing drop a few of the recursive calls
will be able to become tail recursive, which should also help with stack space!
Closes #1897