S2E / s2e-env

Your S2E project management tools. Visit https://s2e.systems/docs to get started.
Other
92 stars 51 forks source link

Better error message if QEMU attempts to load an invalid snapshot #234

Open vitalych opened 5 years ago

vitalych commented 5 years ago

This will be a problem when users upgrade from QEMU 1.0 to 3.0, wondering why snapshots get stuck with a strange error.

qemu-system-i386:qemu-system-i386: Error -22 while loading VM state

plummm commented 5 years ago

Thanks, I encountered this error, I am trying to downgrade from QEMU 3.0 to 1.0

plummm commented 5 years ago

_BEGIN searcher description DFSSearcher END searcher description 0 [State 0] Created initial state Adding CPU (addr = 0x7f88aa27a010, size = 0x36e70) Initializing periodic timer qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.40000001H:EAX.kvmclock [bit 0] qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.40000001H:EAX.kvm-nopiodelay [bit 1] qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.40000001H:EAX.kvmclock [bit 3] qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.40000001H:EAX.kvm-asyncpf [bit 4] qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.40000001H:EAX.kvm-steal-time [bit 5] qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.40000001H:EAX.kvm-pv-eoi [bit 6] qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.40000001H:EAX.kvmclock-stable-bit [bit 24] Adding memory block (startAddr = 0xffffffffffffffff, size = 0x10000000, hostAddr = 0x7f886d600000, isSharedConcrete=0, name=pc.ram) Adding memory block (startAddr = 0xffffffffffffffff, size = 0x40000, hostAddr = 0x7f885e600000, isSharedConcrete=1, name=pc.bios) Adding memory block (startAddr = 0xffffffffffffffff, size = 0x20000, hostAddr = 0x7f885e400000, isSharedConcrete=1, name=pc.rom) Adding memory block (startAddr = 0xffffffffffffffff, size = 0x400000, hostAddr = 0x7f885de00000, isSharedConcrete=1, name=vga.vram) Adding memory block (startAddr = 0xffffffffffffffff, size = 0x10000, hostAddr = 0x7f885dc00000, isSharedConcrete=1, name=cirrus_vga.rom) Adding memory block (startAddr = 0xffffffffffffffff, size = 0x40000, hostAddr = 0x7f885da00000, isSharedConcrete=1, name=e1000.rom) qemu-system-x86_64: warning: hub 0 is not connected to host network Running QEMU with SDL 1.2 is deprecated, and will be removed in a future release. Please switch to SDL 2.0 instead Adding memory block (startAddr = 0xffffffffffffffff, size = 0x20000, hostAddr = 0x7f885c600000, isSharedConcrete=1, name=/rom@etc/acpi/tables) Adding memory block (startAddr = 0xffffffffffffffff, size = 0x1000, hostAddr = 0x7f885c400000, isSharedConcrete=1, name=/rom@etc/table-loader) Adding memory block (startAddr = 0xffffffffffffffff, size = 0x1000, hostAddr = 0x7f885c200000, isSharedConcrete=1, name=/rom@etc/acpi/rsdp) s2e-block: dirty sectors on close:0 s2e-block: dirty after restore: 4880 (ro=1) s2e-block: wasted sectors: 0 qemu-system-x86_64: Length mismatch: 0000:00:02.0/vga.vram: 0x1000000 in != 0x400000: Invalid argument qemu-system-x86_64: error while loading state for instance 0x0 of device 'ram' qemu-system-x8664: Error -22 while loading VM state s2e-block: dirty sectors on close:4880

But the snapshot I give to QEMU is valid, it was created by s2e image_build

vitalych commented 5 years ago

@FlyRabbit Hi! Make sure that QEMU versions are not mismatched. Also, s2e image_build may download pre-built images, which are QEMU 3.0 only. Btw, why do you need to downgrade? Any bugs in the 3.0 one?

plummm commented 5 years ago

Yes, when I downgrade to QEMU 1.0, I can run the project successfully. As you say, It might be the version mismatching problems. I guess the image I downloaded is for QEMU 1.0. So how can I download the latest image for QEMU 3.0? What I did is s2e image_build debian-9.2.1-x86_64

vitalych commented 5 years ago

s2e image_build has an option to download the image if it is not available locally (i.e., you must delete your existing image first). This option will download the latest images available, which is QEMU 3.0 as of now.

Unfortunately, we don't have a system in place to check the QEMU version of the image, so you will run into errors if you download an image and your S2E is not up to date with latest master. If you cannot upgrade your copy of S2E for any reason, you must rebuild images yourself (it takes about ~30-45min to build a Linux image).