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

Always mark rust and rust-call abi's as unwind #65020

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Oct 2, 2019

PR #63909 identified a bug that had been injected by PR #55982. As discussed on #64655 (comment) , we started marking extern items as nounwind, even extern items that said they were using "Rust" or "rust-call" ABI.

This is a more targeted variant of PR #63909 that fixes the above bug.

Fix #64655


I personally suspect we will want PR #63909 to land in the long-term

But:

The identified bug was more severe than I think anyone realized (apart from perhaps @gnzlbg, as noted here).

Thus, I was motivated to write this PR, which fixes just the issue with extern rust/rust-call functions, and deliberately avoids injecting further deviation from current behavior (you can see further notes on this in the comments of the code added here).

@rust-highfive
Copy link
Collaborator

r? @cramertj

(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 Oct 2, 2019
@pnkfelix pnkfelix changed the title Always marking rust and rust-call abi's as unwind Always mark rust and rust-call abi's as unwind Oct 2, 2019
@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 2, 2019
@pnkfelix
Copy link
Member Author

pnkfelix commented Oct 2, 2019

nominating for beta backport once/if this actually lands.

@pnkfelix pnkfelix added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 2, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of 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.
2019-10-02T20:17:26.1669931Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-02T20:17:26.1962104Z ##[command]git config gc.auto 0
2019-10-02T20:17:26.2062446Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-02T20:17:26.2585518Z ##[command]git config --get-all http.proxy
2019-10-02T20:17:26.2787848Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65020/merge:refs/remotes/pull/65020/merge
---
2019-10-02T20:24:38.4474612Z    Compiling serde_json v1.0.40
2019-10-02T20:24:40.4086005Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-10-02T20:24:52.4823649Z     Finished release [optimized] target(s) in 1m 36s
2019-10-02T20:24:52.4915599Z tidy check
2019-10-02T20:24:52.8055282Z tidy error: /checkout/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs: too many trailing newlines (2)
2019-10-02T20:24:54.5863050Z some tidy checks failed
2019-10-02T20:24:54.5865905Z 
2019-10-02T20:24:54.5865905Z 
2019-10-02T20:24:54.5867266Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-10-02T20:24:54.5867953Z 
2019-10-02T20:24:54.5868228Z 
2019-10-02T20:24:54.5873349Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-10-02T20:24:54.5873690Z Build completed unsuccessfully in 0:01:40
2019-10-02T20:24:54.5873690Z Build completed unsuccessfully in 0:01:40
2019-10-02T20:24:54.5932743Z == clock drift check ==
2019-10-02T20:24:54.5946382Z   local time: Wed Oct  2 20:24:54 UTC 2019
2019-10-02T20:24:54.6663343Z   network time: Wed, 02 Oct 2019 20:24:54 GMT
2019-10-02T20:24:54.6670013Z == end clock drift check ==
2019-10-02T20:24:56.0475069Z ##[error]Bash exited with code '1'.
2019-10-02T20:24:56.0511872Z ##[section]Starting: Checkout
2019-10-02T20:24:56.0514681Z ==============================================================================
2019-10-02T20:24:56.0514760Z Task         : Get sources
2019-10-02T20:24:56.0514809Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@cramertj
Copy link
Member

cramertj commented Oct 2, 2019

r? @alexcrichton

@alexcrichton
Copy link
Member

r=me on this, thanks for the clear PR description and the clear comments in the code!

@RalfJung
Copy link
Member

RalfJung commented Oct 3, 2019

Funny, I just today talked with @nikomatsakis about this. ;)

Yes, this PR is certainly a step in the right direction. I was not expecting my PR to be that controversial; that's the only reason why I did not split out this change to begin with.

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Co-Authored-By: Ralf Jung <post@ralfj.de>
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of 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.
2019-10-03T08:46:38.2947498Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-03T08:46:38.3149143Z ##[command]git config gc.auto 0
2019-10-03T08:46:38.3214588Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-03T08:46:38.3263542Z ##[command]git config --get-all http.proxy
2019-10-03T08:46:38.3424795Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65020/merge:refs/remotes/pull/65020/merge
---
2019-10-03T08:53:38.3438362Z    Compiling serde_json v1.0.40
2019-10-03T08:53:40.1489854Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-10-03T08:53:51.4231551Z     Finished release [optimized] target(s) in 1m 30s
2019-10-03T08:53:51.4322676Z tidy check
2019-10-03T08:53:51.7129818Z tidy error: /checkout/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs: too many trailing newlines (2)
2019-10-03T08:53:53.4046066Z some tidy checks failed
2019-10-03T08:53:53.4051240Z 
2019-10-03T08:53:53.4051240Z 
2019-10-03T08:53:53.4052413Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-10-03T08:53:53.4053051Z 
2019-10-03T08:53:53.4053252Z 
2019-10-03T08:53:53.4058503Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-10-03T08:53:53.4058890Z Build completed unsuccessfully in 0:01:33
2019-10-03T08:53:53.4058890Z Build completed unsuccessfully in 0:01:33
2019-10-03T08:53:53.4111242Z == clock drift check ==
2019-10-03T08:53:53.4126455Z   local time: Thu Oct  3 08:53:53 UTC 2019
2019-10-03T08:53:53.5754572Z   network time: Thu, 03 Oct 2019 08:53:53 GMT
2019-10-03T08:53:53.5756887Z == end clock drift check ==
2019-10-03T08:53:54.9567336Z ##[error]Bash exited with code '1'.
2019-10-03T08:53:54.9598965Z ##[section]Starting: Checkout
2019-10-03T08:53:54.9601198Z ==============================================================================
2019-10-03T08:53:54.9601256Z Task         : Get sources
2019-10-03T08:53:54.9601303Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

Some comment refinements inspired by review feedback.
@pnkfelix
Copy link
Member Author

pnkfelix commented Oct 3, 2019

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Oct 3, 2019

📌 Commit 71e5f78 has been approved by alexcrichton

@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 3, 2019
@nagisa
Copy link
Member

nagisa commented Oct 3, 2019

This needs a codegen test to verify that we never generate nounwind for extern calls like those.

@pnkfelix
Copy link
Member Author

pnkfelix commented Oct 3, 2019

This needs a codegen test to verify that we never generate nounwind for extern calls like those.

(I will do this in a follow-up PR.)

@RalfJung
Copy link
Member

Ah, missed another test.

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Oct 11, 2019

📌 Commit 028f53e has been approved by alexcrichton

@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 11, 2019
@bors
Copy link
Contributor

bors commented Oct 11, 2019

⌛ Testing commit 028f53e with merge d3077a768c8c64752034e2814c42ac030ec4bf25...

@tmandry
Copy link
Member

tmandry commented Oct 11, 2019

@bors retry yielding to rollup

@bors
Copy link
Contributor

bors commented Oct 12, 2019

⌛ Testing commit 028f53e with merge 4b42e91...

bors added a commit that referenced this pull request Oct 12, 2019
…-abi-unwind-issue-64655, r=alexcrichton

Always mark rust and rust-call abi's as unwind

PR #63909 identified a bug that had been injected by PR #55982. As discussed on #64655 (comment) , we started marking extern items as nounwind, *even* extern items that said they were using "Rust" or "rust-call" ABI.

This is a more targeted variant of PR #63909 that fixes the above bug.

Fix #64655

----

I personally suspect we will want PR #63909 to land in the long-term

But:
 *  it is not certain that PR #63909 *will* land,
 * more importantly, PR #63909 almost certainly will not be backported to beta/stable.

The identified bug was more severe than I think anyone realized (apart from perhaps @gnzlbg, as noted [here](#63909 (comment))).

Thus, I was motivated to write this PR, which fixes *just* the issue with extern rust/rust-call functions, and deliberately avoids injecting further deviation from current behavior (you can see further notes on this in the comments of the code added here).
@bors
Copy link
Contributor

bors commented Oct 12, 2019

☀️ Test successful - checks-azure
Approved by: alexcrichton
Pushing 4b42e91 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 12, 2019
@bors bors merged commit 028f53e into rust-lang:master Oct 12, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 13, 2019
nounwind tests and cleanup

This is a follow-up to @pnkfelix' rust-lang#65020. In particular it adds some tests as @nagisa  asked. It also does a cleanup that the original PR omitted to reduce backporting risks.

I hope I finally managed to write an uncontroversial PR in this area. ;) This should not change any behavior, just test it better.
Centril added a commit to Centril/rust that referenced this pull request Oct 13, 2019
nounwind tests and cleanup

This is a follow-up to @pnkfelix' rust-lang#65020. In particular it adds some tests as @nagisa  asked. It also does a cleanup that the original PR omitted to reduce backporting risks.

I hope I finally managed to write an uncontroversial PR in this area. ;) This should not change any behavior, just test it better.
@Mark-Simulacrum Mark-Simulacrum removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 22, 2019
Mark-Simulacrum pushed a commit to Mark-Simulacrum/rust that referenced this pull request Oct 22, 2019
…king-rust-abi-unwind-issue-64655, r=alexcrichton

Always mark rust and rust-call abi's as unwind

PR rust-lang#63909 identified a bug that had been injected by PR rust-lang#55982. As discussed on rust-lang#64655 (comment) , we started marking extern items as nounwind, *even* extern items that said they were using "Rust" or "rust-call" ABI.

This is a more targeted variant of PR rust-lang#63909 that fixes the above bug.

Fix rust-lang#64655

----

I personally suspect we will want PR rust-lang#63909 to land in the long-term

But:
 *  it is not certain that PR rust-lang#63909 *will* land,
 * more importantly, PR rust-lang#63909 almost certainly will not be backported to beta/stable.

The identified bug was more severe than I think anyone realized (apart from perhaps @gnzlbg, as noted [here](rust-lang#63909 (comment))).

Thus, I was motivated to write this PR, which fixes *just* the issue with extern rust/rust-call functions, and deliberately avoids injecting further deviation from current behavior (you can see further notes on this in the comments of the code added here).
bors added a commit that referenced this pull request Oct 24, 2019
[beta] backport rollup

This includes a bunch of PRs:
 *  Fix redundant semicolon lint interaction with proc macro attributes #64387
 *  Upgrade async/await to "used" keywords. #64875
 *  syntax: fix dropping of attribute on first param of non-method assocated fn #64894
 *  async/await: improve not-send errors #64895
 *  Silence unreachable code lint from await desugaring #64930
 *  Always mark rust and rust-call abi's as unwind #65020
 *  Account for macro invocation in `let mut $pat` diagnostic. #65123
 *  Ensure that associated `async fn`s have unique fresh param names #65142
 *  Add troubleshooting section to PGO chapter in rustc book. #65402
 *  Upgrade GCC to 8.3.0, glibc to 1.17.0 and crosstool-ng to 1.24.0 for dist-armv7-linux #65302
 *  Optimize `try_expand_impl_trait_type` #65293
 *  use precalculated dominators in explain_borrow #65172
 *  Fix ICE #64964 #64989
bors added a commit that referenced this pull request Oct 26, 2019
[beta] backport rollup

This includes a bunch of PRs:
 *  Fix redundant semicolon lint interaction with proc macro attributes #64387
 *  Upgrade async/await to "used" keywords. #64875
 *  syntax: fix dropping of attribute on first param of non-method assocated fn #64894
 *  async/await: improve not-send errors #64895
 *  Silence unreachable code lint from await desugaring #64930
 *  Always mark rust and rust-call abi's as unwind #65020
 *  Account for macro invocation in `let mut $pat` diagnostic. #65123
 *  Ensure that associated `async fn`s have unique fresh param names #65142
 *  Add troubleshooting section to PGO chapter in rustc book. #65402
 *  Upgrade GCC to 8.3.0, glibc to 1.17.0 and crosstool-ng to 1.24.0 for dist-armv7-linux #65302
 *  Optimize `try_expand_impl_trait_type` #65293
 *  use precalculated dominators in explain_borrow #65172
 *  Fix ICE #64964 #64989
 *  [beta] Revert "Auto merge of #62948 - matklad:failable-file-loading, r=petro… #65273
 *  save-analysis: Don't ICE when resolving qualified type paths in struct members #65353
 *  save-analysis: Nest tables when processing impl block definitions #65511
 *  Avoid ICE when checking `Destination` of `break` inside a closure #65518
 *  Avoid ICE when adjusting bad self ty #65755
 *  workaround msys2 bug #65762
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.

Drop implementations not being called on panic with Fat LTO.
10 participants