[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: qemu-iotest 267 got a FPE error when TARGET_PAGE_BITS 16K
From: |
Dr. David Alan Gilbert |
Subject: |
Re: qemu-iotest 267 got a FPE error when TARGET_PAGE_BITS 16K |
Date: |
Mon, 6 Jun 2022 12:17:32 +0100 |
User-agent: |
Mutt/2.2.1 (2022-02-19) |
* gaosong (gaosong@loongson.cn) wrote:
> Hi.
> I run './tests/qemu-iotests/check -qcow2 267 ' got a FPE error on x86
> host emulation LoongArch , The log is :
>
> ...
>
> +../migration/ram.c:2205:9: runtime error: division by zero
> +AddressSanitizer:DEADLYSIGNAL
Interesting.
> +=================================================================
> +==1685462==ERROR: AddressSanitizer: FPE on unknown address 0x556e650eed6e
> (pc 0x556e650eed6e bp 0x7ffcba14ae20 sp 0x7ffcba14adc0 T0)
> + #0 0x556e650eed6d in ram_save_host_page ../migration/ram.c:2205
> + #1 0x556e650ef78f in ram_find_and_save_block ../migration/ram.c:2284
> + #2 0x556e650f53a1 in ram_save_iterate ../migration/ram.c:3010
> + #3 0x556e64c03aa2 in qemu_savevm_state_iterate
> ../migration/savevm.c:1296
> + #4 0x556e64c06ccc in qemu_savevm_state ../migration/savevm.c:1580
> + #5 0x556e64c0d497 in save_snapshot ../migration/savevm.c:2889
> + #6 0x556e64c29221 in hmp_savevm ../monitor/hmp-cmds.c:1095
> + #7 0x556e64c41b31 in handle_hmp_command_exec ../monitor/hmp.c:1103
> + #8 0x556e64c4234c in handle_hmp_command ../monitor/hmp.c:1155
> + #9 0x556e64c38292 in monitor_command_cb ../monitor/hmp.c:49
> + #10 0x556e6596ceca in readline_handle_byte ../util/readline.c:411
> + #11 0x556e64c44b78 in monitor_read ../monitor/hmp.c:1393
> + #12 0x556e656aa41e in qemu_chr_be_write_impl ../chardev/char.c:201
> + #13 0x556e656aa4c5 in qemu_chr_be_write ../chardev/char.c:213
> + #14 0x556e656b1302 in fd_chr_read ../chardev/char-fd.c:72
> + #15 0x556e652b635f in qio_channel_fd_source_dispatch
> ../io/channel-watch.c:84
> + #16 0x7f2b425c104d in g_main_context_dispatch
> (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x5204d)
> + #17 0x556e65949fac in glib_pollfds_poll ../util/main-loop.c:297
> + #18 0x556e6594a18a in os_host_main_loop_wait ../util/main-loop.c:320
> + #19 0x556e6594a486 in main_loop_wait ../util/main-loop.c:596
> + #20 0x556e64b2bb6b in qemu_main_loop ../softmmu/runstate.c:726
> + #21 0x556e64255a69 in qemu_main ../softmmu/main.c:36
> + #22 0x556e64255a9e in main ../softmmu/main.c:45
> + #23 0x7f2b40304082 in __libc_start_main ../csu/libc-start.c:308
> + #24 0x556e6425597d in _start
> (/root/code/github/qemu/build/qemu-system-loongarch64+0x236e97d)
> +
> +AddressSanitizer can not provide additional info.
> +SUMMARY: AddressSanitizer: FPE ../migration/ram.c:2205 in
> ram_save_host_page
> +==1685462==ABORTING
>
> ...
>
> the ram.c
>
> 2199 static int ram_save_host_page(RAMState *rs, PageSearchStatus *pss)
> 2200 {
> 2201 int tmppages, pages = 0;
> 2202 size_t pagesize_bits =
> 2203 qemu_ram_pagesize(pss->block) >> TARGET_PAGE_BITS;
> 2204 unsigned long hostpage_boundary =
> 2205 QEMU_ALIGN_UP(pss->page + 1, pagesize_bits);
> 2206 unsigned long start_page = pss->page;
> 2207 int res;
> ...
>
> qemu_ram_pagesize(pss->block) >> TARGET_PAGE_BITS; === > 4096 >> 14
> So QEMU_ALIGN_UP(pss->page + 1, pagesize_bits); got a FPE error,
>
> I am not familar with qcow2, Could you help me?
This is not qcow2, this is general live migration code.
The problem here is that TARGET_PAGE_BITS is set by the target,
but under emulation we're running with the smaller host page size.
That never happens under kvm, but sounds reasonable I guess for
emulation.
Now, I wonder what the fix is? Should we always send and align to the
larger of host page/target page, rather than always host?
Dave
> Steps to reproduce:
>
> 1 get code
>
> git clone https://github.com/loongson/qemu/tree/tcg-dev
>
> 2 build
>
> ./configure --disable-rdma --disable-pvrdma --prefix=/usr \
> --target-list="loongarch64-softmmu" \
> --disable-libiscsi --disable-libnfs --disable-libpmem \
> --disable-glusterfs --enable-libusb --enable-usb-redir \
> --disable-opengl --disable-xen --enable-spice --enable-werror \
> --disable-capstone --disable-kvm --enable-debug
> --enable-sanitizers
>
> cd build
>
> make -j32
>
> 3 test
>
> ./tests/qemu-iotests/check -qcow2 267
>
>
> Thanks.
> Song Gao
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK