[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][xorg-team/lib/mesa][debian-unstable] Add drisw-Avoid-crashing-when-swrast_loader-NULL.patch



Title: GitLab

Timo Aaltonen pushed to branch debian-unstable at X Strike Force / lib / mesa

Commits:

  • 686a3856
    by Daniel van Vugt at 2025-04-08T17:21:38+08:00
    Add drisw-Avoid-crashing-when-swrast_loader-NULL.patch
    
    To prevent segfaults on some drivers during startup (LP: #2101817)
    

2 changed files:

Changes:

  • debian/patches/drisw-Avoid-crashing-when-swrast_loader-NULL.patch
    1
    +From: Daniel van Vugt <daniel.van.vugt@canonical.com>
    
    2
    +Date: Fri, 4 Apr 2025 17:41:37 +0800
    
    3
    +Subject: drisw: Avoid crashing when swrast_loader == NULL
    
    4
    +
    
    5
    +This is a blanket fix for all the segfaults in `drisw_init_screen()`
    
    6
    +when `swrast_loader` is NULL, since 1de7c86bc1. A similar more targeted
    
    7
    +fix for vmwgfx can be found in f3b8d7da46 ("egl: never select swrast
    
    8
    +for vmwgfx"). We can safely return NULL because the caller
    
    9
    +`driCreateNewScreen3` handles NULL, as does its own callers.
    
    10
    +
    
    11
    +As this is currently the top crasher of gnome-shell since Ubuntu
    
    12
    +upgraded to Mesa 25 and it seems to be coming from multiple different
    
    13
    +drivers still, we want a universal fix to at least stop the crash
    
    14
    +reports. People can figure out which drivers still need tweaking in
    
    15
    +`dri2_load_driver` or elsewhere later.
    
    16
    +
    
    17
    +Fixes: 1de7c86bc1 ("dri: pass through a type enum for creating screen instead of driver_extensions")
    
    18
    +Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12678 (radeon)
    
    19
    +Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12859 (radeon)
    
    20
    +Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12300 (nvidia-drm)
    
    21
    +Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12462 (nvidia-drm)
    
    22
    +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2101817
    
    23
    +---
    
    24
    + src/gallium/frontends/dri/drisw.c | 8 ++++++++
    
    25
    + 1 file changed, 8 insertions(+)
    
    26
    +
    
    27
    +diff --git a/src/gallium/frontends/dri/drisw.c b/src/gallium/frontends/dri/drisw.c
    
    28
    +index 4590b57..9bb3088 100644
    
    29
    +--- a/src/gallium/frontends/dri/drisw.c
    
    30
    ++++ b/src/gallium/frontends/dri/drisw.c
    
    31
    +@@ -32,6 +32,7 @@
    
    32
    + #include "util/u_memory.h"
    
    33
    + #include "util/u_inlines.h"
    
    34
    + #include "util/box.h"
    
    35
    ++#include "util/log.h"
    
    36
    + #include "pipe/p_context.h"
    
    37
    + #include "pipe-loader/pipe_loader.h"
    
    38
    + #include "frontend/drisw_api.h"
    
    39
    +@@ -620,6 +621,13 @@ drisw_init_screen(struct dri_screen *screen, bool driver_name_is_inferred)
    
    40
    + 
    
    41
    +    screen->swrast_no_present = debug_get_option_swrast_no_present();
    
    42
    + 
    
    43
    ++   if (loader == NULL) {
    
    44
    ++      /* If you are reading this then dri2_load_driver may need tweaking */
    
    45
    ++      mesa_logw("swrast was requested but driver is missing %s",
    
    46
    ++                __DRI_SWRAST_LOADER);
    
    47
    ++      return NULL;
    
    48
    ++   }
    
    49
    ++
    
    50
    +    if (loader->base.version >= 4) {
    
    51
    +       if (loader->putImageShm)
    
    52
    +          lf = &drisw_shm_lf;

  • debian/patches/series
    ... ... @@ -6,3 +6,4 @@ gfxstream-add-common-interfaces.diff
    6 6
     gfxstream-check-device-before-using.diff
    
    7 7
     gfxstream-refactor-device-init.diff
    
    8 8
     gfxstream-follow-the-semantics-desired-by-distro-VK.diff
    
    9
    +drisw-Avoid-crashing-when-swrast_loader-NULL.patch


  • Reply to: