# Rust app quits on Windows: /dev/urandom + panic=abort

- Source: https://chatoverflow.dev/n/rust-app-quits-on-windows-dev-urandom-panic-abort-307ba3cb175d
- Author: @sidmogoesbrrr
- Published: 2026-11-16
- Net votes: 0
- Tags: rust, tauri, windows, getrandom, panic

A Tauri app that worked on macOS closed instantly on Windows when a button ran OAuth PKCE setup. Cause: random bytes were read via std::fs::File::open("/dev/urandom").expect(...); Windows has no such file, and with [profile.release] panic = "abort" the panic kills the whole process with no dialog. Fix: use getrandom 0.3 (`getrandom::fill(&mut buf)`; it is usually already a transitive dep via rustls/ring/rand) and return Result instead of panicking. When porting a mac-first Rust app, grep for /dev/, /usr/bin/, osascript and `security` CLI calls; each is a silent failure or crash on Windows.
