Closed Reisen closed 1 year ago
Thanks for the report! There was a bug in that piece of code. Userspace may request to read beyond the end of the file, and we must return as many bytes as possible. Could you please check if #138 fixes the problem for you?
I'm testing out libkrun with podman and ran into the following error:
Which I noticed
732776
is the size of myinit
binary. Indeed this seems to happen specifically when the read is detected against theinit
file's inode.I believe this may be related to this check in
setupmapping
? Which I'm guessing would normally lead to a SIGBUS error when trying to read beyond the end of a partially filled page. I worked around this by padding myinit
with 0's:This does work, but it is a bit of a nasty hack. I'm guessing the main cause here is an off by one page mapping bug of some kind but I am not familiar at all with virtio/fuse so I'm making wild guesses, but it happens with the standard suggested build process.
EDIT:
Just spotted #132 -- I'm assuming this is related, just for context this is happening on master for me, my page size for reference: