Skip to content

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

@afonsolage

Description

@afonsolage

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesA-linkersArea: linkers... you gotta love linkersC-bugCategory: This is a bug.O-windowsOperating system: WindowsS-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions