QEMU crashes on device reset (VM restart)
With qemu & virgl from git on Fedora 34 (mesa 21.1.3-1.fc34.x86_64), when restarting a VM with virgl, SEGV:
(gdb) bt
#0 0x00007ffff5a13847 in () at /lib64/libc.so.6
#1 0x00007ffff593c726 in () at /lib64/libc.so.6
#2 0x00007ffff5911292 in () at /lib64/libc.so.6
#3 0x00007ffff7633435 in __isoc99_vsscanf () at /lib64/libasan.so.6
#4 0x00007ffff763354f in __isoc99_sscanf () at /lib64/libasan.so.6
#5 0x00007ffec6ef2c77 in vrender_get_glsl_version (glsl_version=0x6110002da0f0) at ../src/vrend_renderer.c:9928
#6 0x00007ffec6eb6a8f in vrend_create_context (id=0, nlen=4, debug_name=0x7ffec7044c80 "HOST") at ../src/vrend_renderer.c:6484
#7 0x00007ffec6f0209a in vrend_renderer_reset () at ../src/vrend_renderer.c:10927
#8 0x00007ffec6e33071 in virgl_renderer_reset () at ../src/virglrenderer.c:729
#9 0x00007ffec76395ca in virtio_gpu_virgl_reset (g=0x633000019650) at ../hw/display/virtio-gpu-virgl.c:595
#10 0x00007ffec762c7e6 in virtio_gpu_gl_reset (vdev=0x633000019650) at ../hw/display/virtio-gpu-gl.c:102
#11 0x000055555914e3b1 in virtio_reset (opaque=0x633000019650) at ../hw/virtio/virtio.c:1998
#12 0x0000555558abe31e in virtio_bus_reset (bus=0x633000008918) at ../hw/virtio/virtio-bus.c:100
(gdb) f 5
#5 0x00007ffec6ef2c77 in vrender_get_glsl_version (glsl_version=0x6110002da0f0) at ../src/vrend_renderer.c:9928
9928 c = sscanf((const char *)version_str, "%i.%i",
(gdb) l
9923 char tmp[20];
9924 c = sscanf((const char *)version_str, "%s %s %s %s %i.%i",
9925 tmp, tmp, tmp, tmp, &major_local, &minor_local);
9926 assert(c == 6);
9927 } else {
9928 c = sscanf((const char *)version_str, "%i.%i",
9929 &major_local, &minor_local);
9930 assert(c == 2);
9931 }
9932
(gdb) p version_str
$3 = (const GLubyte *) 0x0
(gdb)
Edited by Marc-André Lureau