Skip to content
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

OOM building Servo after Rustup - deep recursion in mir #29740

Closed
nrc opened this Issue Nov 10, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@nrc
Copy link
Member

nrc commented Nov 10, 2015

#0  0x00007ffff7584da0 in oom::hc14cacb105af3859iub () from /usr/local/lib/libstd-8cf6ce90.so
#1  0x00007ffff64e9caf in raw_vec::_$LT$impl$GT$::double::double::h12412696929041978538 () from /usr/local/lib/librustc_mir-8cf6ce90.so
#2  0x00007ffff64e6260 in build::cfg::_$LT$impl$GT$::start_new_block::heb1b8380252b8530fna () from /usr/local/lib/librustc_mir-8cf6ce90.so
#3  0x00007ffff650b0e4 in build::matches::test::_$LT$impl$GT$::call_comparison_fn::h75cd7a8ef7591ed4HGb () from /usr/local/lib/librustc_mir-8cf6ce90.so
#4  0x00007ffff6509750 in build::matches::test::_$LT$impl$GT$::perform_test::h032a1e873b4f8bf31Ab () from /usr/local/lib/librustc_mir-8cf6ce90.so
#5  0x00007ffff6511b25 in build::matches::_$LT$impl$GT$::match_candidates::ha9db898a51f89f14tqc () from /usr/local/lib/librustc_mir-8cf6ce90.so
#6  0x00007ffff65120ee in build::matches::_$LT$impl$GT$::match_candidates::ha9db898a51f89f14tqc () from /usr/local/lib/librustc_mir-8cf6ce90.so
#7  0x00007ffff65120ee in build::matches::_$LT$impl$GT$::match_candidates::ha9db898a51f89f14tqc () from /usr/local/lib/librustc_mir-8cf6ce90.so
#8  0x00007ffff65120ee in build::matches::_$LT$impl$GT$::match_candidates::ha9db898a51f89f14tqc () from /usr/local/lib/librustc_mir-8cf6ce90.so
#9  0x00007ffff65120ee in build::matches::_$LT$impl$GT$::match_candidates::ha9db898a51f89f14tqc () from /usr/local/lib/librustc_mir-8cf6ce90.so
#10 0x00007ffff65120ee in build::matches::_$LT$impl$GT$::match_candidates::ha9db898a51f89f14tqc () from /usr/local/lib/librustc_mir-8cf6ce90.so
...
#120 0x00007ffff65120ee in build::matches::_$LT$impl$GT$::match_candidates::ha9db898a51f89f14tqc () from /usr/local/lib/librustc_mir-8cf6ce90.so
#121 0x00007ffff64febcc in build::expr::into::_$LT$impl$GT$::into_expr::hd474bc15d5db47d4w8a () from /usr/local/lib/librustc_mir-8cf6ce90.so
#122 0x00007ffff64ff70f in build::into::_$LT$impl$GT$::eval_into::h646bd1cee14f27349ob () from /usr/local/lib/librustc_mir-8cf6ce90.so
#123 0x00007ffff64fa3ca in build::expr::into::_$LT$impl$GT$::into_expr::hd474bc15d5db47d4w8a () from /usr/local/lib/librustc_mir-8cf6ce90.so
#124 0x00007ffff64ff70f in build::into::_$LT$impl$GT$::eval_into::h646bd1cee14f27349ob () from /usr/local/lib/librustc_mir-8cf6ce90.so
#125 0x00007ffff64e9c1e in build::into::_$LT$impl$GT$::eval_into::h653729f06b55769coqb () from /usr/local/lib/librustc_mir-8cf6ce90.so
#126 0x00007ffff64e81c8 in build::block::_$LT$impl$GT$::ast_block::h4dafd3792c8ce5263ka () from /usr/local/lib/librustc_mir-8cf6ce90.so
#127 0x00007ffff64e3b6e in build::construct::h9612d1f0ff18acc5Zba () from /usr/local/lib/librustc_mir-8cf6ce90.so
#128 0x00007ffff651ef95 in mir_map::_$LT$impl$GT$::visit_fn::h2e04acb1eab91708sbd () from /usr/local/lib/librustc_mir-8cf6ce90.so
#129 0x00007ffff651ced9 in mir_map::_$LT$impl$GT$::visit_item::ha51d31a4db6001c2s8c () from /usr/local/lib/librustc_mir-8cf6ce90.so
#130 0x00007ffff651ca8a in mir_map::_$LT$impl$GT$::visit_item::ha51d31a4db6001c2s8c () from /usr/local/lib/librustc_mir-8cf6ce90.so
#131 0x00007ffff651ca8a in mir_map::_$LT$impl$GT$::visit_item::ha51d31a4db6001c2s8c () from /usr/local/lib/librustc_mir-8cf6ce90.so
#132 0x00007ffff651c40c in mir_map::build_mir_for_crate::h410e26a41a34d6ccA6c () from /usr/local/lib/librustc_mir-8cf6ce90.so
#133 0x00007ffff7a49440 in driver::phase_3_run_analysis_passes::_$LT$closure$GT$::closure.21972 () from /usr/local/lib/librustc_driver-8cf6ce90.so
#134 0x00007ffff7a2c464 in middle::ty::context::_$LT$impl$GT$::create_and_enter::create_and_enter::h4307381944410836454 () from /usr/local/lib/librustc_driver-8cf6ce90.so
#135 0x00007ffff7a27855 in driver::phase_3_run_analysis_passes::h6779606147744044053 () from /usr/local/lib/librustc_driver-8cf6ce90.so
#136 0x00007ffff7a07ba3 in driver::compile_input::h773898ad93c34082aca () from /usr/local/lib/librustc_driver-8cf6ce90.so
#137 0x00007ffff7b63a3c in run_compiler::h89eb6260e132f685ssc () from /usr/local/lib/librustc_driver-8cf6ce90.so
#138 0x00007ffff7b60ab7 in sys_common::unwind::try::try_fn::try_fn::h9774174355030096594 () from /usr/local/lib/librustc_driver-8cf6ce90.so
#139 0x00007ffff756e339 in __rust_try () from /usr/local/lib/libstd-8cf6ce90.so
#140 0x00007ffff75623bc in sys_common::unwind::try::inner_try::h937939714e6f6031tus () from /usr/local/lib/libstd-8cf6ce90.so
#141 0x00007ffff7b60e05 in boxed::_$LT$impl$GT$::call_box::call_box::h2378443920150659394 () from /usr/local/lib/librustc_driver-8cf6ce90.so
#142 0x00007ffff75759f4 in sys::thread::_$LT$impl$GT$::new::thread_start::ha23768bb722fd035QUw () from /usr/local/lib/libstd-8cf6ce90.so
#143 0x00007ffff0c016aa in start_thread (arg=0x7fffeebff700) at pthread_create.c:333
#144 0x00007ffff71f6eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

The elided frames are all identical to the ones before and after.

Seems related, but different, to #29466

To repro, need to build Servo after a rustup, see this branch: servo/servo#8446. Occurs when building the script crate.

cc @nikomatsakis, @Manishearth

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Nov 10, 2015

This is probably a dup of #29227. I'd be curious to know if it still occurs, as a partial fix has recently landed. I'm working on a more thorough fix now.

@Manishearth

This comment has been minimized.

Copy link
Member

Manishearth commented Nov 10, 2015

I'll check it out in tomorrow's nightly.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Nov 11, 2015

nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Nov 11, 2015

Rewrite match algorithm to avoid massive blowup in generated code for
large matches that fallback to Eq. When we encounter a case where the
test being performed does not inform the candidate at all, we just stop
testing the candidates at that point, rather than adding the candidate
to both outcomes. The former behavior was not WRONG, but it generated a
lot of code, whereas this new behavior degenerates to an if-else-if
tree.

Fixes rust-lang#29740.
@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Nov 11, 2015

triage: P-high (servo blocker)

@rust-highfive rust-highfive added P-high and removed I-nominated labels Nov 11, 2015

@nikomatsakis nikomatsakis self-assigned this Nov 11, 2015

nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Nov 11, 2015

Rewrite match algorithm to avoid massive blowup in generated code for
large matches that fallback to Eq. When we encounter a case where the
test being performed does not inform the candidate at all, we just stop
testing the candidates at that point, rather than adding the candidate
to both outcomes. The former behavior was not WRONG, but it generated a
lot of code, whereas this new behavior degenerates to an if-else-if
tree.

Fixes rust-lang#29740.

bors added a commit that referenced this issue Nov 11, 2015

Auto merge of #29776 - nikomatsakis:mir-29740, r=nrc
In previous PRs, I changed the match desugaring to generate more efficient code for ints/chars and the like. But this doesn't help when you're matching strings, ranges, or other crazy complex things (leading to #29740). This commit restructures match desugaring *yet again* to handle that case better -- basically we now degenerate to an if-else-if chain in such cases.

~~Note that this builds on #29763 which will hopefully land soon. So ignore the first few commits.~~ landed now

r? @Aatch since he's been reviewing the other commits in this series

bors added a commit that referenced this issue Nov 12, 2015

Auto merge of #29776 - nikomatsakis:mir-29740, r=nrc
In previous PRs, I changed the match desugaring to generate more efficient code for ints/chars and the like. But this doesn't help when you're matching strings, ranges, or other crazy complex things (leading to #29740). This commit restructures match desugaring *yet again* to handle that case better -- basically we now degenerate to an if-else-if chain in such cases.

~~Note that this builds on #29763 which will hopefully land soon. So ignore the first few commits.~~ landed now

r? @Aatch since he's been reviewing the other commits in this series

Manishearth added a commit to Manishearth/rust that referenced this issue Nov 12, 2015

Rollup merge of rust-lang#29776 - nikomatsakis:mir-29740, r=nrc
In previous PRs, I changed the match desugaring to generate more efficient code for ints/chars and the like. But this doesn't help when you're matching strings, ranges, or other crazy complex things (leading to rust-lang#29740). This commit restructures match desugaring *yet again* to handle that case better -- basically we now degenerate to an if-else-if chain in such cases.

~~Note that this builds on rust-lang#29763 which will hopefully land soon. So ignore the first few commits.~~ landed now

r? @Aatch since he's been reviewing the other commits in this series

bors-servo added a commit to servo/servo that referenced this issue Nov 12, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

DO NOT r+ or try+ this

It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 12, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

DO NOT r+ or try+ this

It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 12, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

DO NOT r+ or try+ this

It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 13, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

DO NOT r+ or try+ this

It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 16, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

DO NOT r+ or try+ this

It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 25, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

DO NOT r+ or try+ this

It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 25, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

DO NOT r+ or try+ this

It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 25, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 25, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 26, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 26, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 26, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 26, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 26, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 26, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 26, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 26, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 26, 2015

Auto merge of #8446 - servo:rustup_20151110, r=<try>
Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

bors-servo added a commit to servo/servo that referenced this issue Nov 27, 2015

Auto merge of #8446 - servo:rustup_20151110, r=SimonSapin+Ms2ger+jdm+…
…Manishearth

Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08)

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8446)
<!-- Reviewable:end -->

jrmuizel pushed a commit to jrmuizel/gecko-cinnabar that referenced this issue Jun 12, 2017

servo: Merge #8446 - Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2…
…015-11-08) (from servo:rustup_20151110); r=SimonSapin+Ms2ger+jdm+Manishearth

<s>DO NOT r+ or try+ this</s>

<s>It causes an OOM (rust-lang/rust#29740) and can crash the OS. Probably will set our CI on fire. </s>

Source-Repo: https://github.com/servo/servo
Source-Revision: f13c72d68e1e7f49e241938bfd6e8a588c68e86b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.