Segfault when hibernating a KVM VM with QEMU 8.2.3 Description of problem: Attempting to hibernate the machine crashes QEMU. Steps to reproduce: This involves Nix, please tell me if you want a reproducer that doesn't. 1. nix build github:NixOS/nixpkgs#nixosTests.hibernate.driver 2. ./result/bin/nixos-test-driver 3. Observe crash Additional information: Backtrace: ``` #0 kvm_virtio_pci_vq_vector_release (proxy=0x55bd979fd130, vector=) at ../hw/virtio/virtio-pci.c:834 #1 kvm_virtio_pci_vector_release_one (proxy=proxy@entry=0x55bd979fd130, queue_no=queue_no@entry=0) at ../hw/virtio/virtio-pci.c:965 #2 0x000055bd9380c430 in virtio_pci_set_vector (vdev=0x55bd97a05500, proxy=0x55bd979fd130, queue_no=0, old_vector=1, new_vector=65535) at ../hw/virtio/virtio-pci.c:1445 #3 0x000055bd939c5490 in memory_region_write_accessor (mr=0x55bd979fdc70, addr=26, value=, size=2, shift=, mask=, attrs=...) at ../system/memory.c:497 #4 0x000055bd939c4d56 in access_with_adjusted_size (addr=addr@entry=26, value=value@entry=0x7ff49d1ff3e8, size=size@entry=2, access_size_min=, access_size_max=, access_fn=0x55bd939c5410 , mr=, attrs=...) at ../system/memory.c:573 #5 0x000055bd939c5081 in memory_region_dispatch_write (mr=mr@entry=0x55bd979fdc70, addr=addr@entry=26, data=, op=, attrs=attrs@entry=...) at ../system/memory.c:1528 #6 0x000055bd939ccb0c in flatview_write_continue (fv=fv@entry=0x7ff4445771c0, addr=addr@entry=61572651286554, attrs=..., attrs@entry=..., ptr=ptr@entry=0x7ff4a082d028, len=len@entry=2, addr1=, l=, mr=0x55bd979fdc70) at ../system/physmem.c:2714 #7 0x000055bd939ccd83 in flatview_write (fv=0x7ff4445771c0, addr=addr@entry=61572651286554, attrs=attrs@entry=..., buf=buf@entry=0x7ff4a082d028, len=len@entry=2) at ../system/physmem.c:2756 #8 0x000055bd939d0099 in address_space_write (len=2, buf=0x7ff4a082d028, attrs=..., addr=61572651286554, as=0x55bd94a4e720 ) at ../system/physmem.c:2863 #9 address_space_rw (as=0x55bd94a4e720 , addr=61572651286554, attrs=attrs@entry=..., buf=buf@entry=0x7ff4a082d028, len=2, is_write=) at ../system/physmem.c:2873 #10 0x000055bd93a24548 in kvm_cpu_exec (cpu=cpu@entry=0x55bd9628a3e0) at ../accel/kvm/kvm-all.c:2915 #11 0x000055bd93a25795 in kvm_vcpu_thread_fn (arg=arg@entry=0x55bd9628a3e0) at ../accel/kvm/kvm-accel-ops.c:51 #12 0x000055bd93bb5fa8 in qemu_thread_start (args=0x55bd96294940) at ../util/qemu-thread-posix.c:541 #13 0x00007ff4a19fd272 in start_thread (arg=) at pthread_create.c:447 #14 0x00007ff4a1a78dcc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78 ``` Bisected to https://gitlab.com/qemu-project/qemu/-/commit/fcbb086ae590e910614fe5b8bf76e264f71ef304, reverting that change seems to make things work again.