-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Remove -Zoom=panic #147725
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
Remove -Zoom=panic #147725
Conversation
|
The Miri subtree was changed cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in compiler/rustc_codegen_gcc |
This comment has been minimized.
This comment has been minimized.
0bdf920 to
c159b2b
Compare
This comment has been minimized.
This comment has been minimized.
c159b2b to
8800809
Compare
|
Cc @rust-lang/wg-allocators |
|
I've been waiting for At Cloudflare we were waiting for ability to use it in servers. It was part of the RFC https://github.com/rust-lang/rfcs/blob/master/text/2116-alloc-me-maybe.md#user-profile-server. We currently aren't only because we use stable Rust, and have a ton of hacks in place already put in due to suffering from lack of this feature. In some places we do rely on panics from allocators not being totally UB any more. Is removal of |
|
You can still panic in the alloc error hook you register with |
In fact I changed the existing |
|
☔ The latest upstream changes (presumably #147745) made this pull request unmergeable. Please resolve the merge conflicts. |
|
r? @Amanieu maybe |
05a4290 to
0c3cdac
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Reducing the number of symbols used by the global allocation interface is a valid argument, and I do agree that it should be over But the reentrancy concerns aren't a reason to remove oom panic support, because the same exact concerns still exist without oom panic, both panics within the allocator (that don't escape) and unwinds from the alloc (error) handler. Personally I think handling (non-pre-main) OOM through the same panic machinery as standard code panics is the correct thing to do for global general purpose "infallible" allocations, since it's the same general style of "allegedly impossible" error, but I can see logic in saying it's notable enough to use its own specialized machinery, instead of the heavily generic and indirected panic machinery. Consider this a neutral vote from me, I suppose. |
|
By the way the awkward thing with |
Reentrancy from panics within the allocator logic are indeed a tough problem but seem unrelated to OOM since you can already cause reentrancy today by allocating (or calling other non-reentrant code that’s using the allocator) in the panic hook or panic handler. I found such an issue in dlmalloc and I’d be surprised if any other allocator implemented in Rust didn’t have similar issues. Panicking from the alloc error handler or the allocator shim is less problematic for the allocator because at least that’s after all the allocator’s own code has returned (a null pointer) normally. But the rest of the world that’s using the allocator has to deal with the potential reentrancy. |
The global allocator is In any case I don't think the reentrancy issue is all that relevant to this PR. It is an explanation why neither |
|
|
There are major questions remaining about the reentrancy that this allows. It doesn't have any users on github outside of a single project that uses it in a panic=abort project to show backtraces. It can still be emulated through #[alloc_error_handler] or set_alloc_error_hook depending on if you use the standard library or not. And finally it makes it harder to do various improvements to the allocator shim.
7147dbb to
8f55c15
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Show backtrace on allocation failures when possible And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed. Split out of rust-lang/rust#147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
Show backtrace on allocation failures when possible And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed. Split out of rust-lang/rust#147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
Show backtrace on allocation failures when possible And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed. Split out of rust-lang/rust#147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
Show backtrace on allocation failures when possible And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed. Split out of rust-lang/rust#147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
|
This was discussed in the @rust-lang/libs-api meeting. It seems like the way forward is likely going to be removing both @bors r+ |
Remove -Zoom=panic There are major questions remaining about the reentrancy that this allows. It doesn't have any users on github outside of a single project that uses it in a panic=abort project to show backtraces. It can still be emulated through `#[alloc_error_handler]` or `set_alloc_error_hook` depending on if you use the standard library or not. And finally it makes it harder to do various improvements to the allocator shim. With this PR the sole remaining symbol in the allocator shim that is not effectively emulating weak symbols is the symbol that prevents skipping the allocator shim on stable even when it would otherwise be empty because libstd + `#[global_allocator]` is used. Closes rust-lang#43596 Fixes rust-lang#126683
Rollup of 6 pull requests Successful merges: - #147602 (Deduplicate higher-ranked lifetime capture errors in impl Trait) - #147725 (Remove -Zoom=panic) - #148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) - #148717 (Point at span within local macros even when error happens in nested external macro) - #149458 (Run clippy on cg_gcc in CI) - #149816 (Make typo in field and name suggestions verbose) r? `@ghost` `@rustbot` modify labels: rollup
Remove -Zoom=panic There are major questions remaining about the reentrancy that this allows. It doesn't have any users on github outside of a single project that uses it in a panic=abort project to show backtraces. It can still be emulated through `#[alloc_error_handler]` or `set_alloc_error_hook` depending on if you use the standard library or not. And finally it makes it harder to do various improvements to the allocator shim. With this PR the sole remaining symbol in the allocator shim that is not effectively emulating weak symbols is the symbol that prevents skipping the allocator shim on stable even when it would otherwise be empty because libstd + `#[global_allocator]` is used. Closes rust-lang#43596 Fixes rust-lang#126683
Remove -Zoom=panic There are major questions remaining about the reentrancy that this allows. It doesn't have any users on github outside of a single project that uses it in a panic=abort project to show backtraces. It can still be emulated through `#[alloc_error_handler]` or `set_alloc_error_hook` depending on if you use the standard library or not. And finally it makes it harder to do various improvements to the allocator shim. With this PR the sole remaining symbol in the allocator shim that is not effectively emulating weak symbols is the symbol that prevents skipping the allocator shim on stable even when it would otherwise be empty because libstd + `#[global_allocator]` is used. Closes rust-lang#43596 Fixes rust-lang#126683
Rollup of 12 pull requests Successful merges: - #147602 (Deduplicate higher-ranked lifetime capture errors in impl Trait) - #147725 (Remove -Zoom=panic) - #148294 (callconv: fix mips64 aggregate argument passing for C FFI) - #148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) - #149417 (tidy: Detect outdated workspaces in workspace list) - #149458 (Run clippy on cg_gcc in CI) - #149679 (Restrict spe_acc to PowerPC SPE targets) - #149781 (Don't suggest wrapping attr in unsafe if it may come from proc macro) - #149795 (Use `let`...`else` instead of `match foo { ... _ => return };` and `if let ... else return` in std) - #149816 (Make typo in field and name suggestions verbose) - #149824 (Add a regression test for issue 145748) - #149826 (compiletest: tidy up `adb_path`/`adb_test_dir` handling) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 10 pull requests Successful merges: - #147725 (Remove -Zoom=panic) - #148294 (callconv: fix mips64 aggregate argument passing for C FFI) - #148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) - #149458 (Run clippy on cg_gcc in CI) - #149679 (Restrict spe_acc to PowerPC SPE targets) - #149781 (Don't suggest wrapping attr in unsafe if it may come from proc macro) - #149795 (Use `let`...`else` instead of `match foo { ... _ => return };` and `if let ... else return` in std) - #149816 (Make typo in field and name suggestions verbose) - #149824 (Add a regression test for issue 145748) - #149826 (compiletest: tidy up `adb_path`/`adb_test_dir` handling) r? `@ghost` `@rustbot` modify labels: rollup
Show backtrace on allocation failures when possible And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed. Split out of rust-lang/rust#147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
Show backtrace on allocation failures when possible And if an allocation while printing the backtrace fails, don't try to print another backtrace as that will never succeed. Split out of rust-lang#147725 to allow landing this independently of a decision whether or not to remove `-Zoom=panic`.
Rollup merge of #147725 - bjorn3:remove_oom_panic, r=Amanieu Remove -Zoom=panic There are major questions remaining about the reentrancy that this allows. It doesn't have any users on github outside of a single project that uses it in a panic=abort project to show backtraces. It can still be emulated through `#[alloc_error_handler]` or `set_alloc_error_hook` depending on if you use the standard library or not. And finally it makes it harder to do various improvements to the allocator shim. With this PR the sole remaining symbol in the allocator shim that is not effectively emulating weak symbols is the symbol that prevents skipping the allocator shim on stable even when it would otherwise be empty because libstd + `#[global_allocator]` is used. Closes #43596 Fixes #126683
Rollup of 10 pull requests Successful merges: - rust-lang/rust#147725 (Remove -Zoom=panic) - rust-lang/rust#148294 (callconv: fix mips64 aggregate argument passing for C FFI) - rust-lang/rust#148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) - rust-lang/rust#149458 (Run clippy on cg_gcc in CI) - rust-lang/rust#149679 (Restrict spe_acc to PowerPC SPE targets) - rust-lang/rust#149781 (Don't suggest wrapping attr in unsafe if it may come from proc macro) - rust-lang/rust#149795 (Use `let`...`else` instead of `match foo { ... _ => return };` and `if let ... else return` in std) - rust-lang/rust#149816 (Make typo in field and name suggestions verbose) - rust-lang/rust#149824 (Add a regression test for issue 145748) - rust-lang/rust#149826 (compiletest: tidy up `adb_path`/`adb_test_dir` handling) r? `@ghost` `@rustbot` modify labels: rollup
There are major questions remaining about the reentrancy that this allows. It doesn't have any users on github outside of a single project that uses it in a panic=abort project to show backtraces. It can still be emulated through
#[alloc_error_handler]orset_alloc_error_hookdepending on if you use the standard library or not. And finally it makes it harder to do various improvements to the allocator shim.With this PR the sole remaining symbol in the allocator shim that is not effectively emulating weak symbols is the symbol that prevents skipping the allocator shim on stable even when it would otherwise be empty because libstd +
#[global_allocator]is used.Closes #43596
Fixes #126683