I've experienced a situation using the c function msync() where the
function returns successfully but the file being mapped has been
corrupted (file changed but extra bytes set to zero). This doesn't
happen everytime it varies from 1 in 5 times to 2 out of 3 times.
Has anyone seen this behaviour before?
I've tried changing some(most) of the dynamic kernel options using the
kernel tuner and recompiled the kernel with various options, tried the
mapped file on advfs and ufs, applied the latest accumulative patch
kit, searching for similar problems, to no avail...
Am I sure that it's the msync() function?
Yes. Using ladebug and confirming that what's in the mapped memory is
ok, as soon as the msync function returns the file is either corrupt
What does the application do?
In my test case (approximately);
creates a private memory map of files A,B,C which are about 5MB in
modifies a couple of the private memory maps (e.g A & B)
creates a shared memory map for A
bcopy's the modified private map to the shared map for A
msync shared map A
munmap shared map A
munmap private map A
repeat for other modified private maps
Any help, suggestions or comments would be greatly appreciated.