Yes, this program still causes an oops the first time it is run in
2.0.29, the second time it is run it hangs and can't be killed (it
still causes the oops though). I don't have the knowledge to fix this
but one thing I did notice is that the program works as expected (ie
it just segfaults) in 2.1.26, in earlier 2.1.xx kernels (the really
early ones) it segfaulted and caused a kernel message saying
"Exception at XXXXXXXX (YYYYYYYY)" so apparently the fix for this
problem might even be in one of the 2.1.xx patches...
Hope this helps...
>
> #include <stdio.h>
> #include <unistd.h>
> #include <sys/mman.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <string.h>
> #include <errno.h>
>
> void main ()
> {
> int fd;
> void *p;
> char buf[1024];
> fd = open("test", O_RDONLY);
> p = mmap(NULL, 200, PROT_WRITE, MAP_PRIVATE, fd, 0);
> strncpy (buf, p, 100);
> printf ("%s\n", buf);
> munmap (p, 200);
> exit (0);
> }
>
> The "Oops" from the other post is mostly identical-looking.
> (I haven't tried this, so if it doesn't work, I apologize. I'll try today)
Be careful if you try this, the system is unable to umount all
partitons cleanly after this so you never know what might happend...
> Of course, you'll have to enable core dumps.
>
> Bernd
PS. Sorry Bernd if you recieve several messages about this, I sent you
an other one that I ment to cc to linux-kernel but I think I forgot
that so I'm sending another one now...
-- Johnny Stenback, programmer / University of Vaasa, Computer Centre E-Mail jst@uwasa.fi, Phone +358 50 5575 094