[Mesa-dev] [PATCH] glx: Properly handle cases where screen creation fails

Kyriazis, George george.kyriazis at intel.com
Wed Feb 21 20:36:15 UTC 2018


I believed I created the same failure by deleting libswr*.so, however in my case (running glxgears) I hit a SEGV in XMesaCreateVisual (calling xmdpy->screen->is_format_supported()), because xmesa_init_display() created an xmdpy with a NULL screen.  I never get to the xmesa_close_display().

Were you just testing with vtk, and maybe hitting a localized issue?  Looks like the failure needs to be taken care of when the screen is initialized the first time.

George

On Feb 21, 2018, at 12:13 PM, Chuck Atkins <chuck.atkins at kitware.com<mailto:chuck.atkins at kitware.com>> wrote:

Hi George,

This first showed up on one of our older dashboard machines without AVX (Nehalem processor).   You can easily reproduce it by building with --with-swr-archs=knl,skx when the machine you're trying to use it on is neither.  Note that dri-glx seems to handle this case just fine but xlib-glx segfaults.

- Chuck


On Wed, Feb 21, 2018 at 12:36 PM, Kyriazis, George <george.kyriazis at intel.com<mailto:george.kyriazis at intel.com>> wrote:
Chuck,

In which cases do you hit this?  When an architecture is not supported, then swr_create_screen() falls back to a different (older) architecture.

Thanks,

George

> On Feb 21, 2018, at 8:26 AM, Chuck Atkins <chuck.atkins at kitware.com<mailto:chuck.atkins at kitware.com>> wrote:
>
> This fixes a segfault exposed by a29d63ecf7 which occurs when swr is
> used on an unsupported architecture.
>
> Signed-off-by: Chuck Atkins <chuck.atkins at kitware.com<mailto:chuck.atkins at kitware.com>>
> Cc: mesa-stable at lists.freedesktop.org<mailto:mesa-stable at lists.freedesktop.org>
> Cc: George Kyriazis <george.kyriazis at intel.com<mailto:george.kyriazis at intel.com>>
> Cc: Bruce Cherniak <bruce.cherniak at intel.com<mailto:bruce.cherniak at intel.com>>
> ---
> src/gallium/state_trackers/glx/xlib/xm_api.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
> index 934c0aba11..3aec57e85d 100644
> --- a/src/gallium/state_trackers/glx/xlib/xm_api.c
> +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
> @@ -182,9 +182,12 @@ xmesa_close_display(Display *display)
>     * }
>     */
>
> -   if (xmdpy->smapi->destroy)
> -      xmdpy->smapi->destroy(xmdpy->smapi);
> -   free(xmdpy->smapi);
> +   if (xmdpy->smapi)
> +   {
> +      if (xmdpy->smapi->destroy)
> +         xmdpy->smapi->destroy(xmdpy->smapi);
> +      free(xmdpy->smapi);
> +   }
>
>    XFree((char *) info);
> }
> @@ -767,7 +770,7 @@ XMesaVisual XMesaCreateVisual( Display *display,
>    XMesaVisual v;
>    GLint red_bits, green_bits, blue_bits, alpha_bits;
>
> -   if (!xmdpy)
> +   if (!xmdpy || !xmdpy->screen)
>       return NULL;
>
>    /* For debugging only */
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org<mailto:mesa-dev at lists.freedesktop.org>
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org<mailto:mesa-dev at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180221/d28a3179/attachment.html>


More information about the mesa-dev mailing list