Comment 9 for bug 1964777

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

In the bad case the spice worker is at the fist qxl_send_events while at the same time the main process initializing is still not done yet.

(gdb) info thread
  Id Target Id Frame
  1 Thread 0x7ffff67dbc40 (LWP 144970) "qemu-system-x86" qemu_spice_display_is_running (ssd=0x555557194bc0) at ../ui/spice-core.c:1016
  2 Thread 0x7ffff5e2e640 (LWP 144971) "qemu-system-x86" futex_wait (private=0, expected=2, futex_word=0x55555650df40 <qemu_global_mutex>) at ../sysdeps/nptl/futex-internal.h:146
  3 Thread 0x7ffff4d6e640 (LWP 144973) "qemu-system-x86" __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x5555567d6c98)
    at ./nptl/futex-internal.c:57
* 4 Thread 0x7fffcfbff640 (LWP 144975) "SPICE Worker" qxl_send_events (d=0x555557194210, events=16) at ../hw/display/qxl.c:1867

At the time this event is sent the intializer still isn't done yet.

(gdb) thread 1
[Switching to thread 1 (Thread 0x7ffff67dbc40 (LWP 144970))]
#0 qemu_spice_display_is_running (ssd=0x555557194bc0) at ../ui/spice-core.c:1016
1016 }
(gdb) bt
#0 qemu_spice_display_is_running (ssd=0x555557194bc0) at ../ui/spice-core.c:1016
#1 0x0000555555a9abfa in qxl_check_state (d=0x555557194210) at ../hw/display/qxl.c:1200
#2 0x0000555555a9acb3 in qxl_reset_state (d=0x555557194210) at ../hw/display/qxl.c:1210
#3 0x0000555555a9d767 in qxl_realize_common (qxl=0x555557194210, errp=0x7fffffffd9e0) at ../hw/display/qxl.c:2186
#4 0x0000555555a9d9bd in qxl_realize_primary (dev=0x555557194210, errp=0x7fffffffda38) at ../hw/display/qxl.c:2218
#5 0x00005555559d1479 in pci_qdev_realize (qdev=0x555557194210, errp=0x7fffffffdab0) at ../hw/pci/pci.c:2143
#6 0x0000555555be14bf in device_set_realized (obj=0x555557194210, value=true, errp=0x7fffffffdbc0) at ../hw/core/qdev.c:531
#7 0x0000555555beb318 in property_set_bool (obj=0x555557194210, v=0x55555718f370, name=0x555555ee76a9 "realized", opaque=0x5555565ba460, errp=0x7fffffffdbc0) at ../qom/object.c:2268
#8 0x0000555555be92e7 in object_property_set (obj=0x555557194210, name=0x555555ee76a9 "realized", v=0x55555718f370, errp=0x7fffffffdbc0) at ../qom/object.c:1403
#9 0x0000555555bed785 in object_property_set_qobject (obj=0x555557194210, name=0x555555ee76a9 "realized", value=0x555557193e30, errp=0x5555565137d0 <error_fatal>) at ../qom/qom-qobject.c:28
#10 0x0000555555be9652 in object_property_set_bool (obj=0x555557194210, name=0x555555ee76a9 "realized", value=true, errp=0x5555565137d0 <error_fatal>) at ../qom/object.c:1472
#11 0x0000555555be0d53 in qdev_realize (dev=0x555557194210, bus=0x555556937860, errp=0x5555565137d0 <error_fatal>) at ../hw/core/qdev.c:333
#12 0x0000555555be0d80 in qdev_realize_and_unref (dev=0x555557194210, bus=0x555556937860, errp=0x5555565137d0 <error_fatal>) at ../hw/core/qdev.c:340
#13 0x00005555559d176a in pci_realize_and_unref (dev=0x555557194210, bus=0x555556937860, errp=0x5555565137d0 <error_fatal>) at ../hw/pci/pci.c:2210
#14 0x00005555559d17b6 in pci_create_simple_multifunction (bus=0x555556937860, devfn=-1, multifunction=false, name=0x555555e6fb8f "qxl-vga") at ../hw/pci/pci.c:2218
#15 0x00005555559d17ea in pci_create_simple (bus=0x555556937860, devfn=-1, name=0x555555e6fb8f "qxl-vga") at ../hw/pci/pci.c:2224
#16 0x00005555559d0fb2 in pci_vga_init (bus=0x555556937860) at ../hw/pci/pci.c:1996
#17 0x0000555555aeb9a7 in pc_vga_init (isa_bus=0x5555567d56e0, pci_bus=0x555556937860) at ../hw/i386/pc.c:981
#18 0x0000555555ad7654 in pc_q35_init (machine=0x55555679e400) at ../hw/i386/pc_q35.c:321
#19 0x0000555555ad7872 in pc_init_v6_2 (machine=0x55555679e400) at ../hw/i386/pc_q35.c:371
#20 0x00005555558e7ada in machine_run_board_init (machine=0x55555679e400) at ../hw/core/machine.c:1181
#21 0x0000555555b386e1 in qemu_init_board () at ../softmmu/vl.c:2652
#22 0x0000555555b38920 in qmp_x_exit_preconfig (errp=0x5555565137d0 <error_fatal>) at ../softmmu/vl.c:2740
#23 0x0000555555b3b1a8 in qemu_init (argc=13, argv=0x7fffffffe2a8, envp=0x7fffffffe318) at ../softmmu/vl.c:3775
#24 0x000055555580bd81 in main (argc=13, argv=0x7fffffffe2a8, envp=0x7fffffffe318) at ../softmmu/main.c:49

In the central
void qemu_init(int argc, char **argv, char **envp)

we have
3774 if (!preconfig_requested) {
3775 qmp_x_exit_preconfig(&error_fatal);
3776 }
3777 qemu_init_displays();

And we see that here the main thread still is under line 3775 in qmp_x_exit_preconfig while the first event is sent.