-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current beta breaks my build that works on stable #40573
Comments
It's also worth noting: This only happens on Linux and OSX. My Windows build works fine still. |
Same commit on AppVeyor: https://ci.appveyor.com/project/Xaeroxe/nitro-game-engine/build/1.0.45 |
Stack overflow building MIR. Looking into it more. |
This project is pretty reliant on generics and auto-generated code so I'm not entirely surprised that's the cause. |
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 |
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) |
Well thanks for the workaround. Evidently I didn't report this fast enough, so my bad there. |
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. |
triage: P-high |
It appears that There does not appear to be a secular large increase in stack sizes - for example, |
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 |
However, to some degree this looks like a codegen regression - stage1 uses 0x29e8 of stack space per call, but stage2 uses 0x6448. |
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>
.
|
Marking |
After further analysis, it looks that the cause of the regression is that with the commit applied, LLVM decides to inline |
Tracking the root cause at #40883 - we may want to fix this with the |
With a few small fixes, I was able to get stack usage to |
LLVM has a bug - PR32488 - where it fails to deduplicate allocas in some circumstances. The function `start_new_block` has allocas totalling 1216 bytes, and when LLVM inlines several copies of that function into the recursive function `expr::into`, that function's stack space usage goes into tens of kiBs, causing stack overflows. Mark `start_new_block` as inline(never) to keep it from being inlined, getting stack usage under control. Fixes rust-lang#40493. Fixes rust-lang#40573.
LLVM has a bug - PR32488 - where it fails to deduplicate allocas in some circumstances. The function `start_new_block` has allocas totalling 1216 bytes, and when LLVM inlines several copies of that function into the recursive function `expr::into`, that function's stack space usage goes into tens of kiBs, causing stack overflows. Mark `start_new_block` as inline(never) to keep it from being inlined, getting stack usage under control. Fixes rust-lang#40493. Fixes rust-lang#40573.
…hton mark build::cfg::start_new_block as inline(never) LLVM has a bug - [PR32488](https://bugs.llvm.org//show_bug.cgi?id=32488) - where it fails to deduplicate allocas in some circumstances. The function `start_new_block` has allocas totalling 1216 bytes, and when LLVM inlines several copies of that function into the recursive function `expr::into`, that function's stack space usage goes into tens of kiBs, causing stack overflows. Mark `start_new_block` as inline(never) to keep it from being inlined, getting stack usage under control. Fixes rust-lang#40493. Fixes rust-lang#40573. r? @eddyb
Thanks everyone! I really appreciate it! |
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
The text was updated successfully, but these errors were encountered: