Skip to content

Segfault when opening modpack Content page on NVIDIA + Wayland (AcceleratedBackingStore null pointer) #6185

@4b1t-git

Description

@4b1t-git

Please confirm the following.

  • I checked the existing issues for duplicate problems
  • I have tried resolving the issue using the support portal
  • I have ensured my Modrinth App installation is up to date

What version of the Modrinth App are you using?

0.10.21 (modrinth-app-bin from AUR)

What operating systems are you seeing the problem on?

Linux

Describe the bug

The Modrinth App crashes with a segfault (SIGSEGV) when opening the Content tab of certain modpacks (e.g. Vanilla Perfected, Cobblemon Official). The app launches fine and modpacks with fewer mods (e.g. my own with ~58 mods) display their Content page without issues. The crash occurs specifically when navigating to the Content page of modpacks with a larger mod list.
The crash is a null pointer dereference in WebKit::AcceleratedBackingStore::update — WebKit tries to enter accelerated compositing mode but the AcceleratedBackingStore pointer is null (this=0x0). This happens because WEBKIT_DISABLE_DMABUF_RENDERER=1 is set (required for NVIDIA GPUs on Wayland to prevent a protocol error on startup), and this appears to prevent the AcceleratedBackingStore from being properly initialized, while WebKit still attempts to use it when rendering heavier pages.
Without WEBKIT_DISABLE_DMABUF_RENDERER=1, the app crashes on startup with:
Gdk-Message: Error 71 (Protocol error) dispatching to Wayland display.
So NVIDIA+Wayland users are stuck: the variable is needed to start the app, but it causes this null pointer crash when rendering certain pages.
Stack trace (from GDB with debuginfod symbols)
#0 WebKit::AcceleratedBackingStore::update (this=0x0, context=...)
at Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp:754
754 if (m_surfaceID == context.contextID)
#1 WebKit::WebPageProxy::enterAcceleratedCompositingMode (layerTreeContext=..., this=)
at Source/WebKit/UIProcess/WebPageProxy.cpp:12724
#2 WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode (this=, layerTreeContext=...)
at Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:261
#3 WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode (this=, layerTreeContext=...)
at Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:230
#4 IPC::callMemberFunction<...> at Source/WebKit/Platform/IPC/HandleMessage.h:138
...
#11 WebKit::DrawingAreaProxy::didReceiveMessage (this=0x7f0cc20503c0, connection=..., decoder=...)
at DerivedSources/WebKit/DrawingAreaProxyMessageReceiver.cpp:49
#12 IPC::MessageReceiverMap::dispatchMessage (...)
#29 gtk_main_iteration_do (blocking=1) at gtkmain.c:1460

Environment

OS: Arch Linux (kernel 7.0.9-arch1-1)
GPU: NVIDIA GeForce RTX 4070 Ti
Driver: 595.71.05 (CUDA 13.3)
Display server: Hyprland (Wayland) with XWayland
Shell: fish
webkit2gtk-4.1: 2.52.3-1 (also tested 2.52.1-1 — same crash)
Modrinth launcher script: /usr/bin/modrinth-app sets WEBKIT_DISABLE_DMABUF_RENDERER=1 when NVIDIA is detected

Steps to reproduce

Have an NVIDIA GPU with Wayland (Hyprland, Sway, etc.)
Install modrinth-app-bin from AUR (which sets WEBKIT_DISABLE_DMABUF_RENDERER=1 for NVIDIA)
Open the Modrinth App — it launches normally
Install or browse a modpack with a large number of mods (e.g. "Vanilla Perfected" by demonjoeTV, or "Cobblemon Official Modpack [Fabric]")
Click on the modpack to open its Content page
The app freezes briefly, then crashes with SIGSEGV

Expected behavior

The Content page should render without crashing.

Additional context

This is related to #3057 but is a distinct issue — the app starts fine with WEBKIT_DISABLE_DMABUF_RENDERER=1, but crashes when WebKit tries to enter accelerated compositing mode while rendering heavier content pages. The root cause appears to be in WebKit itself: AcceleratedBackingStore is not initialized when DMABUF is disabled, but enterAcceleratedCompositingMode is still called without a null check.
A potential fix on the Modrinth side could be to add a null check before calling AcceleratedBackingStore::update, or to configure the WebView to disable hardware-accelerated compositing when WEBKIT_DISABLE_DMABUF_RENDERER is set.

What I've tried (none of these fixed it)

WEBKIT_DISABLE_COMPOSITING_MODE=1
JSC_useJIT=0
LIBGL_ALWAYS_SOFTWARE=1
GDK_BACKEND=x11 (crashes on startup without DMABUF var)
WEBKIT_USE_SINGLE_WEB_PROCESS=1
WEBKIT_DISABLE_GPU_PROCESS=1
WEBKIT_HARDWARE_ACCELERATION_POLICY=never
GALLIUM_DRIVER=llvmpipe
__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
Downgrading webkit2gtk-4.1 to 2.52.1 (same crash)
Downgrading webkit2gtk-4.1 to 2.48.6 / 2.50.0 (incompatible with current ICU)
Removing WEBKIT_DISABLE_DMABUF_RENDERER=1 (app crashes on startup with Wayland protocol error)
Clearing app cache (~/.config/com.modrinth.theseus)

Metadata

Metadata

Assignees

No one assigned

    Labels

    appRelates to Modrinth App

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions