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 uprustc built by MIR overflows its stack for crates with very deep ASTs. #35408
Comments
eddyb
referenced this issue
Aug 6, 2016
Merged
[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}. #35409
bors
added a commit
that referenced
this issue
Aug 10, 2016
This comment has been minimized.
This comment has been minimized.
|
triage: P-high |
rust-highfive
added
P-high
and removed
I-nominated
labels
Aug 11, 2016
nikomatsakis
assigned
eddyb
Aug 11, 2016
bors
added a commit
that referenced
this issue
Aug 14, 2016
bors
added a commit
that referenced
this issue
Aug 14, 2016
arielb1
added
regression-from-stable-to-beta
and removed
regression-from-stable-to-nightly
labels
Aug 18, 2016
eddyb
referenced this issue
Aug 18, 2016
Merged
Remove the old AST-based backend from rustc_trans. #35764
This comment has been minimized.
This comment has been minimized.
|
May be fixed by #35764, we should do a crater run after that's merged. |
This comment has been minimized.
This comment has been minimized.
|
Actually, how are we going to do a crater run if we don't have an old trans switch? I suppose before-after on that PR might suffice (and it would catch other problems wrt drop flags). |
This comment has been minimized.
This comment has been minimized.
|
@eddyb well we can certainly just check the results for |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis My manual check suggests it's fixed, but I want to see it on crater before closing. |
This comment has been minimized.
This comment has been minimized.
|
Crater report shows it didn't actually get fixed. |
This comment has been minimized.
This comment has been minimized.
|
@eddyb were you able to observe it failing before? |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis Yes, and a stage2 build of #35764 was the first time I saw it work again. EDIT: Just tested again, stage1 overflows its stack (being built by beta), stage2 doesn't. |
This comment has been minimized.
This comment has been minimized.
|
@brson's beta crater runs reveals that @nagisa's If it is the change to remove filling drop from |
This comment has been minimized.
This comment has been minimized.
|
Its probably caused by the auto generated trie in We should really investigate that arbitrary sized initializers do not break On Aug 27, 2016 5:25 AM, "Eduard-Mihai Burtescu" notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
For all its worth I coud not reproduce the issue with nightly from 08-04, but could reproduce with stage2 build of rustc built from my i128 PR. EDIT: the stack looks like this:
|
This comment has been minimized.
This comment has been minimized.
|
What a waste of time, old trans is missing %self = alloca %"hir::lowering::LoweringContext"*, align 8
%e = alloca %"12.syntax::ast::Expr"*, align 8While MIR trans... well, MIR trans has What I missed the first time was that So the remaining theory is that there's just too many |
This comment has been minimized.
This comment has been minimized.
|
Something I noticed while looking at #36023 which may be relevant: we seem to be emitting |
This comment has been minimized.
This comment has been minimized.
|
@eddyb do you think that having more lifetime-start calls would cause problems? I guess it's possible. |
rkruppe
referenced this issue
Sep 7, 2016
Closed
Overhaul std collections and algorithm documentation #36318
brson
added
the
I-crash
label
Sep 13, 2016
This comment has been minimized.
This comment has been minimized.
|
Heads up, I got danburkert/procinfo-rs#15 merged with a workaround for this issue in |
This comment has been minimized.
This comment has been minimized.
|
@rust-lang/compiler @eddyb please retriage this one. When we made it P-medium it was because we thought it was fixed, but it is not. |
brson
added
the
I-nominated
label
Nov 17, 2016
This comment has been minimized.
This comment has been minimized.
|
Note that it was fixed (or did not manifest on |
This comment has been minimized.
This comment has been minimized.
|
@kamalmarhubi What value of |
This comment has been minimized.
This comment has been minimized.
Sure. The region hierarchy for match-expressions has the bindings destroyed only on the exit block of the match, so for example fn example(ex: Box<Result<[u32; 64], [i32; 64]>>) {
match *ex {
Ok(a) => {},
Err(b) => {}
}
}Translates to
Here the live-ranges for |
This comment has been minimized.
This comment has been minimized.
|
@arielb1 Last I looked the numbers seemed to fit the non-overlapping situation, but maybe I wasn't paying enough attention. It'd be great if we can get a win from changing that? |
This comment has been minimized.
This comment has been minimized.
|
triage: P-high We should at least figure out if something changed since the last time we looked, though the solution seems pretty unclear. |
rust-highfive
added
P-high
and removed
I-nominated
P-medium
labels
Nov 17, 2016
nikomatsakis
self-assigned this
Nov 17, 2016
This comment has been minimized.
This comment has been minimized.
|
All functions in librustc with with stack frames over 4kB:
|
This comment has been minimized.
This comment has been minimized.
|
And in
|
This comment has been minimized.
This comment has been minimized.
|
@arielb1 Nice! Could that be used on a stable release, prior to MIR trans being on by default? |
This comment has been minimized.
This comment has been minimized.
|
cd /tmp
cargo new foo
cd foo
echo 'procinfo = "=0.3.0"' >> Cargo.toml
rustup run <toolchain> cargo buildHere are the results I get:
So latest nightly is not reproing, but it looks like there has been a serious perf regression since 1.13. It also looks like 1.14 will have the issue if it isn't fixed before the release (which would be a regression from 1.13). |
This comment has been minimized.
This comment has been minimized.
|
cc @eddyb @nikomatsakis any updates? This is still tagged P-high so please circle back to it soon. |
brson
added
the
I-nominated
label
Dec 29, 2016
This comment has been minimized.
This comment has been minimized.
|
No changes since 11/17. Still P-high. @nikomatsakis @eddyb please re-triage. |
This comment has been minimized.
This comment has been minimized.
|
triage: P-medium Still worthy of investigation -- and I hope to do so post-xmas -- but not a burning priority. More of a long-standing issue we need to improve bit by bit. |
rust-highfive
added
P-medium
and removed
P-high
I-nominated
labels
Dec 29, 2016
eddyb
referenced this issue
Jan 6, 2017
Closed
cargo clippy on chrono gives "thread 'main' has overflowed its stack" #1244
michaelwoerister
referenced this issue
Mar 30, 2017
Closed
Linear stack blowup with multiple Vec::push of big struct with destructor #40883
This comment has been minimized.
This comment has been minimized.
|
There's been mucho activity investigating stack blowup issues on #40883. @arielb1 believes that the LLVM fixes linked from #40883 (comment) will be necessary to resolve these problems for us. |
Mark-Simulacrum
added
the
C-bug
label
Jul 25, 2017
This comment has been minimized.
This comment has been minimized.
|
I believe this should be fixed with the fix to #40883. |
This comment has been minimized.
This comment has been minimized.
|
This can probably be closed now. |
eddyb commentedAug 6, 2016
•
edited by shepmaster
These examples have been found on crater:
boiler(failure)procinfo(failure)marksman_escape(failure)These reproduce with
stage2but notstage1, unlessstage0is passed-Z orbit, which means a compiler built by MIR trans will use more stack space than old trans did.For
procinfo, there are just over 1000 frames, usually in theNodeIdAssigner, my guess is that its AST has a depth 500-700 in places (it's usingnom, which might cause such extreme nesting).cc @rust-lang/compiler