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

Revert 78373 ("dont leak return value after panic in drop") #81257

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Jan 22, 2021

Short term resolution for issue #80949.

Reopen #47949 after this lands.

(We plan to fine-tune PR #78373 to not run into this problem.)

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(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 Jan 22, 2021
@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 Jan 22, 2021
@pnkfelix
Copy link
Member Author

(shoot, was working on an out-of-date repo clone when I did revert. Rebasing now.)

@pnkfelix pnkfelix force-pushed the issue-80949-short-term-resolution-via-revert-of-pr-78373 branch from 3f6eac0 to c9c2fa8 Compare January 22, 2021 04:10
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-9 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

---- [mir-opt] mir-opt/issue-41888.rs stdout ----
37     }
38 
39     bb2: {
- <<<<<<< HEAD
- ||||||| parent of 8faab6b3c00... Revert "Use `record_operands_moved` more aggresively"
-         _0 = const ();                   // scope 1 at $DIR/issue-41888.rs:14:6: 14:6
-         goto -> bb7;                     // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
- 
-     bb3: {
- =======
- =======
-         _0 = const ();                   // scope 1 at $DIR/issue-41888.rs:14:6: 14:6
-         goto -> bb8;                     // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
- 
-     bb3: {
-     bb3: {
- >>>>>>> 8faab6b3c00... Revert "Use `record_operands_moved` more aggresively"
54         StorageLive(_3);                 // scope 1 at $DIR/issue-41888.rs:9:13: 9:20
55         StorageLive(_4);                 // scope 1 at $DIR/issue-41888.rs:9:18: 9:19
56         _4 = K;                          // scope 1 at $DIR/issue-41888.rs:9:18: 9:19
61 
62     bb3: {
62     bb3: {
63         _0 = const ();                   // scope 1 at $DIR/issue-41888.rs:14:6: 14:6
-         goto -> bb7;                     // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
+         goto -> bb8;                     // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
66 
67     bb4: {


88         goto -> bb8;                     // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
90 
90 
- <<<<<<< HEAD
-     bb7: {
-         StorageDead(_2);                 // scope 1 at $DIR/issue-41888.rs:14:5: 14:6
-         goto -> bb18;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- ||||||| parent of 8faab6b3c00... Revert "Use `record_operands_moved` more aggresively"
-     bb7: {
-         goto -> bb18;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- =======
99     bb8: {
+         StorageDead(_2);                 // scope 1 at $DIR/issue-41888.rs:14:5: 14:6
100         goto -> bb20;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- >>>>>>> 8faab6b3c00... Revert "Use `record_operands_moved` more aggresively"
103 
104     bb9: {


thread '[mir-opt] mir-opt/issue-41888.rs' panicked at 'Actual MIR output differs from expected MIR output /checkout/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir', src/tools/compiletest/src/runtest.rs:3452:25


failures:
    [mir-opt] mir-opt/issue-41888.rs
    [mir-opt] mir-opt/issue-41888.rs

test result: FAILED. 148 passed; 1 failed; 3 ignored; 0 measured; 0 filtered out; finished in 4.08s



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/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "mir-opt" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-9/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test --exclude src/tools/tidy
Build completed unsuccessfully in 0:13:06

@pnkfelix pnkfelix force-pushed the issue-80949-short-term-resolution-via-revert-of-pr-78373 branch from c9c2fa8 to d37cc61 Compare January 22, 2021 04:51
@pnkfelix pnkfelix 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 Jan 22, 2021
@matthewjasper matthewjasper added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 22, 2021
@@ -78,6 +78,7 @@
100:12-100:20: @0[5]: _5 = (*((*_1).0: &amp;bool))"> let mut countdown = 0;</span></span>
<span class="line"><span class="code even" style="--layer: 1" title="99:29-99:30: @0[1]: _3 = const 0_i32
99:13-99:26: @0[2]: FakeRead(ForLet, _3)
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge has broken here. Coverage tests probably need blessing since there have been other changes to these tests since #78373

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, sorry about that, thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(how did it pass CI with that in place? Do we not check this output as part of CI?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Ah I bet I need to set profiler = true in my config.toml to get the relevant information here.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this isn't run on the PR builders.

Copy link
Member Author

@pnkfelix pnkfelix Jan 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if I need to do something else besides set profiler = true? I don't see the test failure in my local build (running x.py test src/test/run-make-fulldeps), and thus I expect blessing here won't help until that's resolved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my entire config.toml

changelog-seen = 2

[llvm]

assertions = true

[build]

build = "x86_64-pc-windows-msvc"
profiler = true

[install]

[rust]

debug = true

[target.x86_64-unknown-linux-gnu]

[dist]

The test does take over a minute to run though. I can try on linux if that would help.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. The profiler coverage tooling and file generation shouldn't be Windows specific, right? So weird that I don't see this.

I'll try to make my own setup more closely match yours, I guess. (Also, @wesleywiser said they'd help; I'm going to get in touch with them soon.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pnkfelix I checked out your PR locally and built with ./x.py test src/test/run-make-fulldeps/coverage. The three coverage tests were ignored because I didn't have profiler = true set in my config.toml. After setting that, I reran the command, everything built and I got one failing test: run-make-fulldeps/coverage-spanview. I don't think I have anything special configuration other than profiler = true set.

I went ahead and blessed the test and pushed here in case you just want to cherry-pick that.

@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 Jan 26, 2021
@apiraino apiraino added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 28, 2021
@pnkfelix
Copy link
Member Author

@matthewjasper am I right in inferring that you are otherwise okay with this PR, assuming the blessing contributed by @wesleywiser worked?

@matthewjasper
Copy link
Contributor

Yes, r=me once coverage tests pass.

@pnkfelix pnkfelix force-pushed the issue-80949-short-term-resolution-via-revert-of-pr-78373 branch from 55980b8 to 37dcdff Compare February 1, 2021 16:36
@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 1, 2021

@bors r=matthewjasper

@bors
Copy link
Contributor

bors commented Feb 1, 2021

📌 Commit 37dcdff319c831bbe9568816f5a0e85d1f28ca8a has been approved by matthewjasper

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 1, 2021
@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 1, 2021

(I still haven't managed to figure out why my local machine does not appear to invoke the coverage tests, but at this point I'm going to use Wesley's contribution and cross my fingers.)

@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 1, 2021

@bors p=10

(this is a candidate for beta-backport, and so I want to prioritize it over the other PR's I see in the queue that appear to be more cosmetic in nature.)

@pnkfelix
Copy link
Member Author

pnkfelix commented Feb 1, 2021

hmm and I guess I also need to up the priority because it already needs a rebase after 3 hours in the queue

@pnkfelix pnkfelix force-pushed the issue-80949-short-term-resolution-via-revert-of-pr-78373 branch from 37dcdff to 4d59bb4 Compare February 1, 2021 19:28
@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 Feb 5, 2021
@bors
Copy link
Contributor

bors commented Feb 5, 2021

⌛ Testing commit 7c7f10b with merge dafe03c8f7621bca5fd1743e933dee235d2a5cad...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
skip untracked path cpu-usage.csv during rustfmt invocations
skip untracked path src/doc/book/ during rustfmt invocations
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/compiler/rustc_mir_build/src/build/mod.rs at line 76:
             kind: hir::TraitItemKind::Const(ty, Some(body_id)),
             ..
         }) => (*body_id, ty.span, None),
-        Node::AnonConst(hir::AnonConst { body, hir_id, .. }) => (*body, tcx.hir().span(*hir_id), None),
+        Node::AnonConst(hir::AnonConst { body, hir_id, .. }) => {
+            (*body, tcx.hir().span(*hir_id), None)
+        }
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/compiler/rustc_mir_build/src/build/mod.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
 
         _ => span_bug!(tcx.hir().span(id), "can't build MIR for {:?}", def.did),
Diff in /checkout/compiler/rustc_mir_build/src/build/mod.rs at line 184:
                 return_ty,
                 return_ty_span,
                 body,
                 body,
-                span_with_body
+                span_with_body,
             );
             mir.yield_ty = yield_ty;
Diff in /checkout/compiler/rustc_mir_build/src/build/mod.rs at line 582:
Diff in /checkout/compiler/rustc_mir_build/src/build/mod.rs at line 582:
     return_ty: Ty<'tcx>,
     return_ty_span: Span,
     body: &'tcx hir::Body<'tcx>,
-    span_with_body: Span
+    span_with_body: Span,
 ) -> Body<'tcx>
 where
     A: Iterator<Item = ArgInfo<'tcx>>,
Diff in /checkout/compiler/rustc_mir_build/src/build/mod.rs at line 658:
     let owner_id = tcx.hir().body_owner(body_id);
     let def_id = tcx.hir().local_def_id(owner_id);
     let span = tcx.hir().span(owner_id);
-    let mut builder = Builder::new(hir, def_id.to_def_id(), span, 0, Safety::Safe, const_ty, const_ty_span, None);
+    let mut builder =
+        Builder::new(hir, def_id.to_def_id(), span, 0, Safety::Safe, const_ty, const_ty_span, None);
     let mut block = START_BLOCK;
     let mut block = START_BLOCK;
     let ast_expr = &tcx.hir().body(body_id).value;
Diff in /checkout/compiler/rustc_mir_build/src/build/mod.rs at line 698:
         hir::BodyOwnerKind::Const => 0,
         hir::BodyOwnerKind::Static(_) => 0,
     };
-    let mut builder = Builder::new(hir, def_id.to_def_id(), span, num_params, Safety::Safe, ty, span, None);
+    let mut builder =
+        Builder::new(hir, def_id.to_def_id(), span, num_params, Safety::Safe, ty, span, None);
     let source_info = builder.source_info(span);
     // Some MIR passes will expect the number of parameters to match the
     // function declaration.
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test

@bors
Copy link
Contributor

bors commented Feb 5, 2021

💔 Test failed - checks-actions

@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 Feb 5, 2021
@wesleywiser
Copy link
Member

Pushed a fix for the tidy errors.

@bors r=matthewjasper p=10 rollup=never

@bors
Copy link
Contributor

bors commented Feb 5, 2021

📌 Commit dce5e9e has been approved by matthewjasper

@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 Feb 5, 2021
@ehuss ehuss mentioned this pull request Feb 5, 2021
@bors
Copy link
Contributor

bors commented Feb 5, 2021

⌛ Testing commit dce5e9e with merge 5605b5d...

@bors
Copy link
Contributor

bors commented Feb 5, 2021

☀️ Test successful - checks-actions
Approved by: matthewjasper
Pushing 5605b5d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 5, 2021
@bors bors merged commit 5605b5d into rust-lang:master Feb 5, 2021
@rustbot rustbot added this to the 1.51.0 milestone Feb 5, 2021
@ehuss ehuss removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Feb 5, 2021
ehuss pushed a commit to ehuss/rust that referenced this pull request Feb 5, 2021
…ution-via-revert-of-pr-78373, r=matthewjasper

Revert 78373 ("dont leak return value after panic in drop")

Short term resolution for issue rust-lang#80949.

Reopen rust-lang#47949 after this lands.

(We plan to fine-tune PR rust-lang#78373 to not run into this problem.)
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 6, 2021
[beta] backports

This backports:

* CI: only copy python.exe to python3.exe if the latter does not exist rust-lang#81762
* Make hitting the recursion limit in projection non-fatal rust-lang#81055
* Remove incorrect `delay_span_bug` rust-lang#81532
* introduce future-compatibility warning for forbidden lint groups rust-lang#81556
* Update cargo rust-lang#81755
* rustdoc: Fix visibility of trait and impl items rust-lang#81288
* Work around missing -dev packages in solaris docker image. rust-lang#81229
* Update LayoutError/LayoutErr stability attributes rust-lang#81767
* Revert 78373 ("dont leak return value after panic in drop") rust-lang#81257
* Rename `panic_fmt` lint to `non_fmt_panic` rust-lang#81729
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. 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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants