Skip to content

desktop: log which webview library actually loaded - #1459

Open
hisco wants to merge 1 commit into
mainfrom
rad-304-desktop-crash-context
Open

desktop: log which webview library actually loaded#1459
hisco wants to merge 1 commit into
mainfrom
rad-304-desktop-crash-context

Conversation

@hisco

@hisco hisco commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Why

Chasing a desktop crash on Ubuntu (#1360) meant asking the reporter which WebKitGTK build they had, because nothing in the app said so. Which rendering bugs apply depends entirely on that, and it is the first thing anyone needs.

What

One line at startup on Linux:

[desktop] webview: libwebkit2gtk-4.1.so.0.13.6

Read from the process's own mappings, so it reports the library that was actually loaded rather than what the package manager thinks is installed. The lookup already exists for the diagnostics snapshot; this exposes it early enough for the startup log, which is what lands in the journal excerpt people paste into bug reports — and what they can still reach when the app will not stay open.

Passive. No behaviour change, no UI, nothing to opt into.

Scope

This PR previously also carried a crash-versus-quit signal built on marker files. That half is now split out: it went through four review rounds and each one found a correctness bug in it, while this part drew none. It is not worth holding a fifteen-line, zero-finding change behind it, so the marker work will be proposed separately and judged on its own.

Testing

Covered by the existing internal/desktopenv tests, including a fixture for the GTK4-generation library name. Builds clean for linux, windows and darwin.

https://claude.ai/code/session_01KEyZgyPtfpXdbWqPPsTXZe


Note

Low Risk
Logging-only refactor with no behavior or security changes; failure to read maps simply omits the line.

Overview
Linux desktop startup logging now prints which webview .so is actually mapped into the process (from /proc/self/maps), so journal excerpts name the WebKitGTK build without manual ldd or package-manager guesses.

desktopenv exposes a new WebviewLibrary() API that reuses the existing maps scan (via a small webviewLibrary() wrapper) so logBootEnv can log early; diagnostics Collect() uses the same helper instead of calling the maps parser inline. Non-Linux builds return an empty string.

Reviewed by Cursor Bugbot for commit 4c34edf. Bugbot is set up for automated code reviews on this repo. Configure here.

@hisco
hisco requested a review from nadaverell as a code owner August 19, 2026 14:33
Comment thread cmd/desktop/app.go Outdated
@hisco
hisco changed the base branch from rad-304-desktop-diagnostics to main August 19, 2026 14:37
@hisco hisco closed this Aug 19, 2026
@hisco hisco reopened this Aug 19, 2026
@hisco
hisco force-pushed the rad-304-desktop-crash-context branch from c52fa01 to 50693ed Compare August 19, 2026 14:49
Comment thread cmd/desktop/session_marker.go Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit db0ab59. Configure here.

Comment thread cmd/desktop/session_marker.go Outdated
Comment thread cmd/desktop/session_marker.go Fixed
Comment thread cmd/desktop/session_marker.go Fixed
Comment thread cmd/desktop/session_marker.go Fixed
Comment thread cmd/desktop/session_marker.go Fixed
Comment thread cmd/desktop/session_marker.go Fixed
Comment thread cmd/desktop/session_marker.go Fixed
Which rendering bugs apply to a Linux desktop session depends on the WebKitGTK
build, and it had to be asked for by hand on every report. The package
manager's answer is not necessarily the library that got loaded, so this reads
the process's own mappings.

The lookup already exists for the diagnostics snapshot. Exposing it early
enough for the startup log puts it in the journal excerpt users paste into bug
reports, which is what they can reach when the app will not stay open.

Claude-Session: https://claude.ai/code/session_01KEyZgyPtfpXdbWqPPsTXZe
@hisco
hisco force-pushed the rad-304-desktop-crash-context branch from ba79c41 to 4c34edf Compare August 19, 2026 16:04
@hisco hisco changed the title desktop: record how the previous run ended, and which webview loaded desktop: log which webview library actually loaded Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants