When attempting to run a program that builds a large clap::App
(find the source here), I get a stackoverflow: thread '<main>' has overflowed its stack
.
So far I was unable to figure out how to instruct rustc
to increase the stacksize for a brute-force workaround. RUST_MIN_STACK
seems to apply only to runtime, and even there it didn't seem to have any effect.
As the code is generated, what I would probably have to do is to move the SubCommand
creation to the runtime, which is what I will try next.
However, do you see a way to fix this differently ?
It seems quite important to figure this one out as the builder patterns appears to be prone to this issue, if the built structure is just large and nested enough.
How to reproduce
git clone -b clap https://github.com/Byron/google-apis-rs
cd google-apis-rs
git checkout 9a8ae4b
make dfareporting2d1-cli-cargo ARGS=run
Please note that you will need my fork of quasi and set an override locally to allow building with the latest compiler.
Meta
? google-apis-rs git:(clap) rustc --version
rustc 1.1.0-nightly (97d4e76c2 2015-04-27) (built 2015-04-28)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…