Skip to content

STATUS_STACK_BUFFER_OVERRUN on Windows 11 when using rust-lld with dylib #100519

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
afonsolage opened this issue Aug 14, 2022 · 2 comments
Open
Labels
A-linkage Area: linking into static, shared libraries and binaries A-linkers Area: linkers... you gotta love linkers C-bug Category: This is a bug. O-windows Operating system: Windows S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@afonsolage
Copy link

On Windows 11 when linking a dylib which uses XInput1_4.dll using rust-lld the compiled binary will crash will a message: STATUS_STACK_BUFFER_OVERRUN.

This issue was originally reported on Bevy project: bevyengine/bevy#2921

Here is a minimal example that reproduces the error: https://github.com/afonsolage/xinput_link_example

error: process didn't exit successfully: `target\debug\xinput_link_example.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)

The error won't happens when using MSVC link.exe

Meta

rustc --version --verbose:

rustc 1.65.0-nightly (75b7e52e9 2022-08-13)
binary: rustc
commit-hash: 75b7e52e92c3b00fc891b47f5b2efdff0a2be55a
release: 1.65.0-nightly
LLVM version: 15.0.0

Windows version:

Edition:	Windows 11 Home Single Language
Version:	22H2
Installed:	‎16/‎07/‎2022
OS Build:	22622.575
Experience:	Windows Feature Experience Pack 1000.22634.1000.0
@afonsolage afonsolage added the C-bug Category: This is a bug. label Aug 14, 2022
@ehuss ehuss added the O-windows Operating system: Windows label Oct 25, 2022
@rscarson
Copy link

I am experiencing the same issue

rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-pc-windows-msvc
release: 1.81.0
LLVM version: 18.1.7

@ChrisDenton
Copy link
Member

Could you try with nightly?

@jieyouxu jieyouxu added S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-linkers Area: linkers... you gotta love linkers labels Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-linkers Area: linkers... you gotta love linkers C-bug Category: This is a bug. O-windows Operating system: Windows S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. 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