tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
83.67k stars 2.51k forks source link

[bug] Main process not closing properly #9170

Closed WhyFenceCode closed 7 months ago

WhyFenceCode commented 7 months ago

Describe the bug

When I receive a very specific error and rust and the terminal exit the main process and tauri remain open and need to be killed from the task manager. Error

error: failed to remove file `Path To Old Build`

Caused by:
Access is denied. (os error 5)

Reproduction

Anything that will reproduce the error of being unable to access the place where stuff needs to be built. I found this easy to do by running any process that will lead to the rebuild of the build while running, for me that was removing a dependency from the Cargo.toml while the project was running.

Expected behavior

The main process and window should close when the terminal shows it as exited and the terminal exits.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 122.0.2365.80
    ✔ MSVC: 
        - Visual Studio Build Tools 2022
        - Visual Studio Community 2019
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.15.0
    - pnpm: 8.15.4
    - npm: 9.5.0

[-] Packages
    - tauri [RUST]: 1.6.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.7
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.11

[-] App

Stack trace

No response

Additional context

This occured on a windows machine in vs code with vite as part of the project.

amrbashir commented 7 months ago

Could you please provide a minimal reproduction?

the instructions you provided are not very clear and I can't seem to reproduce on my own.

WhyFenceCode commented 7 months ago

Hi @amrbashir I restarted my pc and the issue no longer occurs so I am unable to do so (I do not know what caused this). The only thing that I can say is that this occurred after editing the dependencies in Cargo.toml while npm run tauri dev was active, but this only occured on tauri projects and only until i restarted.

amrbashir commented 7 months ago

Sounds like it might be a zombie process running and holding lock on the files

gonna close this issue but if it ever arises again and can re-produce, just ping me