fix(desktop): log WebKitWebProcess termination instead of silent freeze (#4359) - #4360
Open
iroiro147 wants to merge 1 commit into
Open
fix(desktop): log WebKitWebProcess termination instead of silent freeze (#4359)#4360iroiro147 wants to merge 1 commit into
iroiro147 wants to merge 1 commit into
Conversation
…ze (block#4359) When the WebKitGTK renderer process dies (upstream PipeWire/GStreamer segfault, OOM, WebKit bug — e.g. block#4358), the main buzz-desktop and WebKitNetworkProcess processes stay alive with no renderer, so the window reads as a freeze with no crash dialog and no log output. WebKitGTK emits web-process-terminated for exactly this case. Install a sibling handler next to the existing getUserMedia permission hook in linux_media.rs (wired from lib.rs on_webview_ready) that logs the WebProcessTerminationReason, so a renderer crash surfaces as a diagnosable log line. Detect+readback half of block#4359; renderer-recovery behavior is the design call flagged there and is intentionally left out. Verified: host cargo check + clippy clean (macOS stub path); the Linux cfg body uses webkit2gtk 2.0.2 WebViewExt::connect_web_process_terminated (same trait as the existing connect_permission_request), gated v2_20, enabled by the pinned v2_22 feature. Linux compile path to be confirmed by CI. Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Installs a
web-process-terminatedhandler on the Linux WebKitGTK webview so a renderer (WebKitWebProcess) crash surfaces as a diagnosable log line instead of a silent dead window.This is the detect + readback half of #4359. The renderer-recovery behavior (auto-reload vs. a "click to restart" affordance) is the one design call flagged in #4359 and is intentionally out of scope here — this PR only makes the crash observable, which is non-controversial and independently useful.
Why
Surfaced by the diagnosis in #4358: when the renderer dies (upstream PipeWire/GStreamer segfault, OOM, or a WebKit bug), the main
buzz-desktopprocess andWebKitNetworkProcessstay alive with no renderer, so the window reads as a freeze — no crash dialog, no log line, no recovery path. WebKitGTK emits a purpose-builtweb-process-terminatedsignal; Buzz installed no handler for it (verified: zero references indesktop/src-tauri).How
desktop/src-tauri/src/linux_media.rs: newinstall_web_process_terminated_handler, a sibling of the existingenable_media_capture. Same idiom —webview.with_webview(|pw| pw.inner())then aWebViewExt::connect_*call, with the module'seprintln!("buzz-desktop: ...")logging and#[cfg]-gated real impl + no-op stubs.desktop/src-tauri/src/lib.rs: wire it inon_webview_ready, right afterenable_media_capture.The handler logs
WebProcessTerminationReason(Crashed/ExceededMemoryLimit/TerminatedByApi), so reports like #4358 gain a concrete reason line instead of an unexplained hang.Verification / honest caveats
cargo check --libandcargo clippy --libare clean — but on macOS, which compiles the#[cfg(not(target_os = "linux"))]stub, not the real body.webkit2gtk 2.0.2crate source:connect_web_process_terminatedis onWebViewExt(web_view.rs:6240, the same trait that owns the existingconnect_permission_requestat :5815),#[cfg_attr(docsrs, doc(cfg(feature = "v2_20")))]— enabled by thev2_22feature pinned inCargo.toml. Closure signatureFn(&Self, WebProcessTerminationReason)matches.Testing
cargo check --lib(host/macOS stub path)cargo clippy --lib(host/macOS stub path)WebKitWebProcesson a Linux build, confirm thebuzz-desktop: WebKitWebProcess terminated (reason: …)line appearsFixes #4359 (detect + readback half).