Subject: Re: Make readme slow in pkgsrc
To: None <bsalai@rochester.rr.com>
From: Perry E. Metzger <perry@piermont.com>
List: netbsd-help
Date: 01/16/1999 16:55:24
"Stephen B. Salai" <bsalai@rochester.rr.comlaw.tmonline.com> writes:
> I just did a make readme in pkgsrc.devel. Not only did it take about
> half an hour, but my SS5 became almost unusably slow during that time, I
> mean really slow, the mouse didn't respond for a second or so, keystroke
> debouncing stopped working, and things just started to act like X
> running on a ZX-81.
> 
> This is on a sparc5-110 running 1.3.3, with lots of memory (top showed
> no use of swap space while this was going on)
> 
> Any ideas, or things I could check?

Try running this program. If it makes your machine very slow, you are
suffering from a bug that we've been hunting recently -- please let me 
know.

#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <err.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>


void
exitera(int i)
{
        exit(1);
}

int
main(int argc, char **argv)
{
        struct  itimerval timer;
        pid_t   pid;
        int             status;
        int             i;


        for (i = 0;;i++) {
                printf("forking... %d\n", i);
                if ((pid = fork()) < 0)
                        errx(1, "parent: couldn't fork");
                else if (pid == 0) {
                        /* child */
                        signal(SIGALRM, exitera);
                        timer.it_interval.tv_sec = 0;
                        timer.it_interval.tv_usec = 0;
                        timer.it_value.tv_sec = 0;
                        timer.it_value.tv_usec = 250000;
                        if (setitimer(ITIMER_REAL, &timer, NULL) < 0)
                                errx(1, "child, invalid time");
                        for(;;);
                }
                if (wait(&status) != pid)
                        errx(1, "parent: child error");
        }

}