Skip to content

drm/atomic: don't restate heads with a dead front framebuffer - #498

Closed
ysautter wants to merge 1 commit into
hyprwm:mainfrom
ysautter:fix/restate-dead-fb
Closed

ysautter wants to merge 1 commit into
hyprwm:mainfrom
ysautter:fix/restate-dead-fb

Conversation

@ysautter

Copy link
Copy Markdown

Fixes #466

Problem

After suspend/resume (observed on NVIDIA), monitors briefly report no modes, test/modeset commits fail with EINVAL, and CDRMAtomicRequest::restateConnectors() then calls planeProps() with a peer head's retained crtc->primary->front. That FB can be dead with an expired weak buffer, so planeProps() segfaults reading fb->buffer->size (Atomic.cpp, see backtrace in #466).

Fix

  • restateConnectors(): only restate the primary plane if the front FB is alive (!front->dead && front->buffer); otherwise leave the plane state as is (same as the existing "no front buffer yet" case).
  • planeProps(): if handed a dead / bufferless FB, log an error and mark the request as failed instead of dereferencing it. The commit fails cleanly and the compositor's existing retry path takes over.

Testing

Built on top of v0.16.0 (Arch package 0.16.0-1 + this patch) and running on Hyprland 0.57.2, RTX 3090 Ti, nvidia-open 620.70.06, 3 monitors (DP-1, DP-2, HDMI-A-1). Before the patch this setup hit the crash in ~3% of resumes (8 crash reports with the identical restateConnectors backtrace on 0.14/0.15/0.16).

After suspend/resume (observed on NVIDIA) restateConnectors() can pass a
peer head's retained primary->front FB to planeProps() although the FB is
dead and its weak buffer has expired, which segfaults when reading
fb->buffer->size.

Skip restating the primary plane for such heads, and make planeProps()
fail the request instead of dereferencing a dead/bufferless FB.

Fixes hyprwm#466
@github-actions

Copy link
Copy Markdown

Hi @ysautter,

Thanks for your contribution! Unfortunately, Hyprland and hypr* no longer
accept contributions from unvouched contributors.

To get vouched, please see our contributing guide at wiki.hypr.land/Contributing-and-Debugging

This PR has been closed automatically and will not be re-opened.

@github-actions github-actions Bot closed this Nov 15, 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.

SIGSEGV in planeProps() via restateConnectors() with a dead framebuffer after suspend/resume (0.15.1, NVIDIA)

1 participant