ui/spice-display: Avoid segment fault when spice is enabled without qxl
PATCH 1/1 ui/spice-display: Avoid segment fault when spice is enabled without qxl
(gdb) r -enable-kvm -m 512 -spice port=5900,addr=0.0.0.0,disable-ticketing ArchLinux.img
Starting program: /root/usr/bin/qemu-system-x86_64 -enable-kvm -m 512 -spice port=5900,addr=0.0.0.0,disable-ticketing ArchLinux.img
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffeed93700 (LWP 23838)]
[New Thread 0x7fffee391700 (LWP 23839)]
Program received signal SIGSEGV, Segmentation fault. 0x00005555557df97d in qemu_spice_destroy_primary_surface (ssd=0x55555611ca80,
id=0, async=QXL_SYNC) at ui/spice-display.c:119
119 ssd->worker->destroy_primary_surface(ssd->worker, id);
(gdb) bt
ssd=0x55555611ca80, id=0, async=QXL_SYNC) at ui/spice-display.c:119
at ui/spice-display.c:343
at ui/spice-display.c:397
at ui/spice-display.c:566
dcl=0x555555cdb040) at ./console.h:218
at ui/spice-display.c:585
envp=0x7fffffffda18) at vl.c:3902(gdb) p ssd->worker
$1 = (QXLWorker *) 0x0
...
...
Before qemu_spice_add_interface() was called, sdpy.worker was not be initialized yet, in this case, segment fault occurred while qemu_spice_display_resize() was called.
--- ui/spice-display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
ui/spice-display.c +3 -1
@@ -562,7 +562,9 @@ static void display_update(struct DisplayState *ds, int x, int y, int w, int h)static void display_resize (struct DisplayState *ds) { -qemu_spice_display_resize (&sdpy); +if (sdpy.worker) { +qemu_spice_display_resize (&sdpy); + } }static void display_refresh (struct DisplayState *ds)
Signature · 1 line
1.8.0
Quoted 3 lines
Before
qemu_spice_add_interface()was called, sdpy.worker was not be initialized yet, in this case, segment fault occurred whileqemu_spice_display_resize()was called.
Pending spice pull req fixes it in another way, patch is here:
http://patchwork.ozlabs.org/patch/196518/
cheers,
Gerd