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 upCurrent beta breaks my build that works on stable #40573
Comments
This comment has been minimized.
This comment has been minimized.
|
It's also worth noting: This only happens on Linux and OSX. My Windows build works fine still. |
This comment has been minimized.
This comment has been minimized.
|
Same commit on AppVeyor: https://ci.appveyor.com/project/Xaeroxe/nitro-game-engine/build/1.0.45 |
This comment has been minimized.
This comment has been minimized.
|
Stack overflow building MIR. Looking into it more. |
This comment has been minimized.
This comment has been minimized.
|
This project is pretty reliant on generics and auto-generated code so I'm not entirely surprised that's the cause. |
This comment has been minimized.
This comment has been minimized.
|
Does not reproduce on a nightly build of my own, but reproduces just fine on the most recent nightly from bots. Ugh! That does suggest some stupid decisions being made by the optimiser. I feel like at this point just marking a bunch of functions in mir build no-inline would fix a lot of our problems wrt this. The workaround is to set |
This comment has been minimized.
This comment has been minimized.
|
To compare, my local build easily handles 3000 frames on 8MiB stack, whereas with our binary distribution builds there’s approx 500 stack frames on a 16MiB stack. (8MiB here is comparison point because that’s what overflow stacks locally for me as well) |
This comment has been minimized.
This comment has been minimized.
|
Well thanks for the workaround. Evidently I didn't report this fast enough, so my bad there. |
This comment has been minimized.
This comment has been minimized.
|
So some notes: It seems I did this build in the middle of today's release. Rust 1.15 yesterday's stable - works Meaning we still have another 6 weeks before this bug would hit stable. |
This comment has been minimized.
This comment has been minimized.
|
triage: P-high |
rust-highfive
added
P-high
and removed
I-nominated
labels
Mar 16, 2017
nikomatsakis
assigned
arielb1
Mar 16, 2017
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
It appears that There does not appear to be a secular large increase in stack sizes - for example, |
This comment has been minimized.
This comment has been minimized.
|
It seems that LLVM has a problem with allocas with overlapping lifetimes that causes stack usage blowups - for example, this: #![crate_type="rlib"]
pub struct Big {
drop_me: [Option<Box<u8>>; 1024]
}
pub fn supersize_me(big: Big, may_panic: fn(), cond: bool) {
may_panic();
let _big2 = big;
may_panic();
if cond {
let _big3 = _big2;
may_panic();
let _big4 = _big3;
may_panic();
let _big5 = _big4;
may_panic();
let _big6 = _big5;
} else {
let _big7 = _big2;
may_panic();
let _big8 = _big7;
may_panic();
let _big9 = _big8;
may_panic();
let _bigA = _big9;
}
}Needs 72k of stack space for 9 allocas (on all rustc versions). Compiling |
This comment has been minimized.
This comment has been minimized.
|
However, to some degree this looks like a codegen regression - stage1 uses 0x29e8 of stack space per call, but stage2 uses 0x6448. |
This comment has been minimized.
This comment has been minimized.
|
Did we bisect yet? I will do that tonight if nobody does it before me.
…On Mar 28, 2017 01:26, "Ariel Ben-Yehuda" ***@***.***> wrote:
However, to some degree this looks like a codegen regression - stage1 uses
0x29e8 of stack space per call, but stage2 uses 0x6448.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#40573 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AApc0q0oDZ92cbXDQGFCM2Sn_nDNMlrQks5rqDefgaJpZM4MfaJL>
.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Marking |
This comment has been minimized.
This comment has been minimized.
|
After further analysis, it looks that the cause of the regression is that with the commit applied, LLVM decides to inline |
arielb1
referenced this issue
Mar 28, 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.
|
Tracking the root cause at #40883 - we may want to fix this with the |
This comment has been minimized.
This comment has been minimized.
|
With a few small fixes, I was able to get stack usage to |
This comment has been minimized.
This comment has been minimized.
arielb1
added a commit
to arielb1/rust
that referenced
this issue
Apr 2, 2017
arielb1
referenced this issue
Apr 2, 2017
Merged
mark build::cfg::start_new_block as inline(never) #41015
arielb1
added a commit
to arielb1/rust
that referenced
this issue
Apr 2, 2017
arielb1
added a commit
to arielb1/rust
that referenced
this issue
Apr 2, 2017
arielb1
added a commit
to arielb1/rust
that referenced
this issue
Apr 2, 2017
arielb1
pushed a commit
to arielb1/rust
that referenced
this issue
Apr 5, 2017
arielb1
pushed a commit
to arielb1/rust
that referenced
this issue
Apr 5, 2017
bors
closed this
in
#41015
Apr 6, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks everyone! I really appreciate it! |
Xaeroxe commentedMar 16, 2017
•
edited
Current beta compiler is segfaulting when attempting to build my project that previously worked on stable: https://travis-ci.org/Xaeroxe/nitro-game-engine/builds/211212522