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

Rollup of 4 pull requests #116924

Closed
wants to merge 28 commits into from
Closed

Rollup of 4 pull requests #116924

wants to merge 28 commits into from

Conversation

fmease
Copy link
Member

@fmease fmease commented Oct 19, 2023

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

wesleywiser and others added 28 commits September 21, 2023 16:13
According to the POSIX standard, if connect() is interrupted by a
signal that is caught while blocked waiting to establish a connection,
connect() shall fail and set errno to EINTR, but the connection
request shall not be aborted, and the connection shall be established
asynchronously.

If asynchronous connection was successfully established after EINTR
and before the next connection attempt, OS returns EISCONN that was
handled as an error before. This behavior is fixed now and we handle
it as success.

The problem affects MacOS users: Linux doesn't return EISCONN in this
case, Windows connect() can not be interrupted without an old-fashoin
WSACancelBlockingCall function that is not used in the library.
So current solution gives connect() as OS specific implementation.
This check is made `needs-unwind`, as the panic=abort case is a strictly
simpler version.
…indows, r=cuviper

Add `-Zstack-protector` test for Windows targets

Add variants of the `stack-protector-heuristics-effect.rs` test for 32-bit and 64-bit MSVC Windows and update the original test to run on GNU Windows targets.

I added two tests instead of trying to modify the original because:
  - MSVC uses a different function name (`__security_check_cookie` to perform the test rather than doing the test inline and calling `__stack_chk_fail`).
  - LLVM's stack protection pass doesn't currently support generating checks for [frames with funclet based EH personality](https://github.com/llvm/llvm-project/blob/37fd3c96b917096d8a550038f6e61cdf0fc4174f/llvm/lib/CodeGen/StackProtector.cpp#L103C1-L109C4).
  - 32-bit Windows uses classic EH while 64-bit Windows uses table-based EH which results in slightly different codegen.

[CI run with test passing on {i686,x86_64}-{msvc,mingw}](https://github.com/rust-lang/rust/actions/runs/6275450644/job/17042958375?pr=116037)
Make TCP connect handle EINTR correctly

According to the [POSIX](https://pubs.opengroup.org/onlinepubs/009695399/functions/connect.html) standard, if connect() is interrupted by a signal that is caught while blocked waiting to establish a connection, connect() shall fail and set errno to EINTR, but the connection request shall not be aborted, and the connection shall be established asynchronously. When the connection has been established asynchronously, select() and poll() shall indicate that the file descriptor for the socket is ready for writing.

The previous implementation differs from the recomendation: in a case of the EINTR we tried to reconnect in a loop and sometimes get EISCONN error (this problem was originally detected on MacOS).

1. More details about the problem in an [article](http://www.madore.org/~david/computers/connect-intr.html).
2. The original [issue](https://git.picodata.io/picodata/picodata/tarantool-module/-/issues/157).
Add FileCheck annotations to mir-opt tests.

This PR makes compiletest run LLVM `FileCheck` tool on mir-opt tests.

The check is *run by default*, except if disabled using `// skip-filecheck` comment. This ensures that we do not have a silently broken test. For now, the check is only run on the output of `--emit=mir`, ie. on PreCodegen MIR.

I give an example on `reference_prop.rs`.

r? `@oli-obk`
cc `@RalfJung`

Fixes rust-lang#85180
Only check in a single place if a pass is enabled.

Fixes rust-lang#116294
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc O-hermit Operating System: Hermit labels Oct 19, 2023
@rustbot rustbot added O-solid Operating System: SOLID O-unix Operating system: Unix-like O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Oct 19, 2023
@fmease
Copy link
Member Author

fmease commented Oct 19, 2023

@bors r+ rollup=never p=4

@bors
Copy link
Contributor

bors commented Oct 19, 2023

📌 Commit b6f4522 has been approved by fmease

It is now in the queue for this repository.

@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 19, 2023
@bors
Copy link
Contributor

bors commented Oct 19, 2023

⌛ Testing commit b6f4522 with merge 9679ae0...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 19, 2023
Rollup of 4 pull requests

Successful merges:

 - rust-lang#116037 (Add `-Zstack-protector` test for Windows targets)
 - rust-lang#116132 (Make TCP connect handle EINTR correctly)
 - rust-lang#116810 (Add FileCheck annotations to mir-opt tests.)
 - rust-lang#116896 (Only check in a single place if a pass is enabled.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Oct 19, 2023

💔 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 Oct 19, 2023
@rust-log-analyzer
Copy link
Collaborator

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

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

---- [mir-opt] tests/mir-opt/instrument_coverage.rs stdout ----
9   
10 +     coverage ExpressionId(0) => Expression { lhs: Counter(0), op: Add, rhs: Counter(1) };
11 +     coverage ExpressionId(1) => Expression { lhs: Expression(0), op: Subtract, rhs: Counter(1) };
- +     coverage Counter(0) => /the/src/instrument_coverage.rs:11:1 - 11:11;
- +     coverage Expression(0) => /the/src/instrument_coverage.rs:12:5 - 13:17;
- +     coverage Expression(1) => /the/src/instrument_coverage.rs:14:13 - 14:18;
- +     coverage Expression(1) => /the/src/instrument_coverage.rs:17:1 - 17:2;
- +     coverage Counter(1) => /the/src/instrument_coverage.rs:15:10 - 15:11;
+ +     coverage Counter(0) => /the/src/instrument_coverage.rs:12:1 - 12:11;
+ +     coverage Expression(0) => /the/src/instrument_coverage.rs:13:5 - 14:17;
+ +     coverage Expression(1) => /the/src/instrument_coverage.rs:15:13 - 15:18;
+ +     coverage Expression(1) => /the/src/instrument_coverage.rs:18:1 - 18:2;
+ +     coverage Counter(1) => /the/src/instrument_coverage.rs:16:10 - 16:11;
18       bb0: {
19 +         Coverage::CounterIncrement(0);

thread '[mir-opt] tests/mir-opt/instrument_coverage.rs' panicked at src/tools/compiletest/src/runtest.rs:4070:21:

@fmease fmease closed this Oct 19, 2023
@fmease fmease deleted the rollup-aznzvf8 branch October 19, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc O-hermit Operating System: Hermit O-solid Operating System: SOLID O-unix Operating system: Unix-like O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants