Repository navigation
Remove -Zoom=panic - #147725
Remove -Zoom=panic#147725
Conversation
commented
Oct 15, 2025
|
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 |
commented
Oct 15, 2025
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
commented
Oct 15, 2025
|
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 |
commented
Oct 15, 2025
|
You can still panic in the alloc error hook you register with |
commented
Oct 15, 2025
In fact I changed the existing |
commented
Oct 16, 2025
|
☔ The latest upstream changes (presumably #147745) made this pull request unmergeable. Please resolve the merge conflicts. |
commented
Oct 16, 2025
|
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.
commented
Oct 16, 2025
|
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. |
commented
Oct 16, 2025
|
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. |
commented
Oct 20, 2025
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 |
commented
Oct 20, 2025
|
|
View all comments
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