Messages in this thread | | | Date | Tue, 10 Aug 1999 18:32:07 +0100 (BST) | From | Mike <> | Subject | Re: msync problem in 2.3.x |
| |
On Fri, 6 Aug 1999, =?ISO-8859-1?Q? =BD=C9=B8=B6=B7=CE ?= wrote:
> my problem is that after running a small test program, > the program will not terminate. and every program like > ps, top, w print nothing, and don't terminate... > I can't replicate this.
> what is the reason of this ? please, let me know it. > > #include <unistd.h> > #include <sys/mman.h> > > main() > { > int fd; > char *mem; > int i = 0; > char c = 0; > > fd = open("file", 0666); > lseek(fd, 1000000, 0); > mem = mmap(0, 1000000, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); > if (mem <= 0) ^^^^^^^^^^ Erm? Do you really mean that?
> exit(1); > printf("%p\n", mem); > > for (c = 0; c < 100; c++) > for (i = 0; i < 1000000; i++) > mem[i] = c; > msync(mem, 1000000, MS_SYNC); > close(fd); > }
I consistently get: $ ./foo 0xffffffff Segmentation fault (core dumped) $
-- Mike <rickettm@ox.compsoc.net>
You teach best what you most need to learn.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |