aarch64-pc-windows-msvc: safe Rust exits with 0xC0000409 after a caught panic at opt-level=1
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 12/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- compilers, operating-systems
Línea de trabajo
Start by building the reduced main.rs from the issue with -C opt-level=1 -C target-feature=+crt-static on aarch64-pc-windows-msvc and confirm the exit code is 0xC0000409. The likely area is how the panic unwinds through the Mutex guard and catch_unwind at that optimization level, so look at the codegen or unwinding path for those constructs. Done means the reproducer exits successfully at level 1 and the fix is covered by a regression test.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
A safe Rust program on aarch64-pc-windows-msvc catches a panic, prints its last line, then exits with 0xC0000409 at optimization level 1.
I found this while reducing a RustGIS renderer test (original report). This reduced program uses only the standard library:
#![forbid(unsafe_code)]
use std::sync::Mutex;
#[derive(Default)]
struct Cache(Mutex<Option<f32>>);
impl Cache {
fn measure(&self, uncached: impl FnOnce() -> f32) -> f32 {
if let Some(width) = *self.0.lock().unwrap() { return width; }
let width = uncached();
*self.0.lock().unwrap() = Some(width);
width
}
}
fn main() {
let cache = Cache::default();
let failed = std::panic::catch_unwind(|| cache.measure(|| panic!("measurement failed")));
assert!(failed.is_err());
println!("real ok");
}
Compile and run on Windows ARM64:
rustc +1.99.1 --crate-name repro --edition 2024 -C opt-level=1 -C target-feature=+crt-static -C debuginfo=1 main.rs -o repro.exe
.\repro.exe
$LASTEXITCODE
I expected the panic to be caught and the program to exit successfully. The panic hook's message on stderr is expected.
Instead, it prints real ok, then the process exits with -1073740791 (0xC0000409). Removing the cache and catching the panic directly exits successfully. A version that only locks and unlocks a Mutex<()> before calling the panicking callback also exits successfully.
The reduced program and controls were run on GitHub's windows-11-arm runner. Diagnostic run and source artifacts. Each toolchain artifact's 12-mutex-option folder contains this source and its executables. Artifacts expire after seven days; the source above is complete.
The original and reduced programs both exit with 0xC0000409 at opt-level=1, and exit successfully at levels 0, 2, and 3, on all three tested toolchains: stable 1.99.1, beta 1.100.0-beta.7, and nightly 1.101.0-nightly (2026-11-01). Both controls described above exit successfully at level 1 on all three. The failing runs print real ok before exiting.
The diagnostic workflow records process exit codes without failing its job, so its green status does not mean the reproducer passed.
Meta
rustc 1.99.1 (58cf8f9c3 2026-10-13)
binary: rustc
commit-hash: 58cf8f9c35b355199727627d07ae34a4e2846d67
commit-date: 2026-10-13
host: aarch64-pc-windows-msvc
release: 1.99.1
LLVM version: 23.1.1
Beta:
rustc 1.100.0-beta.7 (fd8e211ae 2026-10-17)
binary: rustc
commit-hash: fd8e211ae301c84a86d13cf52a6d3ce08c589e2e
commit-date: 2026-10-17
host: aarch64-pc-windows-msvc
release: 1.100.0-beta.7
LLVM version: 23.1.4
Nightly:
rustc 1.101.0-nightly (3e92e1a2d 2026-11-01)
binary: rustc
commit-hash: 3e92e1a2d20b991ef23a6c6064c34d57ee8c98d3
commit-date: 2026-11-01
host: aarch64-pc-windows-msvc
release: 1.101.0-nightly
LLVM version: 23.1.5
- Lenguaje dominante
- Rust
- Estrellas
- 121k
- Forks
- 17.3k
- Merge medio
- 2 d 21 h
- PR fusionados (30 d)
- 531
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rust-lang/rust
-
A-run-make relnotes relnotes-needs-review relnotes-tracking-issue T-lang T-libs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
relnotes relnotes-needs-review relnotes-tracking-issue T-compiler T-libs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
A-LLVM O-Arm O-UEFI O-x86_64 relnotes relnotes-needs-review relnotes-tracking-issue T-compiler
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
rust-lang/rust#165504 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
relnotes relnotes-tracking-issue T-libs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
unclear wording in vec macroPosiblemente ocupada @Suhird la tomó hace 5 días. AbiertoA-docs A-slice-vec T-libs
Dificultad 1/5 1-3 horas Aptitud para principiantes 70/100
rust-lang/rust#165360 · 6 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de rust-lang/rust
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
bytecodealliance/rustix#1736 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
longbridge/gpui-kit#3871 ·
Los mantenedores suelen responder en 1 día
-
area:models enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
fix v1 repository metadataAbiertogood first issue help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
servo/rust-smallvec#864 ·