Files
hyprland-headless-stream-pl…/spikes/capture-speed/CRASH-FINDING.md
T
Hermenix e2d9cb7dd4 spike: record what crashes the compositor, and the copy probe that explains grim-rs
CRASH-FINDING.md is the delegated session's sharper version of the crash result:
hold a live ext capture session on a session's output, kill the session, call
create_frame -> SIGSEGV in CScreenshareFrame::transform(). That is a reproducible
trigger, not a correlation, and it is why ext-image-copy-capture was measured and
then not adopted.

copyout_probe.py prices the per-frame allocate/copy/swizzle that grim-rs's API
forces: 2.2 ms of client time, which is nowhere near its 46 ms deficit against the
in-process route -- so the difference is buffer reuse, not language.
2026-10-11 22:47:28 +00:00

2.5 KiB

What crashes the compositor, and exactly when

Recorded from the delegated Claude session that spent its run on this, before that session was shut down. Its finding is sharper than the one the benchmark itself produced, so it is written down here rather than left in a tmux transcript.

The trigger

Reproduced deliberately, not just observed:

  1. Hold a live capture session on a session's headless output (route 001b's --protocol ext producer, i.e. ext-image-copy-capture-v1).
  2. Run hhstream session kill on that session, which destroys its output.
  3. Call create_frame on the now-dangling capture session.

→ SIGSEGV, core dumped.

The kill is not the crash: the compositor dies inside ext-image-copy-capture's frame creation, on an output that no longer exists.

The stack

#0  CScreenshareFrame::transform() const
#1  CImageCopyCaptureFrame::CImageCopyCaptureFrame(...)
#2  CExtImageCopyCaptureManagerV1Options... (createFrame)
#3  _CExtImageCopyCaptureSessionV1CreateFrame
...
#4  ffi_call_unix64
#10 wl_display_run

Why it matters, and what was done about it

  • It explains three compositor deaths during the benchmark (the two whose stack reached CScreenshareFrame::transform(), and one in libaquamarine), including one that happened mid-run and invalidated cells: the harness kills a session between passes while a producer may still hold a capture session on it. So the harness, not the protocol by itself, was pulling the trigger.
  • It is the reason the candidate that was measured and not adopted is not adopted: ext-image-copy-capture-v1 measured no faster than zwlr-screencopy-v1 (78.0 vs 77.7 ms; compositor 67.5 vs 67.2 ms) and its frame-creation path is the one that segfaults the compositor. The feat/pywayland-capture branch therefore keeps the deprecated zwlr-screencopy-v1, with the switch documented as one constant.
  • The crash is in Hyprland (0.56.2, software rendering), not in the harness or in pywayland. Anything that wants to propose it upstream will need this trigger, because it is the reproducible part: hold a capture session, destroy the output underneath it, then ask for a frame.

Not established

  • Whether zwlr-screencopy-v1 survives the same dangling-output sequence. The in-process backend in feat/pywayland-capture does handle the nearest equivalent (global_remove drops the output, and the next grab() reconnects and re-selects) — but that path has not been exercised against a real session kill, which is the obvious next experiment.