forked from rust-lang/cargo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#1908 - alexcrichton:moar-stack, r=huonw
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 have been 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 rust-lang#1897
- Loading branch information
Showing
4 changed files
with
27 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters