Terry Lambert <[EMAIL PROTECTED]> writes:
> So now the question becomes "what is he testing that is
> resulting in 4.3 locking up?".

Good question.  It does some non-trivial stuff besides allocating:
buffered I/O and fork()/exec()'ing sync(1).

> Your suggested replacement test might be fun to run, but I
> think it wouldn't lock up 4.3...

Nope.  But the attached - much nastier - program did trash my -CURRENT
box when run as root in an xterm.  What happened was that the X server
faulted and died, rendering the console unusable; the serial console
filled up with getswapspace() errors, so the only recourse was a break
to DDB followed by 'call boot', which managed to sync all filesystems
except the root, but failed to actually reboot the machine.

I would *love* to have a DDB equivalent to 'kill -9', so I could drop
to the DDB prompt, check ps, kill a process or two, and drop back out
of DDB.  It would have saved me a reboot and a longish fsck in this
case.

A second try, on the text console and as a regular user, got to 643 MB
before it, top(1) and an xterm were killed.  This is a 5.0-CURRENT
system with 192 MB RAM and 512 MB swap, so 643 MB is pretty close to
max capacity.

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]

#include <sys/types.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <unistd.h>

#define CHUNKSIZE       1048576
#define CHUNKS          4096

int
main(int argc, char *argv[])
{
    int i, j, n, ps;
    char *p;

    n = (argc > 1) ? atoi(argv[1]) : CHUNKS;
    ps = getpagesize();
    for (i = 0; i < n; ++i) {
        if ((p = mmap(NULL, CHUNKSIZE, PROT_WRITE, MAP_ANON, -1, 0)) == NULL) {
            write(1, "\n:(\n", 4);
            exit(1);
        }
        write(1, ".", 1);
        for (j = 0; j < CHUNKSIZE; j += ps)
            p[j] = 1;
    }
    write(1, "\n:)\n", 4);
    read(0, p, 1);
    exit(0);
}

Reply via email to