Host: kvm-84 on Intel or AMD. (RHEL 5/x64)
When I use empty VM and add CPU hotplug several times I get a segfault.
Empty VM is started with PXE networking.
Now I connect to Qemu monitor and use:
(qemu) cpu_set 1 online
(qemu) cpu_set 2 online
(qemu) cpu_set 3 online
(qemu) cpu_set 4 online
(qemu) cpu_set 5 online
When I add several CPUs like this - Qemu/KVM userspace will crash.
Very easy to reproduce.
GDB:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x43c2b940 (LWP 3667)]
0x0000000000459167 in cpu_get_apic_tpr (env=0x1cef87b0)
at /root/Linstall/kvm-84rc1/qemu/hw/apic.c:316
316 {
(gdb) c
Continuing.
[Thread 0x4322a940 (LWP 3666) exited]
[Thread 0x43c2b940 (LWP 3667) exited]
[Thread 0x41e28940 (LWP 3660) exited]
[Thread 0x42829940 (LWP 3661) exited]
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
Dmesg:
There are no interesting messages in dmesg.
-Alexey, 22.3.2009.
Can you get a backtrace for all threads in qemu in the moment of the crash?
thanks
Full GDB output attached.
-Alexey, 23.3.2009.
File Added: gdb_of_cpu_hotplug_crash.txt
It is a known problem (at least by me). There is a race when APIC is accessed before it is created.