tauri-apps / tauri

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

[bug] tauri dev periodically crashes with no stack trace or log #8284

Open lightsing opened 9 months ago

lightsing commented 9 months ago

Describe the bug

When run tauri dev, it crashes periodically without any log/stacktrace.

Project source: https://github.com/lightsing/PromptStudio

Reproduction

  1. clone the repo and run pnpm install
  2. set the RUST_LOG=trace and RUST_BACKTRACE=1
  3. run pnpm tauri dev
  4. keep make changes to react sources

Expected behavior

at some point, it will crash or the window disappears

the console will print things like:

ELIFECYCLE  Command failed with exit code 4xxxxxxxxxxx.
ELIFECYCLE  Command failed with exit code 3xxxxxxxxxxx.

there won't be any like Rust panic traces or any ERROR level log.

The log will also store in %localappdata%\lightsing\gpt-editor\cache

Platform and versions

[✔] Environment
    - OS: Windows 10.0.22000 X64
    ✔ WebView2: 119.0.2151.72
    ✔ MSVC: 
        - Visual Studio Community 2019
        - Visual Studio Community 2022
    ✔ rustc: 1.74.0 (79e9716c9 2023-11-13)
    ✔ cargo: 1.74.0 (ecb9851af 2023-10-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (directory override for 'D:\workspace\gpt-editor')
    - node: 19.2.0
    - pnpm: 8.10.5
    - yarn: 1.22.10
    - npm: 9.6.5

[-] Packages
    - tauri [RUST]: 1.5.2
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.4
    - tao [RUST]: 0.16.5
    - tauri-cli [RUST]: 1.4.0
    - @tauri-apps/api [NPM]: 1.5.1
    - @tauri-apps/cli [NPM]: 1.5.6

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

N/A

Additional context

No response

lightsing commented 9 months ago

Note, there are two of ELIFECYCLE  Command failed when the bug occurs

FabianLars commented 9 months ago

I wonder if it's related to https://github.com/tauri-apps/tauri/issues/8183 🤔 So far i wasn't able to make your project crash on my machine though.

Jamzy01 commented 9 months ago

I'm not sure if it's the same issue, but I'm having a similar problem as well. I'm 90% sure it only happens when my app is using a fair number of resources (something like 40% CPU utilization), which is common when you're working on an app and often write bugs that have terrible performance costs. My app will just crash and say this: Warn Sending fatal alert BadCertificate

image

No idea what it means, couldn't find anything whatsoever on the internet, and I don't know how to fix it.

lightsing commented 9 months ago

I'm not sure if it's the same issue, but I'm having a similar problem as well. I'm 90% sure it only happens when my app is using a fair number of resources (something like 40% CPU utilization), which is common when you're working on an app and often write bugs that have terrible performance costs. My app will just crash and say this: Warn Sending fatal alert BadCertificate

image

No idea what it means, couldn't find anything whatsoever on the internet, and I don't know how to fix it.

Not quite same, I didn't see output like Warn Sending fatal alert BadCertificate or any other log

0rvar commented 9 months ago

Might be related to #8177

Jamzy01 commented 9 months ago

Might be related to #8177

Why do you think it might be related to #8177?

I only ask because my app uses events very heavily. To give you an idea of just how heavily, I'm making a file explorer app which uses tauri events to send file system update events to the frontend. If I were to guess, in some cases upwards of 20 file system events would be being sent in only a second (this is especially bad in react strict mode).

0rvar commented 9 months ago

@Jamzy01 try the mitigation I described here: https://github.com/tauri-apps/tauri/issues/8177#issuecomment-1846738680

danblock97 commented 8 months ago

@Jamzy01 try the mitigation I described here: https://github.com/tauri-apps/tauri/issues/8177#issuecomment-1846738680

I've just tried this. Before and after running 'npm run tauri dev' it results in a BSOD saying APC_INDEX_MISMATCH

Jamzy01 commented 8 months ago

@Jamzy01 try the mitigation I described here: #8177 (comment)

I've just tried this. Before and after running 'npm run tauri dev' it results in a BSOD saying APC_INDEX_MISMATCH

It worked just fine for me. Although I can't test if it actually fixed the issue since my app isn't currently in a state where I can test it; additionally, it only happened randomly, so it's not easy for me to reproduce.

danblock97 commented 8 months ago

@Jamzy01 try the mitigation I described here: #8177 (comment)

I've just tried this. Before and after running 'npm run tauri dev' it results in a BSOD saying APC_INDEX_MISMATCH

Think this was a system issue for myself actually - No issues now