Subject: kernel crash with munmap

From: Philip Blundell <[email-masked]>
Date: Tue, 25 Jul 2000 19:30:17 +0100

When I run the program below on my CATS under 2.4.0-test2, the machine locks 
up.  It seems to be OK on my i386 with 2.4.0-test5.  Any ideas what might be 
wrong?

p.

--

#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>

#define NULL 0

int main(int argc, char *argv)
{
  char *s = tmpnam(NULL);
  int fd = open(s, O_CREAT | O_RDWR);
  int fd2 = open("/bin/ls", O_RDONLY);
  ftruncate(fd, 640*1024);
  unlink(s);
  mmap(0x8000, 640*1024, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_FIXED, fd, 0);
  read(fd2, 0x8000, 640*1024);
  munmap(0x8000, 640*1024);
  exit(0);
}

unsubscribe: body of `unsubscribe linux-arm-kernel' to [email-masked]