creating vm with tpm crashes libvirt

Description:

If I set New VM Preferences, x86 Firmware to UEFI in virt-manager and try to create new VM, libvirt crashes. If x86 Firmware is left Default (BIOS), there is no TPM defined initially and can set the firmware to UEFI before install and it works. Also can add TPM to already created VM and it works fine

Additional info:

  • package version(s): libvirt 1:10.10.0-1 virt-manager 4.1.0-3 virt-install 4.1.0-3 qemu-system-x86 9.1.2-1 qemu-system-x86-firmware 9.1.2-1 qemu-desktop 9.1.2-1 qemu-base 9.1.2-1 edk2-ovmf 202411-1 swtpm 0.10.0-1
  • config and/or log files: dmesg:
[  387.330061] rpc-libvirtd[2341]: segfault at 670 ip 00007e1aac1c6660 sp 00007e1aa7ffe5b0 error 4 in libvirt_driver_qemu.so[db660,7e1aac12a000+12c000] likely on CPU 7 (core 7, socket 0)
[  387.330071] Code: 00 00 0f 1f 84 00 00 00 00 00 49 83 c5 01 4d 3b ac 24 68 06 00 00 73 42 49 8b 84 24 70 06 00 00 4a 8b 14 e8 83 7a 0c 01 75 e0 <49> 8b 86 70 06 00 00 48 8b 7d c8 45 89 f8 48 89 de 4a 8b 0c e8 ff

journal:

Dec 13 12:44:18 thot systemd[1]: Created slice Virtual Machine and Container Slice.
Dec 13 12:44:18 thot systemd[1]: Listening on libvirt locking daemon socket.
Dec 13 12:44:18 thot systemd[1]: Listening on libvirt logging daemon socket.
Dec 13 12:44:18 thot systemd[1]: Virtual Machine and Container Storage (Compatibility) was skipped because of an unmet condition check (ConditionPathExists=/var/lib/machines.raw).
Dec 13 12:44:18 thot systemd[1]: Starting Virtual Machine and Container Registration Service...
Dec 13 12:44:18 thot systemd[1]: Started Virtual Machine and Container Registration Service.
Dec 13 12:44:18 thot systemd[1]: Starting libvirt legacy monolithic daemon...
Dec 13 12:44:18 thot systemd[1]: Started libvirt legacy monolithic daemon.
Dec 13 12:44:27 thot gnome-character[2093]: JS LOG: Characters Application exiting
Dec 13 12:44:47 thot systemd[1]: systemd-timedated.service: Deactivated successfully.
Dec 13 12:44:56 thot systemd[1]: Listening on libvirt logging daemon admin socket.
Dec 13 12:44:56 thot systemd[1]: Starting libvirt logging daemon...
Dec 13 12:44:56 thot systemd[1]: Started libvirt logging daemon.
Dec 13 12:44:56 thot kernel: rpc-libvirtd[2341]: segfault at 670 ip 00007e1aac1c6660 sp 00007e1aa7ffe5b0 error 4 in libvirt_driver_qemu.so[db660,7e1aac12a000+12c000] likely on CPU 7 (core 7, socket 0)
Dec 13 12:44:56 thot kernel: Code: 00 00 0f 1f 84 00 00 00 00 00 49 83 c5 01 4d 3b ac 24 68 06 00 00 73 42 49 8b 84 24 70 06 00 00 4a 8b 14 e8 83 7a 0c 01 75 e0 <49> 8b 86 70 06 00 00 48 8b 7d c8 45 89 f8 48 89 de 4a 8b 0c e8 ff
Dec 13 12:44:56 thot systemd-coredump[2414]: Process 2338 (libvirtd) of user 0 terminated abnormally with signal 11/SEGV, processing...
Dec 13 12:44:56 thot systemd[1]: Created slice Slice /system/systemd-coredump.
Dec 13 12:44:56 thot systemd[1]: Started Process Core Dump (PID 2414/UID 0).
Dec 13 12:44:57 thot systemd-coredump[2415]: [🡕] Process 2338 (libvirtd) of user 0 dumped core.
                                             
                                             Stack trace of thread 2341:
                                             #0  0x00007e1aac1c6660 qemuExtDevicesStart (libvirt_driver_qemu.so + 0xdb660)
                                             #1  0x00007e1aac228347 qemuProcessLaunch (libvirt_driver_qemu.so + 0x13d347)
                                             #2  0x00007e1aac22cfdb qemuProcessStart (libvirt_driver_qemu.so + 0x141fdb)
                                             #3  0x00007e1aac198f64 n/a (libvirt_driver_qemu.so + 0xadf64)
                                             #4  0x00007e1ab20f7497 virDomainCreateXML (libvirt.so.0 + 0x2f7497)
                                             #5  0x00005b2987573e1e n/a (n/a + 0x0)
                                             #6  0x00007e1ab1ff3a9e virNetServerProgramDispatch (libvirt.so.0 + 0x1f3a9e)
                                             #7  0x00007e1ab1ff3ff4 n/a (libvirt.so.0 + 0x1f3ff4)
                                             #8  0x00007e1ab1ff4107 n/a (libvirt.so.0 + 0x1f4107)
                                             #9  0x00007e1ab1f228b7 n/a (libvirt.so.0 + 0x1228b7)
                                             #10 0x00007e1ab1f21d33 n/a (libvirt.so.0 + 0x121d33)
                                             #11 0x00007e1ab1a4639d n/a (libc.so.6 + 0x9439d)
                                             #12 0x00007e1ab1acb49c n/a (libc.so.6 + 0x11949c)
                                             
                                             Stack trace of thread 2338:
                                             #0  0x00007e1ab1abdbb0 ppoll (libc.so.6 + 0x10bbb0)
                                             #1  0x00007e1ab2387327 n/a (libglib-2.0.so.0 + 0xc0327)
                                             #2  0x00007e1ab2323a55 g_main_context_iteration (libglib-2.0.so.0 + 0x5ca55)
                                             #3  0x00007e1ab1ec7cb5 virEventGLibRunOnce (libvirt.so.0 + 0xc7cb5)
                                             #4  0x00007e1ab1ff5854 virNetDaemonRun (libvirt.so.0 + 0x1f5854)
                                             #5  0x00005b2987552af6 n/a (n/a + 0x0)
                                             #6  0x00007e1ab19d7e08 n/a (libc.so.6 + 0x25e08)
                                             #7  0x00007e1ab19d7ecc __libc_start_main (libc.so.6 + 0x25ecc)
                                             #8  0x00005b2987553415 n/a (n/a + 0x0)
                                             ELF object binary architecture: AMD x86-64
Dec 13 12:44:57 thot systemd[1]: systemd-coredump@0-2414-0.service: Deactivated successfully.
Dec 13 12:44:57 thot systemd[1]: systemd-coredump@0-2414-0.service: Consumed 307ms CPU time, 197.7M memory peak.
Dec 13 12:44:57 thot systemd[1]: libvirtd.service: Main process exited, code=dumped, status=11/SEGV
Dec 13 12:44:57 thot systemd[1]: libvirtd.service: Failed with result 'core-dump'.
Dec 13 12:44:57 thot systemd[1]: libvirtd.service: Scheduled restart job, restart counter is at 1.
Dec 13 12:44:57 thot systemd[1]: Starting libvirt legacy monolithic daemon...
Dec 13 12:44:57 thot systemd[1]: Started libvirt legacy monolithic daemon.

Steps to reproduce:

  1. Set New VM Preferences, x86 Firmware to UEFI in virt-manager
  2. Create VM
Edited by Jarkko Torvinen