- Status: open --> pending
Only occurs when you're requesting directio for a run.
Random failures at I/O startup using directio; can be hangs, failures of I/O processes, or other mysterious problems. Sometimes there's no failure, sometimes there is. May be the cause of bug 60, among others.
The regular memory buffer code correction is in flowop.c, line 510. Change
malloc(memsize);
to
memalign(512, memsize);
This fixes a problem in flowop_library.c, line 494, where it rounds the buffer address to the nearest 512 byte boundary, but can round down below the buffer starting point, wiping out space that doesn't belong to to the buffer area. How much it wipes, if anything, is random, based on the random buffer starting offset chosen for the pass (line 438). It often gets the pointer to the I/O routine pointers, causing a branch to location 0, which is hard to catch in the background.
A similar fix is needed for the ipc_ismmalloc call in flowop.c line 507, but the fix is more complicated as there's no easy way to request alignment in the ISM code.
This can also be fixed in flowop.c, updating the following at line 502:
memsize = (size_t)threadflow->tf_constmemsize + 512;
and updating the following at line 489 in flowop_library.c.
if (flowoplib_fileattrs(flowop) & FLOW_ATTR_DIRECTIO)
*iobufp = (caddr_t)(((((unsigned long)(*iobufp)) / 512) + 1) * 512);
This makes the buffer 512 bytes larger, allowing the random address to be rounded up without overrunning its end.
This second fix may work for both regular and ISM buffers.