rio icon indicating copy to clipboard operation
rio copied to clipboard

[Windows] Freeze / Crash on startup

Open freijon opened this issue 3 months ago • 5 comments

When I try to start rio on Windows (installed through scoop) I only get a white window for a few seconds and then the app disappears. The app used to work in the past but now doesn't. It happened with version 0.5.5 and still happens with 0.5.8.

There is no error or stdout/stderr. The exit code is shown as -1073741819 or 5 (when trying to launch from WSL).

I tried to remove my config / theme which had no impact.

Please assist.

freijon avatar Aug 04 '26 05:08 freijon

Thanks for the report. Exit code -1073741819 is 0xC0000005 (access violation) — the "5" you see from WSL is the same status truncated to 8 bits, so this is a native crash rather than a normal error, which is why there's no output. A few things would help pinpoint it:

  1. Enable trace logging and attach the log. In %LOCALAPPDATA%\rio\config.toml set:

    [developer]
    log-level = "TRACE"
    enable-log-file = true
    

    then run rio once and copy %LOCALAPPDATA%\rio\log\rio.log before launching rio again (the file is truncated on every start). Where the log stops tells us how far startup got: font init, renderer init, and pty spawn are all logged.

  2. A/B test the shell: does rio.exe -e cmd.exe stay alive while your default PowerShell crashes? Also: do you use a prompt like oh-my-posh/starship, or a non-English (localized) PowerShell? That would point at the text-decode path.

  3. If both crash: what GPU/driver do you have, and does setting the env var WGPU_BACKEND=gl (or dx12) change anything? Windows Event Viewer then Windows Logs then Application should also have an "Application Error" entry naming the faulting module (rio.exe vs. a driver DLL), that name alone would settle a lot.

In the meantime I've audited the changes between 0.4.x and 0.5.x and found (and fixed) two memory-safety issues on paths that run at startup on Windows; the fixes will be in the next release, so it's worth retrying once that's out even before the info above.

raphamorim avatar Aug 04 '26 07:08 raphamorim

Thank you for the very good info!

  1. Here is the logfile: rio.log
  2. The command rio.exe -e cmd.exe shows no difference, same behavior. I just checked my config and there [shell] section is the default one (it's commented out).
  3. Success! With both options, WGPU_BACKEND=gl and dx12 rio starts successfully.

freijon avatar Aug 04 '26 10:08 freijon

i also confirm that WGPU_BACKEND is the workaround to work on windows

phineas-pta avatar Aug 05 '26 09:08 phineas-pta

Both WGPU_BACKEND=gl and WGPU_BACKEND=dx12 for 0.5.19 work on my Windows 11 (intel 10500T and i7-1185G7).

liaoya avatar Aug 07 '26 04:08 liaoya

Same crash here on Rio 0.5.28 (Windows 11 build 26200). Event Viewer names the faulting module:

  • Application Error: rio.exe 0.5.28.0, faulting module amdvlk64.dll 32.0.21045.5002, exit status 0xC000041D

Setup: three AMD adapters on two different AMD driver packages, each registering its own Vulkan ICD (VulkanDriverName per adapter):

  • Ryzen 9000 iGPU (Granite Ridge): Adrenalin 26.8.1 / 32.0.21045.5002, amdvlk64 9.2.10.353
  • RX 580 (Polaris): 31.0.12027.9001 (2023 package, Polaris isn't in 26.x), amdvlk64 9.2.10.233
  • RX 6800 XT: was on the 2023 package when this was captured

Results (7 s launch each):

Launch Result
default crash 0xC000041D in amdvlk64.dll
WGPU_BACKEND=dx12 works
VK_DRIVER_FILES=<only the 2023 amd-vulkan64.json> works

So the crash comes from the newer AMD Vulkan ICD being loaded while wgpu enumerates adapters, probably triggered by mixed AMD driver versions in one system. Since dx12 fixes every report in this thread, would you consider defaulting to the DX12 backend on Windows (or not enumerating Vulkan unless renderer.backend = "Vulkan" is set)?

  1. The crash went away once the 6800 XT got the newer driver. That pins it down further. It crashed when the 6800 XT and RX 580 were on the old driver and the CPU's graphics on the new one. It stopped once the 6800 XT matched the new driver, even with the RX 580 still on the old one. So the trigger seems to be the newer Vulkan driver meeting a card that runs the older driver.
  2. The dx12 workaround turns off transparency. With WGPU_BACKEND=dx12, window.opacity and blur do nothing; the window is fully opaque. They work with gl and Vulkan. Anyone using the workaround should know.

taonos avatar Oct 04 '26 01:10 taonos