-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Report allocation errors as panics #109507
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
Some changes occurred in src/tools/rust-analyzer cc @rust-lang/rust-analyzer Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in compiler/rustc_codegen_gcc cc @antoyo |
This comment has been minimized.
This comment has been minimized.
d50da58
to
ccad895
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #109503) made this pull request unmergeable. Please resolve the merge conflicts. |
04025a1
to
7cdaf6e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
LGTM, r=me if you're just waiting on reviewer
Currently blocked on this FCP. |
This comment was marked as resolved.
This comment was marked as resolved.
8511a3f
to
2355a4a
Compare
FCP is complete, this is now ready to merge. |
2355a4a
to
4b981c2
Compare
@bors r+ |
This was missed in rust-lang#109507.
I've opened #110733 |
format panic message only once For `panic!` and friends, the `std` panic runtime will always set the `.payload()` of `PanicInfo` to the formatted string. The linked issues show that formatting the message twice can cause problems, so we simply print the already formatted message instead of formatting it again. We can't remove the preformatted payload, because it can be observed by custom panic hooks. fixes rust-lang#110717 fixes rust-itertools/itertools#694 cc `@Amanieu` who broke this in rust-lang#109507
format panic message only once For `panic!` and friends, the `std` panic runtime will always set the `.payload()` of `PanicInfo` to the formatted string. The linked issues show that formatting the message twice can cause problems, so we simply print the already formatted message instead of formatting it again. We can't remove the preformatted payload, because it can be observed by custom panic hooks. fixes rust-lang#110717 fixes rust-itertools/itertools#694 cc ``@Amanieu`` who broke this in rust-lang#109507
format panic message only once For `panic!` and friends, the `std` panic runtime will always set the `.payload()` of `PanicInfo` to the formatted string. The linked issues show that formatting the message twice can cause problems, so we simply print the already formatted message instead of formatting it again. We can't remove the preformatted payload, because it can be observed by custom panic hooks. fixes rust-lang#110717 fixes rust-itertools/itertools#694 cc ```@Amanieu``` who broke this in rust-lang#109507
…manieu Revert panic oom This temporarily reverts rust-lang#109507 until rust-lang#110771 is addressed r? `@Amanieu`
…milio The new API landed in rust-lang/rust#109507 Differential Revision: https://phabricator.services.mozilla.com/D176383
…milio The new API landed in rust-lang/rust#109507 Differential Revision: https://phabricator.services.mozilla.com/D176383
format panic message only once Formatting the panic message multiple times can cause problems for some real-world crates, so here's a test to ensure that we don't do that. This was regressed in rust-lang#109507 and reverted in rust-lang#110782. fixes rust-lang#110717 fixes rust-itertools/itertools#694
Report allocation errors as panics OOM is now reported as a panic but with a custom payload type (`AllocErrorPanicPayload`) which holds the layout that was passed to `handle_alloc_error`. This should be review one commit at a time: - The first commit adds `AllocErrorPanicPayload` and changes allocation errors to always be reported as panics. - The second commit removes `#[alloc_error_handler]` and the `alloc_error_hook` API. ACP: rust-lang/libs-team#192 Closes rust-lang#51540 Closes rust-lang#51245
…milio The new API landed in rust-lang/rust#109507 Differential Revision: https://phabricator.services.mozilla.com/D176383 UltraBlame original commit: 04bb12c2c8fd7036f9f2d0b85a73c6cb31b0dcf0
…milio The new API landed in rust-lang/rust#109507 Differential Revision: https://phabricator.services.mozilla.com/D176383 UltraBlame original commit: 04bb12c2c8fd7036f9f2d0b85a73c6cb31b0dcf0
…milio The new API landed in rust-lang/rust#109507 Differential Revision: https://phabricator.services.mozilla.com/D176383 UltraBlame original commit: 04bb12c2c8fd7036f9f2d0b85a73c6cb31b0dcf0
Report allocation errors as panics OOM is now reported as a panic but with a custom payload type (`AllocErrorPanicPayload`) which holds the layout that was passed to `handle_alloc_error`. This should be review one commit at a time: - The first commit adds `AllocErrorPanicPayload` and changes allocation errors to always be reported as panics. - The second commit removes `#[alloc_error_handler]` and the `alloc_error_hook` API. ACP: rust-lang/libs-team#192 Closes rust-lang#51540 Closes rust-lang#51245
Report allocation errors as panics OOM is now reported as a panic but with a custom payload type (`AllocErrorPanicPayload`) which holds the layout that was passed to `handle_alloc_error`. This should be review one commit at a time: - The first commit adds `AllocErrorPanicPayload` and changes allocation errors to always be reported as panics. - The second commit removes `#[alloc_error_handler]` and the `alloc_error_hook` API. ACP: rust-lang/libs-team#192 Closes rust-lang#51540 Closes rust-lang#51245
Revert panic oom This temporarily reverts rust-lang/rust#109507 until rust-lang/rust#110771 is addressed r? `@Amanieu`
Revert panic oom This temporarily reverts rust-lang/rust#109507 until rust-lang/rust#110771 is addressed r? `@Amanieu`
Revert panic oom This temporarily reverts rust-lang/rust#109507 until rust-lang/rust#110771 is addressed r? `@Amanieu`
OOM is now reported as a panic but with a custom payload type (
AllocErrorPanicPayload
) which holds the layout that was passed tohandle_alloc_error
.This should be review one commit at a time:
AllocErrorPanicPayload
and changes allocation errors to always be reported as panics.#[alloc_error_handler]
and thealloc_error_hook
API.ACP: rust-lang/libs-team#192
Closes #51540
Closes #51245