Hiya,

Trying to get cloud-init working on a fairly recent OSv (0.55) image
using an ISO to provide the YAML file. This used to work fine on my
previous OSv image, but now I'm hitting an assert failure:

Assertion failed: (uio->uio_resid % BSIZE) == 0 (fs/vfs/vfs_bdev.cc:
bdev_read: 33)

[backtrace]
0x000000004023acac <__assert_fail+28>
0x00000000404459e5 <bdev_read+261>
0x000000004044e62d <device_read+61>
0x000000004044babe <vfs_file::read(uio*, int)+94>
0x00000000404491ba <sys_read+234>
0x000000004043ef10 <???+1078193936>
0x0000000040464b4d <__stdio_read+61>
0x00000000404994cc <fread_unlocked+188>
0x00001000006a772a <???+6977322>
0x00001000006a7c0c <cdio_stream_read+107>
0x00001000006d9a50 <???+7182928>
0x00001000006d9a8a <iso9660_iso_seek_read+55>
0x00001000006d9011 <???+7180305>
0x00001000006d9077 <???+7180407>
0x00001000006d90cd <iso9660_ifs_read_superblock+83>
0x00001000006d8a03 <???+7178755>
0x00001000006d8b07 <???+7179015>
0x00001000006d8ad6 <???+7178966>
0x000010000068cc9f <???+6868127>
0x000010000068d347 <???+6869831>
0x00000000404377a0 <osv::application::run_main()+64>
0x0000000040223523 <osv::application::main()+147>

The iso hasn't changed and mounts fine on a loopback under linux.
Building a new iso gives the same error. GDB backtrace is as follows:

#0  0x0000000040399f32 in processor::cli_hlt () at
arch/x64/processor.hh:247
#1  arch::halt_no_interrupts () at arch/x64/arch.hh:48
#2  osv::halt () at arch/x64/power.cc:26
#3  0x000000004023ac82 in abort (fmt=fmt@entry=0x406535f0 "Assertion
failed: %s (%s: %s: %d)\n")
    at runtime.cc:140
#4  0x000000004023acad in __assert_fail (expr=expr@entry=0x406a46d1
"(uio->uio_resid % BSIZE) == 0", 
    file=file@entry=0x406a46a6 "fs/vfs/vfs_bdev.cc",
line=line@entry=33, 
    func=func@entry=0x406a469c "bdev_read") at runtime.cc:147
#5  0x00000000404459e6 in bdev_read (dev=<optimised out>,
uio=0x2000012ff480, ioflags=<optimised out>)
    at fs/vfs/vfs_bdev.cc:42
#6  0x000000004044e62e in device_read (dev=0xffffa00100a18080,
uio=0x2000012ff480, ioflags=0)
    at fs/devfs/device.cc:387
#7  0x000000004044babf in vfs_file::read (this=0xffffa00101545900,
uio=0x2000012ff480, flags=<optimised out>)
    at fs/vfs/vfs_fops.cc:54
#8  0x00000000404491bb in sys_read (fp=0xffffa00101545900,
iov=iov@entry=0x2000012ff530, niov=niov@entry=2, 
    offset=offset@entry=-1, count=count@entry=0x2000012ff4f8) at
fs/vfs/vfs_syscalls.cc:275
#9  0x000000004043ef11 in preadv (fd=<optimised out>,
iov=iov@entry=0x2000012ff530, iovcnt=iovcnt@entry=2, 
    offset=offset@entry=-1) at fs/vfs/main.cc:422
#10 0x000000004043ef80 in readv (fd=<optimised out>,
iov=iov@entry=0x2000012ff530, iovcnt=iovcnt@entry=2)
    at fs/vfs/main.cc:436
#11 0x0000000040464b4e in __stdio_read (f=0xffff900101577000,
buf=<optimised out>, len=2048)
    at libc/stdio/__stdio_read.c:28
#12 0x00000000404994cd in fread (destv=<optimised out>, size=1,
nmemb=2048, f=0xffff900101577000)
    at musl/src/stdio/fread.c:26
#13 0x00001000006a772b in _stdio_read ()
#14 0x00001000006a7c0d in cdio_stream_read ()
#15 0x00001000006d9a51 in iso9660_seek_read_framesize ()
#16 0x00001000006d9a8b in iso9660_iso_seek_read ()
#17 0x00001000006d9012 in iso9660_ifs_read_pvd_loglevel ()
#18 0x00001000006d9078 in iso9660_ifs_read_pvd ()

#5  0x00000000404459e6 in bdev_read (dev=<optimised out>,
uio=0x2000012ff480, ioflags=<optimised out>)
    at fs/vfs/vfs_bdev.cc:42
42              while (uio->uio_resid > 0) {
(gdb) p uio->uio_resid
$8 = 133112

(gdb) up
#6  0x000000004044e62e in device_read (dev=0xffffa00100a18080,
uio=0x2000012ff480, ioflags=0)
    at fs/devfs/device.cc:387
387             error = (*ops->read)(dev, uio, ioflags);
(gdb) p dev->name
$9 = "vblk1\000\000\000\000\000\000"

It seem to be reading the correct block device:

virtio-blk: Add blk device instances 0 as vblk0, devsize=524288000
virtio-blk: Add blk device instances 1 as vblk1, devsize=378880

I see there was a similar assert that Justin hit a while back (#877). I
made the same change (replace fread with read and change the args) and
that no longer asserts, but doesn't read the ISO (as Justin found).

Any ideas?

Cheers
Rick

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/e3c276c404ba713bad5a87c13eddcfb837a64b88.camel%40rossfell.co.uk.

Reply via email to