Skip to content

сrash on window resize due to excessive Wayland events #2705

Description

@LeynTheCat

os: arch linux
kernel: 7.1.5-arch1-2
wm: hyprland 0.56.1 (wayland)

the engine crashes during window resizing under Wayland. Wayland sends too many resize events without throttling, and SDL2 attempts to process each event in real-time, leading to a segfault. The same issue is observed under X11.

stack trace:

Ver: Xash3D FWGS 0.21 (build 4147-2d88199-master, linux-amd64)
Crash: signal 11 errno 0 with code 1 at 0x8c (nil)
 0: 0x7f6bcfc3e6ef (/usr/lib/libc.so.6)
 1: _Z17GL_FreeDrawbufferP15gl_drawbuffer_t (gl_framebuffer.cpp:405) (/home/intea/Desktop/xash3d-fwgs-linux-amd64/unbuilt/bin/client_amd64.so)
 2: _ZN16CBasePostEffects16InitAutoExposureEv (gl_postprocess.cpp:296) (/home/intea/Desktop/xash3d-fwgs-linux-amd64/unbuilt/bin/client_amd64.so)
 3: _Z9R_VidInitv (gl_rmisc.cpp:924) (/home/intea/Desktop/xash3d-fwgs-linux-amd64/unbuilt/bin/client_amd64.so)
 4: HUD_VidInit (cdll_int.cpp:175) (/home/intea/Desktop/xash3d-fwgs-linux-amd64/unbuilt/bin/client_amd64.so)
 5: SCR_VidInit (cl_scrn.c:898) (./libxash.so)
 6: SCR_VidInit (cl_scrn.c:872) (./libxash.so)
 7: R_SaveVideoMode (vid_common.c:84) (./libxash.so)
 8: VID_SaveWindowSize (vid_sdl2.c:403) (./libxash.so)
 9: SDLash_EventHandler (host_sdl2.c:407) (./libxash.so)
10: Platform_RunEvents (host_sdl2.c:429) (./libxash.so)
11: Host_RunFrame (host_state.c:155) (./libxash.so)
12: COM_Frame (host_state.c:220) (./libxash.so)
13: Host_Main (host.c:1330) (./libxash.so)
14: Sys_Start (game.cpp:175) (./xash3d)
15: main (game.cpp:187) (./xash3d)
16: 0x7f6bcfc27780 (/usr/lib/libc.so.6)
17: <__libc_start_main+136> (/usr/lib/libc.so.6)
18: <_start+36> (./xash3d)
19: 0xffffffffffffffff

the crash is consistently reproducible by resizing the window. A video demonstrating the crash is attached below.

2026-08-08.21-41-33.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions