-
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
Tests crash from inappropriate use of common linkage #113807
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cjgillot (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I won't have time to review this before a week. |
I don't really understand the implications here |
The external linkage you already get for |
Sure. Do you have a suggestion for what the output should be for this issue? Maybe we can mimic what clang does, or report the error in rustc? @bjorn3 |
Common linkage with non-zero initializer is just invalid. For an internal feature there is no need to have diagnostics. There are many ways to crash rustc using internal features. |
I think I agree with @bjorn3, since the feature is unstable (and marked perma-unstable at this time by the lang team) we should just offer the full range of LLVM options to the user. Perhaps the best thing to do right now to close #109861 would be to just add a test that verifies we continue to hit the LLVM assertion? That would at least tell us if the behavior changes in the future. |
Sounds reasonable! Will do. |
r? @wesleywiser |
Could not assign reviewer from: |
☔ The latest upstream changes (presumably #115193) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
This looks good, thanks @mojingran! Happy to merge after rebase 🙂
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.
Please don't add issues/issue-xxxxxx.rs
-named tests, and instead move the test to a more suited directory and name it accordingly.
@mojingran could you please also squash the commits together? |
cdc73c7
to
1e80c33
Compare
Normally, variables with common linkage must be zero-initialized. In Rust, common linkage variables that are not zero-initialized causes a crash in the compiler backend. This commit adds a test case to confirm this behavior, which will inform us if it changes in the future.
@WaffleLapkin Can this be merged now? |
@bors r+ rollup |
Thanks for r+'ing @WaffleLapkin! @mojingran just FYI for future reference, force pushing your PR doesn't generate a notification to the reviewers so feel free to leave a comment saying you force pushed 🙂 |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#113807 (Tests crash from inappropriate use of common linkage) - rust-lang#115358 (debuginfo: add compiler option to allow compressed debuginfo sections) - rust-lang#115630 (Dont suggest use between `use` and cfg attr) - rust-lang#115662 (Improve "associated type not found" diagnostics) - rust-lang#115673 (Fix sanitize/cfg.rs test) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#113807 - mojingran:master, r=WaffleLapkin Tests crash from inappropriate use of common linkage Follows up my proposal under the [tracking issue for the linkage feature](rust-lang#29603 (comment)). Adds test for [issue 109681](rust-lang#109681).
Follows up my proposal under the tracking issue for the linkage feature. Adds test for issue 109681.