mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 04:40:02 +01:00
The old code tried to use a screen pointer that was uninitialized and set to NULL.
This caused it to segfault when this option was set.
When this option was used with the modesetting driver, `glamor_egl_init`
is called indirectly in the driver PreInit proc.
`xf86ScrnToScreen(scrn)` then returns NULL.
This patch moves setting the gl vendor later in the initialization process,
when we already have a non-null pScreen.
Minimal reproducer:
```
$ cat /etc/X11/xorg.conf.d/99-screen.conf
Section "Screen"
Identifier "Default"
Option "GlxVendorLibrary" "Name"
EndSection
```
Backtrace:
```
| #0 in abort ()
| #1 in OsAbort () at os/utils.c:1361
| #2 in AbortServer () at os/log.c:879
| #3 FatalError () at os/log.c:1017
| #4 in OsSigHandler () at os/osinit.c:156
| #5 OsSigHandler () at os/osinit.c:110
| #6 <signal handler called>
| #7 in __pthread_kill_implementation () from /lib64/libc.so.6
| #8 in raise () from /lib64/libc.so.6
| #9 in abort () from /lib64/libc.so.6
| #10 in __assert_fail_base.cold () from /lib64/libc.so.6
| #11 in xf86ScrnToScreen () at hw/xfree86/common/xf86Helper.c:1734
| #12 in glamor_egl_init () at glamor/glamor_egl.c:1108
| #13 in try_enable_glamor () at hw/xfree86/drivers/modesetting/driver.c:984
| #14 PreInit () at hw/xfree86/drivers/modesetting/driver.c:1211
| #15 in InitOutput () at hw/xfree86/common/xf86Init.c:478
| #16 in dix_main () at dix/main.c:190
| #17 main () at dix/stubmain.c:34
```
Fixes:
|
||
|---|---|---|
| .. | ||
| glamor.c | ||
| glamor.h | ||
| glamor_addtraps.c | ||
| glamor_composite_glyphs.c | ||
| glamor_compositerects.c | ||
| glamor_context.h | ||
| glamor_copy.c | ||
| glamor_core.c | ||
| glamor_dash.c | ||
| glamor_debug.h | ||
| glamor_egl.c | ||
| glamor_egl.h | ||
| glamor_egl_ext.h | ||
| glamor_eglmodule.c | ||
| glamor_fbo.c | ||
| glamor_font.c | ||
| glamor_font.h | ||
| glamor_glx_provider.c | ||
| glamor_glx_provider.h | ||
| glamor_glyphblt.c | ||
| glamor_gradient.c | ||
| glamor_image.c | ||
| glamor_largepixmap.c | ||
| glamor_lines.c | ||
| glamor_picture.c | ||
| glamor_pixmap.c | ||
| glamor_points.c | ||
| glamor_prepare.c | ||
| glamor_prepare.h | ||
| glamor_priv.h | ||
| glamor_program.c | ||
| glamor_program.h | ||
| glamor_rects.c | ||
| glamor_render.c | ||
| glamor_segs.c | ||
| glamor_spans.c | ||
| glamor_sync.c | ||
| glamor_text.c | ||
| glamor_transfer.c | ||
| glamor_transfer.h | ||
| glamor_transform.c | ||
| glamor_transform.h | ||
| glamor_trapezoid.c | ||
| glamor_triangles.c | ||
| glamor_utils.c | ||
| glamor_utils.h | ||
| glamor_vbo.c | ||
| glamor_window.c | ||
| glamor_xv.c | ||
| meson.build | ||