-
Notifications
You must be signed in to change notification settings - Fork 13.3k
std: Funnel all aborts through rtabort! cc #31519 #32832
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,13 +73,12 @@ pub fn init() { | |
// errors are ignored while printing since there's nothing we can do about | ||
// them and we are about to exit anyways. | ||
fn oom_handler() -> ! { | ||
use intrinsics; | ||
let msg = "fatal runtime error: out of memory\n"; | ||
unsafe { | ||
libc::write(libc::STDERR_FILENO, | ||
msg.as_ptr() as *const libc::c_void, | ||
msg.len() as libc::size_t); | ||
intrinsics::abort(); | ||
rtabort!(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was somewhat intentionally done because as part of the OOM handler we want to be sure that no allocations happen here. Right now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. er, well this is more relevant for the code below, but you get the point |
||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means that these messages will now be prefixed with
fatal runtime error:
rather than being printed directly as-is. In the past I think we tried to avoid printing the "fatal runtime error" aspect?