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

Make into schedule drop for the destination #61430

Merged
merged 3 commits into from
Oct 7, 2019

Conversation

matthewjasper
Copy link
Contributor

closes #47949

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 1, 2019
@rust-highfive

This comment has been minimized.

@Centril
Copy link
Contributor

Centril commented Jun 1, 2019

r? @pnkfelix

@pnkfelix
Copy link
Member

pnkfelix commented Jun 4, 2019

@matthewjasper the code changes here look fine to me; do you know what is up with the Travis CI failure, though?

@pnkfelix
Copy link
Member

pnkfelix commented Jun 4, 2019

r=me once travis is happy.

@pnkfelix pnkfelix added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 4, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:1c0b6090:start=1559669689852908094,finish=1559669785790925895,duration=95938017801
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:04:55] 
[01:04:55] running 144 tests
[01:04:58] i..iii.....iii..iiii.....i......................i..i.................i.....i..........ii.i..i..i.ii. 100/144
[01:05:00] test result: ok. 114 passed; 0 failed; 30 ignored; 0 measured; 0 filtered out
[01:05:00] 
[01:05:00]  finished in 4.628
[01:05:00] travis_fold:end:test_codegen
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:05:02] 
[01:05:02] running 9 tests
[01:05:02] iiiiiiiii
[01:05:02] 
[01:05:02]  finished in 0.147
[01:05:02] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:05:18] 
[01:05:18] running 122 tests
[01:05:44] .iiiii...i.....i..i...i..i.i.i..i.ii.Fi.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
[01:05:49] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:05:49] .i.i......iii.i.....ii
[01:05:49] failures:
[01:05:49] 
[01:05:49] 
[01:05:49] ---- [debuginfo-gdb+lldb] debuginfo/generator-locals.rs stdout ----
[01:05:49] NOTE: compiletest thinks it is using GDB without native rust support
[01:05:49] error: compilation failed!
[01:05:49] status: exit code: 101
[01:05:49] status: exit code: 101
[01:05:49] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/debuginfo/generator-locals.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/generator-locals/a" "-Crpath" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-g" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/generator-locals/auxiliary.gdb"
[01:05:49] ------------------------------------------
[01:05:49] 
[01:05:49] ------------------------------------------
[01:05:49] stderr:
[01:05:49] stderr:
[01:05:49] ------------------------------------------
[01:05:49] thread 'rustc' panicked at 'assertion failed: `(left != right)`
[01:05:49]   left: `_1`,
[01:05:49]  right: `_1`', src/librustc_mir/transform/generator.rs:99:9
[01:05:49] 
[01:05:49] error: internal compiler error: unexpected panic
[01:05:49] 
[01:05:49] note: the compiler unexpectedly panicked. this is a bug.
[01:05:49] note: the compiler unexpectedly panicked. this is a bug.
[01:05:49] 
[01:05:49] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[01:05:49] 
[01:05:49] note: rustc 1.37.0-dev running on x86_64-unknown-linux-gnu
[01:05:49] 
[01:05:49] note: compiler flags: -Z threads=1 -Z unstable-options -C prefer-dynamic -C rpath
[01:05:49] 
[01:05:49] ------------------------------------------
[01:05:49] 
[01:05:49] 
---
[01:05:49] test result: FAILED. 82 passed; 1 failed; 39 ignored; 0 measured; 0 filtered out
[01:05:49] 
[01:05:49] 
[01:05:49] 
[01:05:49] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/debuginfo" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "debuginfo-gdb+lldb" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FilTue, 04 Jun 2019 18:42:25 GMT
The command "date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
" exited with 0.
travis_fold:start:after_failure.1
travis_time:start:2264ba10
---
travis_time:end:0af43a91:start=1559673745995971198,finish=1559673746002010947,duration=6039749
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:34b6a4c3
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@matthewjasper
Copy link
Contributor Author

I think that the ICE is fixed now. I've had to change how we are checking generators for the transform. This should not affect any generator layout. cc @rust-lang/compiler

Since this now seems quite a risky PR:
@bors rollup=never

@Centril
Copy link
Contributor

Centril commented Jun 4, 2019

@bors p=10

@Zoxc
Copy link
Contributor

Zoxc commented Jun 5, 2019

@bors r-

@bors
Copy link
Contributor

bors commented Jun 6, 2019

☔ The latest upstream changes (presumably #61373) made this pull request unmergeable. Please resolve the merge conflicts.

@jonas-schievink
Copy link
Contributor

Triage ping @matthewjasper, a few review comments need to be addressed and merge conflicts need to be fixed

@matthewjasper
Copy link
Contributor Author

This is blocked on #61872 for now

@jonas-schievink jonas-schievink added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 22, 2019
@matthewjasper matthewjasper added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 5, 2019
@oli-obk
Copy link
Contributor

oli-obk commented Oct 7, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Oct 7, 2019

📌 Commit 3702683 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 7, 2019
@bors
Copy link
Contributor

bors commented Oct 7, 2019

⌛ Testing commit 3702683 with merge 697ced5a4d57e1a78c284f0f91f2365ff8144716...

@rust-highfive
Copy link
Collaborator

Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Oct 7, 2019

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 7, 2019
@lqd
Copy link
Member

lqd commented Oct 7, 2019

Seems spurious: a segfault installing awscli:

Script contents:
src/ci/install-awscli.sh
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/7e1f4ab8-5218-4d32-8794-b923dc0cf857.sh
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  python-setuptools-doc
The following NEW packages will be installed:
  python3-setuptools
0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
E: Method http has died unexpectedly!
E: Sub-process http received a segmentation fault.
E: Method /usr/lib/apt/methods/http did not start correctly
##[error]Bash exited with code '100'.
##[section]Finishing: Install awscli

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 7, 2019
@bors
Copy link
Contributor

bors commented Oct 7, 2019

⌛ Testing commit 3702683 with merge f3c9cec...

bors added a commit that referenced this pull request Oct 7, 2019
Make `into` schedule drop for the destination

closes #47949
@tmandry tmandry added the A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) label Oct 7, 2019
@bors
Copy link
Contributor

bors commented Oct 7, 2019

☀️ Test successful - checks-azure
Approved by: oli-obk
Pushing f3c9cec to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 7, 2019
@bors bors merged commit 3702683 into rust-lang:master Oct 7, 2019
@matthewjasper matthewjasper deleted the drop-on-into-panic branch October 8, 2019 11:59
@nnethercote
Copy link
Contributor

It appears this change was a big regression: up to 36% for many benchmarks, and over 500,000% for deeply-nested-opt(!)

This should be backed out, or the regression completely fixed, ASAP.

cc @rust-lang/wg-compiler-performance

@nnethercote
Copy link
Contributor

#65249 backs out the part that caused the perf regression.

bors added a commit that referenced this pull request Nov 2, 2019
[WIP] Make `into` schedule drop for the destination again

#61430 triggered some degenerate behavior in llvm where it would inline functions far too aggressively.

This is marked as WIP because it doesn't really solve the problem in general. I've opened this PR more so that there's a place to discuss fixes.

<details>

<summary>Minimized example of the problem</summary>

Uncommenting the `#[inline]` will cause this to take a long time to compile on nightly, since llvm will inline all of the next calls into one enormous function that it spends a very long time handling.

```rust
pub trait Iterator {
    type Item;

    fn next(&mut self) -> Self::Item;
}

pub struct Empty;

impl Iterator for Empty {
    type Item = ();
    fn next(&mut self) {}
}

pub struct Chain<A, B=Empty> {
    a: A,
    b: B,
    state: ChainState,
}

#[allow(dead_code)]
enum ChainState {
    Both,
    Front,
    Back,
}

impl<A, B> Iterator for Chain<A, B> where
    A: Iterator,
    B: Iterator<Item = A::Item>
{
    type Item = A::Item;

    //#[inline]
    //^ uncomment me for degenerate llvm behvaiour with `-O`
    fn next(&mut self) -> A::Item {
        let ret;
        match self.state {
            ChainState::Both => {
                let _x = self.a.next();
                self.state = ChainState::Back;
                ret = self.b.next()
            },
            ChainState::Front => ret = self.a.next(),
            ChainState::Back => ret = self.b.next(),
        };
        ret
    }
}

type Chain2<T> = Chain<Chain<T>>;
type Chain4<T> = Chain2<Chain2<T>>;
type Chain8<T> = Chain4<Chain4<T>>;
type Chain16<T> = Chain8<Chain8<T>>;

pub fn call_next(x: &mut Chain16<Empty>) {
    x.next()
}
```

</details>

Closes #47949
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panics in destructors can cause the return value to be leaked