You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SIGSEGV in CWaylandBuffer when the swapchain cannot allocate a buffer (resizeSwapchain ignores failure) #144
When the swapchain cannot allocate buffers, IWaylandWindow::resizeSwapchain() still
wraps swapchain->next(nullptr) in a CWaylandBuffer. next() returns null and the CWaylandBuffer constructor dereferences it, so every hyprtoolkit app (here hyprpaper)
segfaults on its first configure instead of failing cleanly.
src/window/IWaylandWindow.cpp (same on v0.6.0 and current main):
m_waylandState.swapchain->reconfigure(Aquamarine::SSwapchainOptions{ ... }); // return value ignoredfor (size_t i = 0; i < m_waylandState.wlBuffers.size(); ++i) {
m_waylandState.wlBuffers[i] = makeShared<CWaylandBuffer>(m_waylandState.swapchain->next(nullptr)); // next() is null here
}
onPreRender() already returns early when wlBuffers[0]/[1] are null, so checking the reconfigure() result / the buffer from next() and leaving the slot empty (and logging)
would avoid the crash.
How to reproduce
A QEMU/KVM guest with -vga virtio and no 3D acceleration (no virgl), so Mesa falls back
to kms_swrast. Inside a Hyprland session, a minimal config:
ERR from hyprtoolkit ]: [EGL] Command eglInitialize errored out with EGL_NOT_INITIALIZED (0x12289): DRI2: failed to create screen
MESA-EGL: warning: NEEDS EXTENSION: falling back to kms_swrast
DEBUG ]: Found 1 output(s)
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
ERR from aquamarine ]: GBM: Allocating with modifiers failed, falling back to modifier-less allocation
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Permission denied
ERR from aquamarine ]: GBM: Failed to allocate a GBM buffer: bo null
ERR from aquamarine ]: Couldn't allocate a gbm buffer with size [Vector2D: x: 1280, y: 800] and format XR24
ERR from aquamarine ]: Swapchain: Failed acquiring a buffer
Segmentation fault (core dumped)
Hyprland itself, Qt/Quickshell and GTK apps render fine in the same guest (Mesa llvmpipe).
Versions (Arch Linux packages)
hyprtoolkit 0.6.0
hyprpaper 0.8.4
aquamarine 0.15.1
hyprutils 0.14.3
hyprgraphics 0.5.1
Hyprland 0.57.0
mesa 26.2.6
wayland 1.26.0
kernel 7.2.11, QEMU -vga virtio (Virtio 1.0 GPU), no virgl
Related but different: #129 (RASSERT when drmFD is -1). This one is a null buffer after
the swapchain fails to allocate.
Separately from the crash: it would be great if hyprtoolkit could fall back to wl_shm
buffers when GBM/dumb allocation is unavailable, so wallpaper tools keep working in
VMs without 3D acceleration.
opened #155 with your fix. couldn't hit the alloc failure on real hardware here (gpu allocates fine), so it's compile-tested plus the normal path is untouched (the new branch only runs when next() is null). a confirm from the kms_swrast guest would seal it.
Activity
Wallpaper: the bar draws the still image where hyprpaper cannot
Login: do not start hyprpaper without a GPU
UncleJ4ck commentedon Nov 9, 2026
opened #155 with your fix. couldn't hit the alloc failure on real hardware here (gpu allocates fine), so it's compile-tested plus the normal path is untouched (the new branch only runs when
next()is null). a confirm from thekms_swrastguest would seal it.