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

Test #[unix_sigpipe = "inherit"] with both SIG_DFL and SIG_IGN #123316

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Apr 1, 2024

Extend our #[unix_sigpipe = "inherit"] test so that it detects if SIGPIPE wrongly ends up being SIG_DFL when the parent has SIG_IGN. We have no current test for this particular case.

Tracking issue: #97889

@rustbot
Copy link
Collaborator

rustbot commented Apr 1, 2024

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 1, 2024
Add a test that fails if `#[unix_sigpipe = "inherit"]` wrongly results
in `SIGPIPE` being `SIG_DFL` if the parent has `SIG_IGN`. We have no
current test for this particular case.
@Enselic
Copy link
Member Author

Enselic commented Apr 14, 2024

@TaKO8Ki I restructured the code in the hope that it would become more "obviously correct".

@@ -1,14 +1,29 @@
//@ ignore-cross-compile because aux-bin does not yet support it
Copy link
Member

Choose a reason for hiding this comment

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

Could you open a GH issue for that if you think it'd be convenient to support this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done with #124361

#[unix_sigpipe = "inherit"]
extern crate libc;

// By default the Rust runtime resets SIGPIPE to SIG_DFL before exec:ing child
Copy link
Member

Choose a reason for hiding this comment

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

As an aside: Regarding exec:ing, I've never seen this typographic convention before (non-native speaker), I only know of using ' in such contexts.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed (I'm not a native speaker either):

$ git grep "'ing" | wc -l
24

I'll fix it in upcoming PRs in this area.

@fmease
Copy link
Member

fmease commented Apr 24, 2024

r? fmease @bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 24, 2024

📌 Commit 4559e61 has been approved by fmease

It is now in the queue for this repository.

@rustbot rustbot assigned fmease and unassigned TaKO8Ki Apr 24, 2024
@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 Apr 24, 2024
fmease added a commit to fmease/rust that referenced this pull request Apr 24, 2024
…r=fmease

Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`

Extend our `#[unix_sigpipe = "inherit"]` test so that it detects if  `SIGPIPE` wrongly ends up being `SIG_DFL` when the parent has `SIG_IGN`. We have no current test for this particular case.

Tracking issue: rust-lang#97889
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#122500 (delegation: Support renaming, and async, const, extern "ABI" and C-variadic functions)
 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#124136 (Provide more context and suggestions in borrowck errors involving closures)
 - rust-lang#124280 (Port repr128-dwarf run-make test to rmake)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

r? `@ghost`
`@rustbot` modify labels: rollup
fmease added a commit to fmease/rust that referenced this pull request Apr 24, 2024
…r=fmease

Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`

Extend our `#[unix_sigpipe = "inherit"]` test so that it detects if  `SIGPIPE` wrongly ends up being `SIG_DFL` when the parent has `SIG_IGN`. We have no current test for this particular case.

Tracking issue: rust-lang#97889
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 5 pull requests

Successful merges:

 - rust-lang#122500 (delegation: Support renaming, and async, const, extern "ABI" and C-variadic functions)
 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#123794 (More DefineOpaqueTypes::Yes)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

Failed merges:

 - rust-lang#124136 (Provide more context and suggestions in borrowck errors involving closures)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#123794 (More DefineOpaqueTypes::Yes)
 - rust-lang#123881 (Bump Fuchsia versions)
 - rust-lang#124281 (fix weak memory bug in TLS on Windows)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#123794 (More DefineOpaqueTypes::Yes)
 - rust-lang#123881 (Bump Fuchsia versions)
 - rust-lang#124281 (fix weak memory bug in TLS on Windows)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 453c23f into rust-lang:master Apr 24, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 24, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup merge of rust-lang#123316 - Enselic:sigpipe-inherit-variants, r=fmease

Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`

Extend our `#[unix_sigpipe = "inherit"]` test so that it detects if  `SIGPIPE` wrongly ends up being `SIG_DFL` when the parent has `SIG_IGN`. We have no current test for this particular case.

Tracking issue: rust-lang#97889
@Enselic Enselic deleted the sigpipe-inherit-variants branch April 25, 2024 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants