Repository navigation
Description
Summary
On macOS, the Profiler's process sampler never records the WebKit WebContent process that runs the BiBCode UI. A webview at 100 % CPU and 2.75 GB RSS therefore produces no process.sample row, no CPU finding and no memory finding. The only signs are indirect client.stall and rpc.slow findings. On Linux, the same webview (WebKitWebProcess) is a child of the desktop process and is sampled, as #96 shows.
Environment
| Field | Value |
|---|---|
| BiBCode | 0.9.2, desktop (DMG) |
| OS | macOS 27.0.1, arm64 |
| Mode | local |
| Capture | native dumps available, OS crash records available |
Evidence
97f7ca61-5156process.sampleat 2026-10-14T19:13Z lists only two processes,desktop-hostandhelper(the crash monitor). At the same moment,psshowed the BiBCode WebContent process at about 100 % CPU and 2.75 GB RSS, with parent pid 1 (launchd). WebKit's XPC services are not children of the app.- client.interaction: scrolling up a long chat timeline saturates the main thread #103 already notes "The WebContent process is not sampled" for a separate macOS incident.
Suspected source
apps/server/src/diagnostics/profiler/sampler.rs:280-299: the sampler tracks itself,descendants_of(self_pid)and identities fromProcessAttributionRegistry. On macOS the WebContent process is neither a descendant nor registered.apps/server/src/diagnostics/profiler/sampler.rs:743:exe_kindalready mapscom.apple.webkit.webcontenttowebview, so the data path exists and only discovery is missing.apps/desktop/src-tauri/src/backend/ui_process_observer/macos.rs:156-169: the desktop already resolves the WebContent pid through_webProcessIdentifier, but that result feeds onlyapps/server/src/diagnostics/resource_sampler.rs(process diagnostics), not the Profiler.
Reproduction
- Turn on the Profiler in the macOS desktop app.
- Run
profiler events --kind process.sample --limit 1 --json. - Compare with
ps -axo pid,ppid,comm | grep WebKit.WebContent: the BiBCode WebContent process (started together withbibcode-desktop) is missing from the sample.
Root-cause hypothesis
Profiler discovery walks the process tree, and macOS launches WebKit's processes as XPC services under launchd. Confidence: high, because the sampler code walks only descendants and registered identities, and the sample shows exactly those.
Suggested fix direction
Register the WebContent (and optionally GPU) pid that the macOS UI-process observer already finds with ProcessAttributionRegistry::register_identity as a webview identity, refresh it when WebKit replaces the process, and let raises_findings("webview") apply. Also check Windows WebView2, whose processes may also sit outside the host's tree.
Activity
fix(profiler): sample the macOS webview, which runs outside the app's…
merge: release v0.9.3 (PR #108)
mubeda commentedon Oct 15, 2026
Shipped in v0.9.3 (2ee00f5).
On macOS the WebKit WebContent process runs under launchd, outside BiBCode's process tree. The desktop now publishes the webview processes it observes, and the sampler attributes them as
webview, so their CPU and memory raise findings of their own.