Skip to content
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

The combination of alloc_error_handler and target_features_11 is unsound #134234

Open
Tracked by #51540
veluca93 opened this issue Dec 12, 2024 · 0 comments
Open
Tracked by #51540
Labels
C-bug Category: This is a bug. F-target_feature_11 target feature 1.1 RFC I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@veluca93
Copy link
Contributor

The following code compiles:

#![feature(target_feature_11, alloc_error_handler)]

#[target_feature(enable = "avx")]
#[alloc_error_handler]
fn f(_: std::alloc::Layout) -> ! {
    panic!()
}

However, this is unsound if the allocation error handler is invoked on a machine that does not support avx.

The alloc_error_handler feature is still unstable, tracking issue: #51540

This issue emerged during the stabilization PR for target_features_11: #134090

@veluca93 veluca93 added the C-bug Category: This is a bug. label Dec 12, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 12, 2024
@bjorn3 bjorn3 added I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness requires-nightly This issue requires a nightly compiler in some way. F-target_feature_11 target feature 1.1 RFC labels Dec 13, 2024
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-target_feature_11 target feature 1.1 RFC I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness requires-nightly This issue requires a nightly compiler in some way. 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

4 participants