[Mesa-stable] [PATCH v2] glx: fix crash with bad fbconfig

Emil Velikov emil.l.velikov at gmail.com
Tue Jun 7 10:25:52 UTC 2016


On 31 May 2016 at 10:53, Tapani Pälli <tapani.palli at intel.com> wrote:
> From: Daniel Czarnowski <daniel.czarnowski at intel.com>
>
> GLX documentation states:
>         glXCreateNewContext can generate the following errors: (...)
>         GLXBadFBConfig if config is not a valid GLXFBConfig
>
> Function checks if the given config is a valid config and sets proper
> error code.
>
> Fixes currently crashing glx-fbconfig-bad Piglit test.
>
> v2: coding style cleanups (Emil, Topi)
>     use DefaultScreen macro (Emil)
>
Thanks for the update Topi. There is one question/suggestion for
future work inline. But as is the patch is
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>


> +   config_list = (struct glx_config **)
> +      glXGetFBConfigs(dpy, screen, &list_size);
> +
Not 100% sure if we could/should reference the external symbols from
within our implementation. I cannot give you concrete reason, yet with
GLVND around the corner my gut isn't giving me a good feeling about
this.

We have a similar case in glXCreateWindow (using
glXGetVisualFromFBConfig for the GLX_APPLEGL path) and
__glXGLVNDGetProcAddress(glXGetProcAddressARB).

Perhaps it's worth renaming those symbols (prefix with __) and using
GLX_ALIAS ? Speaking of which...

Jeremy is __attribute__  alias working with Darwin ? If so can we drop
the GLX_ALIAS_UNSUPPORTED define (automake and scons builds) and
cleanup the ifdef spaghetti in src/glx/{glxcmds.c,glxextensions.h}.
Just looking for an ack/nack on the idea :-)

Thanks
Emil


More information about the mesa-stable mailing list