Replies: 2 comments
-
|
The stack trace points to a crash inside A few things to try: 1. Build with debug symbols to get a readable stack trace: # Cargo.toml
[profile.release]
debug = true
strip = falseThen run with 2. Check if it's a threading issue — 3. The Android crash confirms it's not platform-specific — which points to your Rust code rather than a webkit/GTK issue. Look at how you're passing data from the mDNS discovery callbacks back to the frontend. If you're holding a reference to something that gets dropped, the serialization in the IPC layer will segfault. 4. Try isolating the problem: # Build without mDNS features first
# Comment out the scan/serve commands and see if the app at least stays aliveIf the app works fine in release without the mDNS commands, the issue is in how mdns-sd interacts with the Tauri runtime in release mode (optimizations can reorder operations that happen to work in debug). Can you share the relevant command signatures from |
Beta Was this translation helpful? Give feedback.
-
|
I looked through the repo. I would not start with WebKit here; there are a couple of concrete Rust-side issues that can explain the "works in dev, core dumps in release" behavior. The biggest one is your release profile: [profile.release]
panic = "abort"
strip = trueWith There are several panics reachable from the buttons you mentioned, for example: tokio::spawn(async move { ... }) // in a sync Tauri commandinside I would first change the background tasks to use Tauri's runtime instead of plain tauri::async_runtime::spawn(async move {
while let Some(incoming_conn) = endpoint.accept().await {
// ...
}
});Then remove the panicking calls on the invoke path and return [profile.release]
debug = true
strip = false
panic = "unwind"so you get the actual panic message instead of an abort. There is a second issue in I would make #[tauri::command]
pub fn scan(app: tauri::AppHandle, discovery: Discovery) -> Result<(), String> {
{
let state = app.state::<Mutex<AppState>>();
state.lock().map_err(|_| "state lock failed")?.discovery = discovery;
}
if matches!(discovery, Discovery::On) {
let app = app.clone();
tauri::async_runtime::spawn_blocking(move || {
if let Err(err) = find_device_receiver::recv_search(&app) {
eprintln!("scan failed: {err}");
}
});
}
Ok(())
}and inside So the short checklist I would try:
My guess is the release build is not exposing a WebKit bug; it is aborting on a Rust panic, and the release profile makes that look like a native crash. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am making a file sharing app in tauri (ofc) and it works correctly in development mode but when i build it and open it the window opens and when i try to invoke any function it just freezes for sometime and then closes with the error Segmentation fault (core dumped)
App Repo: https://github.com/Parth2684/velocity .
My machine:
OS ➜ Arch Linux x86_64
Kernel ➜ Linux 6.19.14-arch1-1
WM ➜ niri 26.04
CPU ➜ AMD Ryzen 5 3500U (8) @ 2.10 GHz
GPU ➜ AMD Radeon Vega 8 Graphics [Integrated]
RAM ➜ 5.70GiB
SWAP ➜ 12.00 GiB
Storage ➜ 467.4 GiB
I first thought it was a arch related issue as there were some i found on internet and i tried to build it with ENV NO_STRIP=true and on docker(base image node:lts can be found in the repo root) but i still faced the same errors. (I have also tried cleaning cargo cache, cargo clean, deleteing target folder, etc)
Image when Application startes in dev mode and also in build mode

OTP seen in dev mode after i click on serve device

How to Recreate The Issue
But when i build the application(bun tauri build --no-bundle), start it using RUST_BACKTRACE=1 ./tartget/release/Velocity and tap on serve device it freezes and prints Segmentation fault (core dumped) or even if i do scan devices it does the same thing (in dev mode it currently prints to the terminal other events of mdns-sd or if a device is found then it JSON.stringifies the thing and shows on screen [Note: it does not freeze or exits])
I have some journalctl logs which I can't really understand:
[🡕] Process 57885 (velocity) of user 1000 dumped core.
lines 1-46...skipping...
May 06 14:02:12 archlinux systemd-coredump[58256]: [🡕] Process 57885 (velocity) of user 1000 dumped core.
Code for serving device can be found in the repo at : velocity/src-tauri/src/commands/connect_server.rs.rs and velocity/src-tauri/src/commands/helpers/find_device_sender.rs
Code for searching devices can be found in the repo at: velocity/src-tauri/src/commands/scan_devices.rs and velocity/src-tauri/src/commands/helpers/find_device_receiver.rs
Also I tried to build on android(bun tauri android build and signing the app later before installation) and the same thing happens on my phone (OnePlus 6T) the app opens but crashes as soon as I try to invoke any function by tapping any button
Happy to know if you too faced this issue and how'd you solve it or is it just me issue or a tauri issue
(also sorry for such a bad frontend it is not yet finished)
Beta Was this translation helpful? Give feedback.
All reactions