Performing verification for jammy. I installed a fresh Jammy desktop VM, and installed all updates.
sudo apt-cache policy xserver-common | grep Installed Installed: 2:21.1.4-2ubuntu1.7~22.04.13 I then installed a gstreamer stack: sudo apt install gstreamer1.0-vaapi gstreamer1.0-tools I then triggered the crash: gst-inspect-1.0 This doesn't reproduce on jammy as is, not on this mechanism anyway. I know the crash occurs as I can see it on: https://errors.ubuntu.com/?release=Ubuntu%2022.04&package=xorg- server&period=week After reading https://github.com/intel/libva/issues/700 I downloaded the libva source for jammy 2.14.0-1, and backported the following patch: https://github.com/intel/libva/commit/317c0fbea5405a27bf58505a6bc6b1f6414beb71 The backport is: https://paste.ubuntu.com/p/nNy3rsZj8w/ I built this, and installed the test packages. I then run: gst-inspect-1.0 now xserver crashes as we would expect. I also can't log in now either due to xserver crashing. So we can now reproduce the crash. I changed to a wayland session, enabled -proposed and installed xserver 2:21.1.4-2ubuntu1.7~22.04.14 I rebooted, and selected xorg session from gdm. I can log in now, and the desktop comes up as normal. I then tried to trigger the crash: gst-inspect-1.0 and it completes as expected. xserver does not crash. The package in -proposed fixes the issue, happy to mark verified for jammy. ** Bug watch added: github.com/intel/libva/issues #700 https://github.com/intel/libva/issues/700 ** Tags removed: verification-needed-jammy ** Tags added: verification-done-jammy -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to xorg-server in Ubuntu. https://bugs.launchpad.net/bugs/1861609 Title: Xorg crashes with assertion failure at dixGetPrivateAddr: Assertion `key->initialized' failed Status in X.Org X server: Fix Released Status in xorg-server package in Ubuntu: Fix Released Status in xorg-server source package in Focal: Fix Committed Status in xorg-server source package in Jammy: Fix Committed Status in xorg-server source package in Noble: Fix Committed Status in xorg-server source package in Oracular: Fix Committed Status in xorg-server source package in Plucky: Fix Released Bug description: [Impact] A very common crash in Xorg occurs when an application you are trying to launch does not call DRI2ScreenInit() before calling DRI2Authenticate() or DRI2CreateDrawable2(). This brings down the entire Xserver, and you lose all work. This isn't just a single application, common ones are gstreamer1.0-vaapi either invoked as gst-inspect-1.0 or through file manager thumbnailers, Intel libva, and more. The solution is to make DRI2Authenticate() and DRI2CreateDrawable2() more robust to not having had DRI2ScreenInit() called, and to pass the error up instead of just crashing on the assert. Stack traces from logs: Xorg: ../../../../../../include/privates.h:122: dixGetPrivateAddr: Assertion `key->initialized' failed. (EE) (EE) Backtrace: (EE) 0: /usr/lib/xorg/Xorg (OsLookupColor+0x14c) [0x587abb9686dc] (EE) 1: /lib/x86_64-linux-gnu/libc.so.6 (__sigaction+0x50) [0x747466445650] (EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (pthread_kill+0x11c) [0x7474664a3f5c] (EE) 3: /lib/x86_64-linux-gnu/libc.so.6 (gsignal+0x1e) [0x74746644559e] (EE) 4: /lib/x86_64-linux-gnu/libc.so.6 (abort+0xdf) [0x747466428902] (EE) unw_get_proc_name failed: no unwind info found [-10] (EE) 5: /lib/x86_64-linux-gnu/libc.so.6 (?+0x0) [0x74746642881e] (EE) 6: /lib/x86_64-linux-gnu/libc.so.6 (__assert_fail+0x47) [0x74746643bb87] (EE) 7: /usr/lib/xorg/Xorg (DRIMoveBuffersHelper+0xb13) [0x587abb90de23] (EE) 8: /usr/lib/xorg/Xorg (DRI2Authenticate+0xce) [0x587abb9108de] (EE) 9: /usr/lib/xorg/Xorg (DRI2GetParam+0x6d9) [0x587abb9116f9] (EE) 10: /usr/lib/xorg/Xorg (SendErrorToClient+0x3fc) [0x587abb7a004c] (EE) 11: /usr/lib/xorg/Xorg (InitFonts+0x3b3) [0x587abb7a5623] (EE) 12: /lib/x86_64-linux-gnu/libc.so.6 (__libc_init_first+0x88) [0x74746642a3b8] (EE) 13: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0x8b) [0x74746642a47b] (EE) 14: /usr/lib/xorg/Xorg (_start+0x25) [0x587abb789685] (EE) (EE) Fatal server error: (EE) Caught signal 6 (Aborted). Server aborting #0 _XReply (dpy=dpy@entry=0x55555558dce0, rep=rep@entry=0x7fffffffd6f0, extra=extra@entry=0, discard=discard@entry=0) at ../../src/xcb_io.c:680 #1 0x00007ffff752a3d0 in VA_DRI2Authenticate (dpy=dpy@entry=0x55555558dce0, window=1046, magic=magic@entry=1) at ../va/x11/va_dri2.c:225 #2 0x00007ffff7c138ed in va_drm_authenticate_x11 (fd=fd@entry=6, magic=magic@entry=1) at ../va/drm/va_drm_auth_x11.c:140 #3 0x00007ffff7c135d5 in va_drm_authenticate (fd=6, magic=1) at ../va/drm/va_drm_auth.c:37 #4 0x00007ffff7c134bd in va_DisplayContextConnect (pDisplayContext=<optimized out>) at ../va/drm/va_drm.c:62 #5 va_DisplayContextGetDriverNames (pDisplayContext=<optimized out>, drivers=0x7fffffffd890, num_drivers=0x7fffffffd884) at ../va/drm/va_drm.c:79 #6 0x00007ffff781729e in va_new_opendriver (dpy=0x55555558d310) at ../va/va.c:681 #7 vaInitialize (dpy=dpy@entry=0x55555558d310, major_version=major_version@entry=0x7fffffffdb34, minor_version=minor_version@entry=0x7fffffffdb30) at ../va/va.c:743 #8 0x00007ffff7f496d0 in vaapi_initialize (dpy=0x55555558d310) at ../gst-libs/gst/vaapi/gstvaapiutils.c:113 #9 0x00007ffff7f6db73 in supports_vaapi (fd=6) at ../gst-libs/gst/vaapi/gstvaapidisplay_drm.c:77 #10 get_default_device_path (display=0x5555555892a0 [GstVaapiDisplayDRM|vaapidisplaydrm1]) at ../gst-libs/gst/vaapi/gstvaapidisplay_drm.c:140 #11 set_device_path (device_path=<optimized out>, display=0x5555555892a0 [GstVaapiDisplayDRM|vaapidisplaydrm1]) at ../gst-libs/gst/vaapi/gstvaapidisplay_drm.c:181 #12 gst_vaapi_display_drm_open_display (display=0x5555555892a0 [GstVaapiDisplayDRM|vaapidisplaydrm1], name=<optimized out>) at ../gst-libs/gst/vaapi/gstvaapidisplay_drm.c:247 #13 0x00007ffff7f4a68b in gst_vaapi_display_create (data=0x0, init_type=GST_VAAPI_DISPLAY_INIT_FROM_DISPLAY_NAME, display=0x5555555892a0 [GstVaapiDisplayDRM|vaapidisplaydrm1]) at ../gst-libs/gst/vaapi/gstvaapidisplay.c:965 #14 gst_vaapi_display_config (display=0x5555555892a0 [GstVaapiDisplayDRM|vaapidisplaydrm1], init_type=GST_VAAPI_DISPLAY_INIT_FROM_DISPLAY_NAME, init_value=0x0) at ../gst-libs/gst/vaapi/gstvaapidisplay.c:1272 #15 0x00007ffff7f709a1 in gst_vaapi_display_drm_new (device_path=0x0) at ../gst-libs/gst/vaapi/gstvaapidisplay_drm.c:367 #16 0x00007ffff7f0c295 in gst_vaapi_create_test_display () at ../gst/vaapi/gstvaapipluginutil.c:929 #17 plugin_init (plugin=0x555555585b10 [GstPlugin|plugin1]) at ../gst/vaapi/gstvaapi.c:191 #18 0x00007ffff7e22452 in gst_plugin_register_func (plugin=plugin@entry=0x555555585b10 [GstPlugin|plugin1], desc=desc@entry=0x7ffff7fb71a0 <gst_plugin_desc>, user_data=user_data@entry=0x0) at ../gst/gstplugin.c:540 #19 0x00007ffff7e279c0 in _priv_gst_plugin_load_file_for_registry (filename=0x55555558122c "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so", registry=<optimized out>, error=<optimized out>) at ../gst/gstplugin.c:979 #20 0x00007ffff7e6ed41 in do_plugin_load (tag=0, filename=0x55555558122c "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so", l=<optimized out>) at ../gst/gstpluginloader.c:741 #21 handle_rx_packet (payload_len=<optimized out>, payload=0x55555558122c "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so", tag=0, pack_type=<optimized out>, l=<optimized out>) at ../gst/gstpluginloader.c:849 #22 read_one (l=0x555555584a30) at ../gst/gstpluginloader.c:1025 #23 exchange_packets (l=l@entry=0x555555584a30) at ../gst/gstpluginloader.c:1053 #24 0x00007ffff7e703a8 in _gst_plugin_loader_client_run (pipe_name=pipe_name@entry=0x0) at ../gst/gstpluginloader.c:596 #25 0x00005555555551db in main (argc=<optimized out>, argv=<optimized out>) at ../libs/gst/helpers/gst-plugin-scanner.c:81 [Testcase] Start a fresh VM. Make sure the session is using X Server. $ sudo apt install gstreamer1.0-vaapi gstreamer1.0-tools $ gst-inspect-1.0 On plucky, you don't even need to run gst-inspect-1.0, just try log in, you will quickly find that xserver is broken and you aren't getting a X session today. Review the backtrace in /var/log/syslog. If you install a test package from the following ppa, the issue does not occur: https://launchpad.net/~mruffell/+archive/ubuntu/sf392117-test [Where problems could occur] We are adding some protection on the xserver side against user-space applications that incorrectly do not call DRI2ScreenInit() before attempting to construct a window. It would be best if all applications would call DRI2ScreenInit(), but if an applications don't, then we need to not crash the entire xserver. Regressions could occur in unintended behaviour for applications that can get away without calling DRI2ScreenInit(), but those applications will likely just continue working as usual. If a regression were to occur, it would occur when launching applications in Xorg desktop environments. [Other Info] Duplicate Bugs -------------- At the time of writing the primary Launchpad bug has 19 duplicate bugs, which is the most I have ever seen, so this bug impacts a large amount of people. Upstream Bugs ------------- https://gitlab.freedesktop.org/xorg/xserver/-/issues/1053 https://gitlab.freedesktop.org/xorg/xserver/-/issues/1340 https://gitlab.freedesktop.org/xorg/xserver/-/issues/1534 https://lists.x.org/archives/xorg-devel/2024-September/059318.html Downstream Bugs --------------- https://bugs.gentoo.org/841662 Merge Request and Fix --------------------- https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1608 commit a0834009cfb10b8982a1f2b47b8ed00de254c2c3 From: Doug Brown <d...@schmorgal.com> Date: Mon, 15 Jul 2024 19:44:23 -0700 Subject: dri2: Protect against dri2ClientPrivate assertion failures Link: https://gitlab.freedesktop.org/xorg/xserver/-/commit/a0834009cfb10b8982a1f2b47b8ed00de254c2c3 This was very recently merged. To manage notifications about this bug go to: https://bugs.launchpad.net/xorg-server/+bug/1861609/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp