Skip to content

meson: Don't build COMPOSITE for XQuartz

Jeremy Huddleston Sequoia requested to merge jeremyhu/xserver:master into master

We don't enable COMPOSITE in the autotools build either. There have historically been issues enabling it in XQuartz. In particaular, we see a use-after-free when enabling ASan when just going through windows in a Motif Application (eg: nedit).

It looks like a scratch pixmap gets both placed into the scratch pool and freed when both rootless and composite are enabled:

==63983==ERROR: AddressSanitizer: heap-use-after-free on address 0x000105de26c0 at pc 0x0001010a46c4 bp 0x00016f271500 sp 0x00016f2714f8
READ of size 8 at 0x000105de26c0 thread T4
#0 0x1010a46c0 in FreeScratchPixmapHeader pixmap.c:78
#1 0x100e014d8 in RootlessStopDrawing rootlessCommon.c:251
#2 0x100e3c790 in RootlessUnrealizeWindow rootlessWindow.c:519
#3 0x10112a7f0 in compUnrealizeWindow compwindow.c:292
#4 0x101109cac in UnrealizeTree window.c:2805
#5 0x1010f7684 in UnmapWindow window.c:2863
#6 0x1010f0e6c in DeleteWindow window.c:1075
#7 0x1010d1a3c in doFreeResource resource.c:885
#8 0x1010d177c in FreeResource resource.c:915
#9 0x100fbae5c in ProcDestroyWindow dispatch.c:833
#10 0x100fb4790 in Dispatch dispatch.c:551
#11 0x101005658 in dix_main main.c:272
#12 0x100df5b38 in server_thread quartzStartup.c:65
#13 0x185995068 in _pthread_start+0x90 (libsystem_pthread.dylib:arm64e+0x7068)
#14 0x18598fe28 in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1e28)
0x000105de26c0 is located 16 bytes inside of 104-byte region [0x000105de26b0,0x000105de2718)
freed by thread T4 here:
#0 0x101dcede4 in wrap_free+0x98 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3ede4)
#1 0x1010a4c74 in FreePixmap pixmap.c:132
#2 0x100eb6c64 in fbDestroyPixmap fbpixmap.c:94
#3 0x1011cb9d8 in damageDestroyPixmap damage.c:1504
#4 0x101291e48 in ShmDestroyPixmap shm.c:260
#5 0x1011293ec in compCheckRedirect compwindow.c:181
#6 0x10112a7b0 in compUnrealizeWindow compwindow.c:291
#7 0x101109cac in UnrealizeTree window.c:2805
#8 0x1010f7684 in UnmapWindow window.c:2863
#9 0x1010f0e6c in DeleteWindow window.c:1075
#10 0x1010d1a3c in doFreeResource resource.c:885
#11 0x1010d177c in FreeResource resource.c:915
#12 0x100fbae5c in ProcDestroyWindow dispatch.c:833
#13 0x100fb4790 in Dispatch dispatch.c:551
#14 0x101005658 in dix_main main.c:272
#15 0x100df5b38 in server_thread quartzStartup.c:65
#16 0x185995068 in _pthread_start+0x90 (libsystem_pthread.dylib:arm64e+0x7068)
#17 0x18598fe28 in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1e28)
previously allocated by thread T4 here:
#0 0x101dcf074 in wrap_calloc+0x9c (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3f074)
#1 0x1010a4b7c in AllocatePixmap pixmap.c:119
#2 0x100eb6444 in fbCreatePixmap fbpixmap.c:54
#3 0x1010a4544 in GetScratchPixmapHeader pixmap.c:62
#4 0x100e00aa0 in RootlessStartDrawing rootlessCommon.c:165
#5 0x100effe5c in miPaintWindow miexpose.c:451
#6 0x100f02828 in miWindowExposures miexpose.c:388
#7 0x100f52af8 in miHandleValidateExposures miwindow.c:224
#8 0x1010eb3bc in MapWindow window.c:2689
#9 0x100fbc4bc in ProcMapWindow dispatch.c:913
#10 0x100fb4790 in Dispatch dispatch.c:551
#11 0x101005658 in dix_main main.c:272
#12 0x100df5b38 in server_thread quartzStartup.c:65
#13 0x185995068 in _pthread_start+0x90 (libsystem_pthread.dylib:arm64e+0x7068)
#14 0x18598fe28 in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1e28)
Thread T4 created by T0 here:
#0 0x101dc8c5c in wrap_pthread_create+0x54 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x38c5c)
#1 0x100df5840 in create_thread quartzStartup.c:77
#2 0x100df5458 in QuartzInitServer quartzStartup.c:94
#3 0x100dcfbf0 in X11ApplicationMain X11Application.m:798
#4 0x100ddb9c4 in X11ControllerMain X11Controller.m:922
#5 0x100df5f30 in server_main quartzStartup.c:135
#6 0x100dc3dbc in do_start_x11_server bundle-main.c:396
#7 0x100dbed6c in _Xstart_x11_server mach_startupServer.c:192
#8 0x100dbff70 in mach_startup_server mach_startupServer.c:402
#9 0x18595da00 in mach_msg_server+0x1a0 (libsystem_kernel.dylib:arm64e+0x8a00)
#10 0x100dc44d8 in main bundle-main.c:713
#11 0x18566be4c  (<unknown module>)
SUMMARY: AddressSanitizer: heap-use-after-free pixmap.c:78 in FreeScratchPixmapHeader

We have a long-standing bug to track down all the COMPOSITE related issues in XQuartz. This PR just tracks making meson builds more consistent with the previous autoconf-based builds.

Merge request reports