i965: Segmentation fault during glinfo context destruction, regression in 21.3.x
System information
System:
Host: asmodeus Kernel: 5.15.18 x86_64 bits: 64 compiler: gcc
v: 2.37-slack15 Desktop: Xfce 4.16.0 tk: Gtk 3.24.24 wm: xfwm dm: XDM
Distro: Slackware 15.0
CPU:
Info: quad core model: Intel Core i7-3770 bits: 64 type: MT MCP
arch: Ivy Bridge rev: 9 cache: L1: 256 KiB L2: 1024 KiB L3: 8 MiB
Speed (MHz): avg: 2113 high: 2295 min/max: 1600/3900 cores: 1: 1854
2: 2282 3: 2126 4: 2167 5: 2128 6: 1897 7: 2295 8: 2161 bogomips: 54400
Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel IvyBridge GT2 [HD Graphics 4000] vendor: ASUSTeK P8 series
driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:0162
Display: x11 server: X.Org 1.20.14 compositor: xfwm4 driver:
loaded: modesetting unloaded: vesa alternate: fbdev resolution:
1: 1920x1200~60Hz 2: 1920x1080~60Hz s-dpi: 96
OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2)
v: 4.2 Mesa 21.3.5 compat-v: 3.0 direct render: Yes
Describe the issue
glinfo
fails with Segmentation Fault during exit cleanup (the expected output is printed out just fine before) in Mesa 21.3.x (0 through 5). With 21.2.y (retested with 21.2.6), the issue was not present. In current git, i965 was removed, so it cannot be tested.
The issue is easily and reliably reproducible by running glinfo
.
The relevant output of gdb glinfo
with 21.3.5 debug build follows, standard output of glinfo
is omitted:
Thread 1 "glinfo" received signal SIGSEGV, Segmentation fault.
brw_flush_front (ctx=ctx@entry=0x7ffff57ee010) at ../src/mesa/main/fbobject.h:52
52 return fb->Name == 0;
(gdb) bt
#0 brw_flush_front (ctx=ctx@entry=0x7ffff57ee010) at ../src/mesa/main/fbobject.h:52
#1 0x00007ffff642a141 in brw_glFlush (ctx=0x7ffff57ee010, gallium_flush_flags=<optimized out>) at ../src/mesa/drivers/dri/i965/brw_context.c:301
#2 0x00007ffff65046f2 in _mesa_make_current (newCtx=newCtx@entry=0x0, drawBuffer=drawBuffer@entry=0x0, readBuffer=readBuffer@entry=0x0) at ../src/mesa/main/context.c:1616
#3 0x00007ffff6504f13 in _mesa_free_context_data (ctx=0x7ffff57ee010, destroy_debug_output=<optimized out>) at ../src/mesa/main/context.c:1309
#4 0x00007ffff6428608 in brw_destroy_context (driContextPriv=0x443400) at ../src/mesa/drivers/dri/i965/brw_context.c:1301
#5 0x00007ffff6465213 in driDestroyContext (pcp=0x443400) at ../src/mesa/drivers/dri/common/dri_util.c:533
#6 0x00007ffff74bd18f in dri3_destroy_context (context=0x42e9a0) at ../src/glx/dri3_glx.c:181
#7 0x00007ffff74aeace in glx_display_free (priv=0x42a8f0) at ../src/glx/glxext.c:278
#8 0x00007ffff74aeb5d in __glXCloseDisplay (dpy=0x417970, codes=<optimized out>) at ../src/glx/glxext.c:331
#9 0x00007ffff7dbb9f2 in XCloseDisplay () from /usr/lib64/libX11.so.6
#10 0x00007ffff7ab7ec3 in fgDeinitialize () from /usr/lib64/libglut.so.3
#11 0x00007ffff78f04c7 in __run_exit_handlers () from /lib64/libc.so.6
#12 0x00007ffff78f066a in exit () from /lib64/libc.so.6
#13 0x00007ffff78d6044 in __libc_start_main () from /lib64/libc.so.6
#14 0x00000000004011fa in _start () at ../sysdeps/x86_64/start.S:120
Regression
It used to work fine in 21.2.y and does work in 21.2.6, which was released after 21.3.0, the first failing version.