Re: how to flush out cache.?
From: Matthew Dillon (dillon_at_apollo.backplane.com)
Date: 04/23/04
- Previous message: Matthew Dillon: "Re: how to flush out cache.?"
- In reply to: Stephan Uphoff: "Re: how to flush out cache.?"
- Next in thread: Matthew Dillon: "Re: how to flush out cache.?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 22 Apr 2004 19:42:24 -0700 (PDT) To: Stephan Uphoff <ups@tree.com>
Ok... I've done some more testing.
Ahh! I finally was able to reproduce the problem with PROT_READ, and
I now see the code bit you were talking about. That's definitely a bug.
Here's the test program that reproduces the problem. This is definitely
a serious bug.
-Matt
/*
* y.c
*/
#include <sys/types.h>
#include <sys/mman.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
int
main(int ac, char **av)
{
int fd;
char *ptr1;
char *ptr2;
fd = open("test.dat", O_RDWR|O_CREAT|O_TRUNC, 0666);
ftruncate(fd, 4096);
ptr1 = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
*ptr1 = 'A';
ptr2 = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, 0);
if (msync(ptr2, 4096, MS_INVALIDATE | MS_SYNC) < 0)
perror("msync");
printf("contents of *ptr1 is %d\n", *ptr1);
printf("contents of *ptr2 is %d\n", *ptr2);
return(0);
}
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Matthew Dillon: "Re: how to flush out cache.?"
- In reply to: Stephan Uphoff: "Re: how to flush out cache.?"
- Next in thread: Matthew Dillon: "Re: how to flush out cache.?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|