Bug#1065709: doomsday: segfault in _XFlush() when Qt is using native Wayland

2024-03-09 Thread Simon McVittie
Control: forcemerge 1065709 1057620

On Sat, 09 Mar 2024 at 11:06:46 +, Simon McVittie wrote:
> In a GNOME Wayland session, with qtwayland5 installed:
> 
> $ doomsday
> QSocketNotifier: Can only be used with threads started with QThread
> [1]381459 segmentation fault (core dumped)  doomsday

Sorry, I didn't see that #1057620 already existed as a report of this bug.
I'll keep the more specific title and higher severity of #1065709.

smcv



Bug#1065709: doomsday: segfault in _XFlush() when Qt is using native Wayland

2024-03-09 Thread Simon McVittie
Package: doomsday
Version: 2.3.1+ds1-1+b2
Severity: important

In a GNOME Wayland session, with qtwayland5 installed:

$ doomsday
QSocketNotifier: Can only be used with threads started with QThread
[1]381459 segmentation fault (core dumped)  doomsday

Backtrace:

#0  0x7f9dc2c3ee83 in require_socket (dpy=) at 
../../src/xcb_io.c:70
#1  _XFlush (dpy=0x55af92e13230) at ../../src/xcb_io.c:606
#2  0x7f9dc2c41b3d in _XGetRequest (dpy=dpy@entry=0x55af92e13230, 
type=type@entry=98 'b', len=len@entry=8)
at ../../src/XlibInt.c:1787
#3  0x7f9dc2c34a57 in XQueryExtension
(dpy=dpy@entry=0x55af92e13230, name=name@entry=0x7f9dc2bf9128 
 "RANDR", major_opcode=major_opcode@entry=0x7fffc208bde4, 
first_event=first_event@entry=0x7fffc208bde8, 
first_error=first_error@entry=0x7fffc208bdec)
at ../../src/QuExt.c:49
#4  0x7f9dc2c27b16 in XInitExtension
(dpy=dpy@entry=0x55af92e13230, name=name@entry=0x7f9dc2bf9128 
 "RANDR")
at ../../src/InitExt.c:59
#5  0x7f9dc42ecc9b in XextAddDisplay
(extinfo=extinfo@entry=0x7f9dc2bf91b0 , 
dpy=dpy@entry=0x55af92e13230, ext_name=ext_name@entry=0x7f9dc2bf9128 
 "RANDR", hooks=hooks@entry=0x7f9dc2bf9140 
, nevents=nevents@entry=2, data=data@entry=0x0) at 
../../src/extutil.c:110
#6  0x7f9dc2bef860 in XRRFindDisplay (dpy=dpy@entry=0x55af92e13230) at 
../../src/Xrandr.c:295
#7  0x7f9dc2beffc0 in XRRFindDisplay (dpy=0x55af92e13230) at 
../../src/Xrandr.c:361
#8  XRRQueryExtension (dpy=0x55af92e13230, event_base_return=0x7fffc208bee8, 
error_base_return=0x7fffc208bee8)
at ../../src/Xrandr.c:352
#9  0x7f9dc5223ae4 in de::internal::RRInfo::RRInfo() (this=0x7fffc208bf70)
at ./doomsday/sdk/libgui/src/displaymode_x11.cpp:63
#10 0x7f9dc522302d in DisplayMode_Native_Init() () at 
./doomsday/sdk/libgui/src/displaymode_x11.cpp:188
#11 0x7f9dc51b7d11 in DisplayMode_Init() () at 
./doomsday/sdk/libgui/src/displaymode.cpp:195
#12 0x55af91335b1d in ClientApp::initialize() (this=0x7fffc208c160)
at ./doomsday/apps/client/src/clientapp.cpp:628
#13 0x55af9131875d in main(int, char**) (argc=, 
argv=0x7fffc208c388)
at ./doomsday/apps/client/src/main_client.cpp:109

It looks as though doomsday is mixing Qt, SDL and direct use of X11.
If it's going to do this, then it should either force both Qt and SDL to
use X11 too, or allow one of the GUI libraries to auto-select a backend
and force the other one to follow that decision, then conditionalize
its direct use of X11 so it's only done if the GUI library has actually
initialized X11.

Workaround:

$ SDL_VIDEODRIVER=x11 QT_QPA_PLATFORM=xcb doomsday

gets further into its startup.

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'stable-security'), (500, 'oldstable-security'), (500, 'buildd-unstable'), 
(500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (1, 
'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64

Kernel: Linux 6.7.7-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages doomsday depends on:
ii  doomsday-common 2.3.1+ds1-1+b2
ii  doomsday-data   2.3.1+ds1-1
ii  libc6   2.37-15.1
ii  libgcc-s1   14-20240303-1
ii  libqt5core5t64 [libqt5core5a]   5.15.10+dfsg-7.2
ii  libqt5gui5t64 [libqt5gui5]  5.15.10+dfsg-7.2
ii  libqt5network5t64 [libqt5network5]  5.15.10+dfsg-7.2
ii  libqt5widgets5t64 [libqt5widgets5]  5.15.10+dfsg-7.2
ii  libsdl2-2.0-0   2.30.1+dfsg-1
ii  libsdl2-mixer-2.0-0 2.8.0+dfsg-1
ii  libstdc++6  14-20240303-1

Versions of packages doomsday recommends:
ii  fluid-soundfont-gm  3.1-5.3

doomsday suggests no packages.

-- debconf-show failed