Created attachment 341009 [details] /usr/src/debug/glibc-20090416T1610/sysdeps/posix/pwritev.c Description of problem: __atomic_pwritev_replacement is broken. Version-Release number of selected component (if applicable): glibc-2.9.90-19 How reproducible: Grab a qemu git checkout, build it, try to use it. Don't use a valuable guest image. Actual results: pwritev writes random data. Expected results: pwritev acts as documented.
Just look at the source code, it is obvious. pwritev was copyed from preadv with a simple s/read/write/. That isn't correct though, the buffer copying must be adjusted. preadv has to do (and does that correctly): * alloc buffer * pread() * copy data to iovec * free buffer pwritev has to do: * alloc buffer * copy data from iovec * pwrite() * free buffer. pwritev actually does: * alloc buffer * pwritev() <= writes random data * copy data to iovec <= fills iovec with random data * free buffer.
Created attachment 341021 [details] glibc-pwritev.patch Patch I'm about to test.
Patch looks good to me.
Nice catch Adding to F11Blocker - it doesn't affect F11 qemu, but we still shouldn't ship with a completely broken pwritev()
Fix is in rpms/glibc/F-11 but not yet dist-f11: * Fri Apr 24 2009 Jakub Jelinek <jakub> 2.9.90-20 - update from trunk - fix p{read,write}v{,64} (#497429, #497434) - fix strfmon (#496386)
Should be fixed in glibc-2.9.90-22.