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

native: Ignore SIGPIPE by default #13158

Merged
merged 1 commit into from
Mar 28, 2014
Merged

Conversation

alexcrichton
Copy link
Member

Some unix platforms will send a SIGPIPE signal instead of returning EPIPE from a
syscall by default. The native runtime doesn't install a SIGPIPE handler,
causing the program to die immediately in this case. This brings the behavior in
line with libgreen by ignoring SIGPIPE and propagating EPIPE upwards to the
application in the form of an IoError.

Closes #13123

Some unix platforms will send a SIGPIPE signal instead of returning EPIPE from a
syscall by default. The native runtime doesn't install a SIGPIPE handler,
causing the program to die immediately in this case. This brings the behavior in
line with libgreen by ignoring SIGPIPE and propagating EPIPE upwards to the
application in the form of an IoError.

Closes rust-lang#13123
bors added a commit that referenced this pull request Mar 28, 2014
Some unix platforms will send a SIGPIPE signal instead of returning EPIPE from a
syscall by default. The native runtime doesn't install a SIGPIPE handler,
causing the program to die immediately in this case. This brings the behavior in
line with libgreen by ignoring SIGPIPE and propagating EPIPE upwards to the
application in the form of an IoError.

Closes #13123
@bors bors closed this Mar 28, 2014
@bors bors merged commit 68c2706 into rust-lang:master Mar 28, 2014
@alexcrichton alexcrichton deleted the issue-13123 branch March 28, 2014 21:46
lifupan pushed a commit to lifupan/kata-containers that referenced this pull request May 28, 2021
The Rust standard library had suppressed the default SIGPIPE
behavior, see rust-lang/rust#13158.
Since the parent's signal handler would be inherited by it's child
process, thus we should re-enable the standard SIGPIPE behavior as a
workaround.

Fixes: kata-containers#1887

Signed-off-by: fupan.lfp <fupan.lfp@antgroup.com>
fidencio pushed a commit to fidencio/kata-containers that referenced this pull request May 31, 2021
The Rust standard library had suppressed the default SIGPIPE
behavior, see rust-lang/rust#13158.
Since the parent's signal handler would be inherited by it's child
process, thus we should re-enable the standard SIGPIPE behavior as a
workaround.

Fixes: kata-containers#1887

Signed-off-by: fupan.lfp <fupan.lfp@antgroup.com>
(cherry picked from commit 0ae364c)
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
fidencio pushed a commit to fidencio/kata-containers that referenced this pull request May 31, 2021
The Rust standard library had suppressed the default SIGPIPE
behavior, see rust-lang/rust#13158.
Since the parent's signal handler would be inherited by it's child
process, thus we should re-enable the standard SIGPIPE behavior as a
workaround.

Fixes: kata-containers#1887

Signed-off-by: fupan.lfp <fupan.lfp@antgroup.com>
(cherry picked from commit 0ae364c)
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
mingnus added a commit to mingnus/thin-provisioning-tools that referenced this pull request May 20, 2022
Separate output errors from input errors for callers to determine the
error type. A broken pipe error (EPIPE) is also treated as an output
error since the Rust std library ignores SIGPIPE by default [1][2].
thin_dump then shows the hint if there's any error in metadata, or exit
gracefully if it is an output error.

[1] rust-lang/rust#13158
[2] rust-lang/rust#62569
mingnus added a commit to mingnus/thin-provisioning-tools that referenced this pull request May 24, 2022
Separate output errors from input errors for callers to determine the
error type. A broken pipe error (EPIPE) is also treated as an output
error since the Rust std library ignores SIGPIPE by default [1][2].
thin_dump then displays the hint if there's any error in metadata, or
exit gracefully if it is an output error.

[1] rust-lang/rust#13158
[2] rust-lang/rust#62569
mingnus added a commit to mingnus/thin-provisioning-tools that referenced this pull request May 25, 2022
thin_dump should display the reparing hint only if there's any error
in the input metadata rather than the output process. A context
therefore is added to the returned error for callers to determine the
error type. Note that a broken pipe error (EPIPE) is treated as an
output error since the Rust std library ignores SIGPIPE by default
[1][2].

[1] rust-lang/rust#13158
[2] rust-lang/rust#62569
mingnus added a commit to mingnus/thin-provisioning-tools that referenced this pull request May 27, 2022
thin_dump should display the reparing hint only if there's any error
in the input metadata rather than the output process. A context
therefore is added to the returned error for callers to determine the
error type. Note that a broken pipe error (EPIPE) is treated as an
output error since the Rust std library ignores SIGPIPE by default
[1][2].

[1] rust-lang/rust#13158
[2] rust-lang/rust#62569
mingnus added a commit to mingnus/thin-provisioning-tools that referenced this pull request May 27, 2022
thin_dump should display the repairing hint if there's any error in the
input metadata rather than the output process. A context object thus is
added to the returned error for callers to determine the error type.
Note that a broken pipe error (EPIPE) is treated as an output error since
the Rust std library ignores SIGPIPE by default [1][2].

[1] rust-lang/rust#13158
[2] rust-lang/rust#62569
mingnus added a commit to mingnus/thin-provisioning-tools that referenced this pull request May 27, 2022
thin_dump should display the repairing hint if there's any error in the
input metadata rather than the output process. A context object thus is
added to the returned error for callers to determine the error type.
Note that a broken pipe error (EPIPE) is treated as an output error since
the Rust std library ignores SIGPIPE by default [1][2].

[1] rust-lang/rust#13158
[2] rust-lang/rust#62569
mingnus added a commit to mingnus/thin-provisioning-tools that referenced this pull request May 27, 2022
thin_dump should display the repairing hint if there's any error in the
input metadata rather than the output process. A context object thus is
added to the returned error for callers to identify the error type.

Note that a broken pipe error (EPIPE) is returned as an output error since
the Rust std library ignores SIGPIPE by default [1][2]. However, due to
the dump process leverages NodeVisitor, the caller is not able to obtain
the low-level IoError object from a string-represented BTreeError.

[1] rust-lang/rust#13158
[2] rust-lang/rust#62569
mingnus added a commit to mingnus/thin-provisioning-tools that referenced this pull request May 27, 2022
thin_dump should display the repairing hint if there's any error in the
input metadata rather than the output process. A context object thus is
added to the returned error for callers to identify the error type.

Note that a broken pipe error (EPIPE) is returned as an output error since
the Rust std library ignores SIGPIPE by default [1][2]. However, due to
the dump process leverages NodeVisitor, a low-level output error is
stringified into a BTreeError, and thus the caller cannot tell whether
it's broken pipe or not.

[1] rust-lang/rust#13158
[2] rust-lang/rust#62569
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Sep 13, 2022
…nas-schievink

feat: make clicking a closing brace inlay hint go to the opening brace
dingxiangfei2009 pushed a commit to dingxiangfei2009/rust that referenced this pull request Jul 28, 2024
…=Manishearth

Make `std_instead_of_core` somewhat MSRV aware

For rust-lang#13158, this catches some things e.g. `core::net` and the recently stable `core::error` but not things moved individually like `UnwindSafe`, as far as I can see the version for those isn't easily available

Beta nominating since ideally we'd get this change in the same version as `core::error` becomes stable

cc `@kpreid`

changelog: none
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Aug 26, 2024
…=Manishearth

Make `std_instead_of_core` somewhat MSRV aware

For rust-lang#13158, this catches some things e.g. `core::net` and the recently stable `core::error` but not things moved individually like `UnwindSafe`, as far as I can see the version for those isn't easily available

Beta nominating since ideally we'd get this change in the same version as `core::error` becomes stable

cc `@kpreid`

changelog: none
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Aug 26, 2024
…=Manishearth

Make `std_instead_of_core` somewhat MSRV aware

For rust-lang#13158, this catches some things e.g. `core::net` and the recently stable `core::error` but not things moved individually like `UnwindSafe`, as far as I can see the version for those isn't easily available

Beta nominating since ideally we'd get this change in the same version as `core::error` becomes stable

cc `@kpreid`

changelog: none
MabezDev pushed a commit to esp-rs/rust that referenced this pull request Sep 3, 2024
…=Manishearth

Make `std_instead_of_core` somewhat MSRV aware

For rust-lang#13158, this catches some things e.g. `core::net` and the recently stable `core::error` but not things moved individually like `UnwindSafe`, as far as I can see the version for those isn't easily available

Beta nominating since ideally we'd get this change in the same version as `core::error` becomes stable

cc `@kpreid`

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

program dies silently when doing I/O on a defunct child Process
2 participants