Hangs on HTTP errors when using the curl block driver
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Expired
|
Undecided
|
Unassigned |
Bug Description
Hi,
It seems that qemu-kvm does not handle HTTP errors gracefully when using the curl block driver and a synchronous request is made (i.e. one using bdrv_read_em() for example). In these cases, if an HTTP error (such as 404 or 416) is returned, the aio thread exits but the main thread never finishes waiting for I/O completion, thus freezing KVM.
Versions affected:
At least 0.11.1 and 0.12.4 were tested and found to be affected.
How to reproduce:
Simply specify a non-existing path for an HTTP URL as a CDROM drive.
kvm -drive file=test.
qemu-kvm will hang on boot using 100% cpu as it will try to open the block device. At that point, the backtrace is (qemu-kvm-0.12.4):
#0 0x000000000047aaaf in qemu_aio_wait () at aio.c:163
#1 0x000000000047a055 in bdrv_read_em (bs=0x1592320, sector_num=0, buf=0x7fffcf7e9ae0 "¨\237~Ïÿ\177", nb_sectors=4)
at block.c:1939
#2 0x0000000000479c0e in bdrv_pread (bs=0x1592320, offset=<value optimized out>, buf=0x7fffcf7e9ae0, count1=2048)
at block.c:716
#3 0x000000000047a862 in bdrv_open2 (bs=0x1591a30, filename=0x1559f00 "http://
flags=0, drv=0x84eca0) at block.c:316
#4 0x000000000040dcb4 in drive_init (opts=0x1559e60, opaque=<value optimized out>, fatal_error=
at /build/
#5 0x000000000040e086 in drive_init_func (opts=0x155db00, opaque=0x0)
at /build/
#6 0x0000000000475421 in qemu_opts_foreach (list=<value optimized out>, func=0x40e070 <drive_init_func>,
opaque=
#7 0x000000000040e9af in main (argc=7, argv=0x7fffcf7e
at /build/
Thanks
QEMU 0.11 / 0.12 are pretty much outdated nowadays ... can you still reproduce this issue with the latest version of QEMU?