lkml.org 
[lkml]   [1996]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectshowstopper, mmap()+read(), pre2.0.12

i guess it's well known, but anyways, i've simplified down the "grep .."
problem to the following code. It locks up my machine very reliably, old
kernels like 1.3.64 too:

[ sometimes it locks up with interrupts turned off, sometimes the kernel
loops in __get_free_page() (?) i think ]:

[ can provide more info but i guess this is enough ]:

[ N has to be bigger than mem+swap ]

---------- cut here ---------------->
#include <unistd.h>
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>

#define N 83894272

int main( void )
{
int fd;
void * map;
fd=open("/dev/zero",O_RDONLY);

map = mmap( 0, N, PROT_READ|PROT_WRITE, MAP_PRIVATE|0x20, fd, 0);


read( fd, map, N);

return(0);
}




\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.124 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site