Skip to content

[fix] output/default: skip systems that fail detection - #74

Merged
nikp123 merged 1 commit into
nikp123:masterfrom
sabrehagen:output-default-skip-failed-test
Oct 14, 2026
Merged

nikp123 merged 1 commit into
nikp123:masterfrom
sabrehagen:output-default-skip-failed-test

Conversation

@sabrehagen

Copy link
Copy Markdown
Contributor

Problem

With the default output method (opengl, or no method set in [output]), xava segfaults on startup in an X11 session with no Wayland compositor:

#0 __strlen_avx2
#1 xava_module_output_load  (libxava-shared.so)
#2 xavaOutputLoadConfig     (out_opengl.so)
#3 main

We hit this with the xava-x86_64.AppImage from the 0.8 release, running inside a Docker container on an X11 display (DISPLAY=:1, no WAYLAND_DISPLAY).

Cause

In xavaOutputLoadConfig in src/output/default/main.c, system is only assigned when systems[i].test_func() succeeds, but xava_module_output_load(system) is called on every iteration. Wayland is first in systems[], so when am_i_wayland() fails, system is still NULL, and xava_module_output_load(NULL) calls strlen(NULL).

Setting the backend explicitly, e.g. method = x11_opengl, avoids the crash because it bypasses the auto-detection.

Fix

Skip to the next system when its detection test fails, so the X11 and SDL2 backends get tried.

Testing

I built out_opengl.so from src/output/default/main.c and the graphical_*/test.c files, with -DOPENGL -DX11 -DWAYLAND -DSDL2, against the 0.8 AppImage's libxava-shared.so. Then I bind-mounted it over the AppImage's module and ran xava with the default method, on X11 with no Wayland:

  • master: segfault, exit code 139
  • this branch: xava picks x11_opengl and runs normally

I only exercised the OpenGL variant at runtime. The Cairo variant (-DCAIRO) compiles but I didn't run it.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sabrehagen
sabrehagen force-pushed the output-default-skip-failed-test branch from 46d2e8b to d46957c Compare October 14, 2026 11:31
@nikp123
nikp123 merged commit ef78a23 into nikp123:master Oct 14, 2026
2 checks passed
@nikp123

nikp123 commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Yeah that seems fine, I don't know how I missed this initially. Thanks.

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.

2 participants