Skip to content

__rust_alloc can no longer be used to provide a custom allocator #139265

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
anforowicz opened this issue Apr 2, 2025 · 3 comments
Closed

__rust_alloc can no longer be used to provide a custom allocator #139265

anforowicz opened this issue Apr 2, 2025 · 3 comments
Labels
A-allocators Area: Custom and system allocators C-bug Category: This is a bug. P-critical Critical priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@anforowicz
Copy link
Contributor

As discussed in #127173 (comment) Chromium’s update of the Rust toolchain is blocked, because of how __rust_alloc and similar symbols are expected to be mangled going forward. I have opened rust-lang/compiler-team#858 for the long-term, officially-supported solution for __rust_alloc, but in the meantime @bjorn3 suggested authoring and merging a temporary exception for mangling of the allocator symbols.

IIUC Chromium currently depends on the spelling of the following symbols:

  • __rust_no_alloc_shim_is_unstable
  • __rust_alloc
  • __rust_dealloc
  • __rust_realloc
  • __rust_alloc_zeroed
  • __rust_alloc_error_handler
  • __rust_alloc_error_handler_should_panic

/cc @chbaker0, @alanzhao1, @zmodem from Chromium

@anforowicz anforowicz added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Apr 2, 2025
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 2, 2025
@chbaker0
Copy link
Contributor

chbaker0 commented Apr 2, 2025

Seems like #86844 is related

@apiraino
Copy link
Contributor

apiraino commented Apr 3, 2025

Assigning priority (discussion on Zulip).

@rustbot label -I-prioritize +P-critical

@rustbot rustbot added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 3, 2025
@anforowicz
Copy link
Contributor Author

IIUC Chromium has been able to successfully apply a workaround that has been discussed in https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/.60-Zemit-code-for-final-artifact-to-link.60.20.E2.80.A6.20compiler-team.23858/with/510973829. So this issue can probably closed at this point.

@apiraino apiraino removed the regression-untriaged Untriaged performance or correctness regression. label Apr 9, 2025
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. P-critical Critical priority A-allocators Area: Custom and system allocators and removed P-critical Critical priority needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 10, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-allocators Area: Custom and system allocators C-bug Category: This is a bug. P-critical Critical priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants