Repository navigation
Conversation
|
@bors try jobs=test-x86_64-msvc*,test-various,test-arm-android,test-aarch64-apple-* |
This comment has been minimized.
This comment has been minimized.
[WIP] panic abort exit crash oh my try-job: test-x86_64-msvc* try-job: test-various try-job: test-arm-android try-job: test-aarch64-apple-*
This comment has been minimized.
This comment has been minimized.
Done as a separate commit to avoid confusing git.
|
@bors try cancel |
|
Try build cancelled. Cancelled workflows: Hint: if you want to run another try build, you do not need to manually cancel the previous one. Just run |
|
@bors try jobs=test-x86_64-msvc*,test-various,test-arm-android,test-aarch64-apple-* |
This comment has been minimized.
This comment has been minimized.
[WIP] panic abort exit crash oh my try-job: test-x86_64-msvc* try-job: test-various try-job: test-arm-android try-job: test-aarch64-apple-*
crash and other exit API
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? libs @the8472 @RalfJung does this address your concerns at #164731 (comment) and #164731 (comment)? |
|
The first link does not work for me so I am not sure which concerns you mean. |
|
Huh, they both work for me. Specific bits I'm referring to:
And:
|
| /// process], unless absolute minimum overhead is required. | ||
| /// | ||
| /// While this function provides an abrupt exit, note that it is still a safe | ||
| /// form of crashing—unlike some uses of the terms "crash" or "trap". |
There was a problem hiding this comment.
| /// form of crashing—unlike some uses of the terms "crash" or "trap". | |
| /// form of crashing—unlike, for example, a segfault caused by a null pointer dereference. |
There was a problem hiding this comment.
| /// Terminates the process in a violent but safe fashion. |
| //! Use these guidelines to pick which to use: | ||
| //! | ||
| //! * Use `exit` or return `ExitCode` for exiting as part of normal program | ||
| //! behavior. These exit with no additional message, just the provided code. |
There was a problem hiding this comment.
#165125 makes exit do basically no cleanup at all, doesn't it?
There was a problem hiding this comment.
I believe that's correct. I think it should be fine to have "partial" in the table then change it to "no" in that PR (assuming this may merge first).
| //! | [`panic!`] | 101 | 101 | None | Yes | | ||
| //! | [`exit`] | User-provided | User-provided | None | Partial | | ||
| //! | [`abort`] | None | `STATUS_STACK_BUFFER_OVERRUN` | `SIGABRT` | No | | ||
| //! | [`crash`] | None | Unspecified | Unspecified (typically `SIGTRAP` or `SIGILLL`) | No | |
There was a problem hiding this comment.
| //! | [`crash`] | None | Unspecified | Unspecified (typically `SIGTRAP` or `SIGILLL`) | No | | |
| //! | [`crash`] | None | Unspecified | Unspecified (typically `SIGTRAP` or `SIGILL`) | No | |
There was a problem hiding this comment.
Corrected to SIGILLLLLLLLL
| //! | Return [`ExitCode`] or a `Result` from `main` | User-provided | User-provided | None | Yes | | ||
| //! | [`panic!`] | 101 | 101 | None | Yes | | ||
| //! | [`exit`] | User-provided | User-provided | None | Partial | | ||
| //! | [`abort`] | None | `STATUS_STACK_BUFFER_OVERRUN` | `SIGABRT` | No | |
There was a problem hiding this comment.
I'd perhaps even link to https://devblogs.microsoft.com/oldnewthing/20190108-00/?p=100655/, I found this status to be confusing...
There was a problem hiding this comment.
Yeah that's just not a good name. I added a footnote clarifying a bit and linking to docs for __fastfail, which is where this comes from.
This comment has been minimized.
This comment has been minimized.
In `std::process`, add a comparison of all the different forms of exiting we have. Also link `abort` and `crash` to this new documentation, hopefully nudging away users who don't actually need their behavior.
View all comments
In
std::process, add a comparison of all the different forms of exiting we have. Also linkabortandcrashto this new documentation, hopefully nudging away users who don't actually need their behavior.The first two commits also update the run-make exit test to cover forms that weren't yet covered (look at individual commits so the diff doesn't look as messy with the rename).