Repository navigation
uucore: make catching SIG{SEGV,BUS} a best effort - #16703
Conversation
f846483 to
14983b5
Compare
Merging this PR will not alter performance1 warning, 1 note
Comparing Footnotes
|
14983b5 to
828cd0a
Compare
|
GNU testsuite comparison: |
41ba1ed to
7aca797
Compare
This comment was marked as resolved.
This comment was marked as resolved.
7aca797 to
2502695
Compare
2502695 to
69861a9
Compare
69861a9 to
b10f88d
Compare
b10f88d to
1640c51
Compare
|
I wonder if it would be better to panic? |
|
I don't think so since this is non-serious requirement. |
1640c51 to
65f8c98
Compare
| @@ -50,7 +50,7 @@ pub fn main(args: TokenStream, stream: TokenStream) -> TokenStream { | |||
|
|
|||
| // disable rust signal handlers (otherwise processes don't dump core after e.g. one SIGSEGV) | |||
There was a problem hiding this comment.
why is failure is a "non-serious requirement"? should be documented here
There was a problem hiding this comment.
And I don't think that lib.rs is right place to do that.
Since |
|
Do we really need to support external usage of all of public API? This fn is clearly existing only for us. There is no public usecase. |
|
If there's no need to expose it as part of the public API, we should move it to |
99cec5f to
8244e39
Compare
8244e39 to
ddaef7d
Compare
ddaef7d to
6007cfe
Compare
6007cfe to
8749394
Compare
| #[cfg(all(#signals, unix))] | ||
| uucore::signals::disable_rust_signal_handlers().expect("Disabling rust signal handlers failed"); | ||
| // SAFETY: Single-threaded; no other signal handlers have been installed. | ||
| let ok = unsafe { uucore::signals::disable_rust_signal_handlers() }.is_ok(); | ||
| #[cfg(all(#signals, unix))] | ||
| debug_assert!(ok, "Disabling rust signal handlers failed"); |
There was a problem hiding this comment.
| #[cfg(all(#signals, unix))] | |
| uucore::signals::disable_rust_signal_handlers().expect("Disabling rust signal handlers failed"); | |
| // SAFETY: Single-threaded; no other signal handlers have been installed. | |
| let ok = unsafe { uucore::signals::disable_rust_signal_handlers() }.is_ok(); | |
| #[cfg(all(#signals, unix))] | |
| debug_assert!(ok, "Disabling rust signal handlers failed"); | |
| #[cfg(all(#signals, unix))] | |
| { | |
| // SAFETY: Single-threaded; no other signal handlers have been installed. | |
| let result = unsafe { uucore::signals::disable_rust_signal_handlers() }; | |
| debug_assert!(result.is_ok(), "Disabling rust signal handlers failed"); | |
| } |
There was a problem hiding this comment.
I don't like it (or import nix:: at here). It increases lines.
There was a problem hiding this comment.
Looks like the same number of lines to me, and it removes a duplicated cfg condition.
8749394 to
853e543
Compare
|
Thanks for your PR |
We use memory safe language. Thus, we should not catch
SIGSEGVgenerally.No need to panic for it.
(The known usecase of this is testing
killusing oursleeponly...)