rust-lang / rust-lang/rust

rustc 1.90.0 (stable) crashes in llvm::MergedLoadStoreMotionPass on Windows

Open
#148,067 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-LLVM C-bug I-crash O-windows T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I've encountered a compiler crash (Access Violation) on the stable-x86_64-pc-windows-msvc toolchain when compiling a crate with percent-encoding="2.3.2".

Triggered by doing:

cargo new test_percent_bug
cd test_percent_bug

cargo add percent-encoding@=2.3.2

cargo build --release

This happens in many libraries, not just this one, I just chose one randomally out of the ones that failed to build.

This bug is not present in nightly-x86_64-pc-windows-msvc.

> rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: checking for self-update

   stable-x86_64-pc-windows-msvc unchanged - rustc 1.90.0 (1159e78c4 2025-09-14)
  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.92.0-nightly (6501e64fc 2025-10-23)
Meta

rustc --version --verbose:

rustc 1.90.0 (1159e78c4 2025-09-14)
binary: rustc
commit-hash: 1159e78c4747b02ef996e55082b704c09b970588
commit-date: 2025-09-14
host: x86_64-pc-windows-msvc
release: 1.90.0
LLVM version: 20.1.8
Error output
error: could not compile `percent-encoding` (lib)

Caused by:
  process didn't exit successfully: `C:\Users\GalHo\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name percent_encoding --edition=2018 C:\Users\GalHo\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\percent-encoding-2.3.2\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=119 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg "feature=\"alloc\"" --cfg "feature=\"default\"" --cfg "feature=\"std\"" --check-cfg cfg(docsrs,test) --check-cfg "cfg(feature, values(\"alloc\", \"default\", \"std\"))" -C metadata=16a8a5cf8d000ba1 -C extra-filename=-165dc59d939f699e --out-dir D:\Users\GalHo\Downloads\test_percent_buf\target\release\deps -C strip=debuginfo -L dependency=D:\Users\GalHo\Downloads\test_percent_buf\target\release\deps --cap-lints allow` (exit code: 0x80004005)
WinDbg Analysis (!analyze -v)
*******************************************************************************
* *
* Exception Analysis                                   *
* *
*******************************************************************************

FAILURE_BUCKET_ID:  INVALID_POINTER_WRITE_c0000005_rustc_driver-c3ae95a1becf2161.dll!llvm::MergedLoadStoreMotionPass::run

EXCEPTION_RECORD:  (.exr -1)ExceptionAddress: 00007ffc6c174ed4 (rustc_driver_c3ae95a1becf2161!llvm::MergedLoadStoreMotionPass::run+0x0000000000000564)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000001
   Parameter[1]: ffffffffeff9f8e7
Attempt to write to address ffffffffeff9f8e7

FAULTING_THREAD:  4670

PROCESS_NAME:  rustc.exe
...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the crash with the listed cargo new, cargo add percent-encoding@=2.3.2, and cargo build --release commands on stable-x86_64-pc-windows-msvc, then compare with nightly. Start by investigating llvm::MergedLoadStoreMotionPass::run using the supplied WinDbg failure details; done means the affected release build no longer crashes and the behavior is checked against nightly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.