kern/67919: imagemagicks convert image to movie conversion
kills 5.2.1 machine in vnode_pager_putpages
Edwin Groothuis
edwin at mavetju.org
Mon Jun 14 07:40:05 GMT 2004
The following reply was made to PR kern/67919; it has been noted by GNATS.
From: Edwin Groothuis <edwin at mavetju.org>
To: freebsd-gnats-submit at FreeBSD.org
Cc:
Subject: Re: kern/67919: imagemagicks convert image to movie conversion kills 5.2.1 machine in vnode_pager_putpages
Date: Mon, 14 Jun 2004 17:34:19 +1000
I've attached a sample program with which the behaviour can be
simulated. It works against my 256Mb /tmp partition. I have had
different experiences with it.
1. start program, wait a couple of seconds, see these messages:
Jun 14 16:49:39 k7 kernel: vnode_pager_putpages: I/O error 28
Jun 14 16:49:39 k7 kernel: vnode_pager_putpages: residual I/O 65536 at 124934
Jun 14 16:49:39 k7 kernel: pid 781 (mtest), uid 1001 inumber 6 on /tmp: filesystem full
Two things can happen now:
2a. ^C the program, program itself becomes unkillable (state is
something like bwrite in top), but machine responds (although
very lagging) until it doesn't do anything further. The messages
above keep coming in a regular interval (once every second or so)
2b. kill -9 the program, program terminates after some seconds.
Machine keeps working for two-three seconds and an endless
stream of vnode_pager_putpages messsages overflow the console.
Some googling for the vnode_pager_putpages showed me this thread too:
http://archives.neohapsis.com/archives/freebsd/2000-05/0345.html
which sounds exactly like what is happening here.
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#define FNAME "/tmp/blaat"
#define SIZE 500000*1024
int main(int argc,char **argv) {
FILE *f;
char *a=malloc(SIZE);
int fd;
int i;
printf("Start\n");
if ((f=fopen(FNAME,"w"))==NULL) { perror("fopen"); return 1; }
if (fseek(f,SIZE,SEEK_SET)!=0) { perror("fseek"); return 1; }
if (fwrite("a",1,1,f)!=1) { perror("fwrite"); return 1; }
if (fseek(f,0,SEEK_SET)!=0) { perror("fseek"); return 1; }
if (fclose(f)!=0) { perror("fclose"); return 1; }
if ((fd=open(FNAME,O_RDWR))==NULL) { perror("open"); return 1; }
if ((a=mmap(NULL,SIZE,PROT_WRITE|PROT_READ,MAP_SHARED,fd,0))==MAP_FAILED) {
perror("mmap"); return 1; }
for (i=0;i<SIZE/1024;i++) { a[1024*i]=65; }
if (msync(a,0,MS_SYNC)!=0) { perror("msync"); return 1; }
if (munmap(a,SIZE)!=0) { perror("munmap"); return 1; }
if (close(fd)!=0) { perror("close"); return 1; }
printf("Stop\n");
return 0;
}
More information about the freebsd-bugs
mailing list