Skip to content

Improve diagnostic for link.exe special case exit code 0xc0000409 (STATUS_STACK_BUFFER_OVERRUN) #143133

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vangata-ve
Copy link

@vangata-ve vangata-ve commented Jun 28, 2025

Fixes #141757.

Adds note for when link.exe exits with code 0xc0000409

@rustbot
Copy link
Collaborator

rustbot commented Jun 28, 2025

r? @compiler-errors

rustbot has assigned @compiler-errors.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 28, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@jieyouxu
Copy link
Member

This might be challenging, but, is it possible to have a ui test for this diagnostic?

@vangata-ve
Copy link
Author

I'll see what I can do

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 30, 2025
@vangata-ve
Copy link
Author

Holy! I accidentally misclicked. I should've commited the ui tests not this. I'll fix it when I get home

@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 30, 2025
@vangata-ve
Copy link
Author

vangata-ve commented Jul 1, 2025

So, I had the idea to build a dummy linker (via aux-bin) that always simulates a __fastfail termination, and pass it to -Clinker using the compiler-flags directive. The problem is that the relevant note only gets emitted when is_msvc_link_exe is true (link to source), which the dummy linker doesn't satisfy.

One option is to move the note outside the is_msvc_link_exe check, so it shows up regardless of whether the toolchain is MSVC or not. That way the testcase works and passes correctly.

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

Please squash this into one commit.

Also, maybe worth to get the review of someone who knows a bit more about windows...

r? @ChrisDenton

@compiler-errors
Copy link
Member

@rustbot author

for squashing into one commit

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@ChrisDenton
Copy link
Member

LGTM but it seems we have two PRs for the same issue. See also #141828.

…K_BUFFER_OVERRUN)

Tweak __fastfail termination note text to clarify behavior

Move __fastfail termination diagnostic emission outside MSVC toolchain check to enable testing

Since the ui tests cannot satisfy the MSVC toolchain check - hence making this behavior untestable.

Add UI test for __fastfail termination (0xc0000409) linker diagnostic note

Fix formatting
@rustbot
Copy link
Collaborator

rustbot commented Jul 17, 2025

⚠️ Warning ⚠️

@vangata-ve
Copy link
Author

vangata-ve commented Jul 17, 2025

Yep. It turns out theres a second issue report with a fix PR that duplicates the one I addressed in my PR. Also I squashed the commits.

@vangata-ve
Copy link
Author

@rustbot ready

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 17, 2025
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Special case STATUS_STACK_BUFFER_OVERRUN in linker exit code diagnostics
6 participants