Subject: port-vax/7859: VAX port doesn't handle "out of memory" state correctly.
To: None <>
From: None <>
List: netbsd-bugs
Date: 06/26/1999 14:23:54
>Number:         7859
>Category:       port-vax
>Synopsis:       VAX port doesn't handle "out of memory" state correctly.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-vax-maintainer (NetBSD/vax Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 26 14:20:01 1999
>Originator:     Brian Chase
>Release:        NetBSD-1.4
	VAXstation 3100/M76 w/16MB RAM, NetBSD/vax 1.4
System: NetBSD vaxzilla 1.4 NetBSD 1.4 (BVAX) #0: Sun Jun 13 16:11:43 PDT 1999 root@futplex:/usr/src/sys/arch/vax/compile/BVAX vax

	The above system was setup with no swap space in order to help
	isolate some suspected swapping problems which result in machine
	hangs.  I discovered that although UVM catches and kills memory
	hungry processes when the system runs out of memory, it doesn't
	handle this condition gracefully.  As soon as UVM reports killing
	the process, the system hangs.
Example code to generate the problem follows:
#include <stdio.h>
#include <stdlib.h>

int main()
    int count = 1;
    int delta = 1024*1024;
    void *fooptr;
    unsigned char *ptr;
    int i;

    while (1) {
        printf("allocating: %dMB\n", count);
        fooptr = malloc((size_t)delta*count);
        printf("writing to: %dMB\n", count);
        ptr = (unsigned char *)fooptr;
        for (i = 0 ; i < delta*count ; i++ ) {
           *ptr++ = (unsigned char)0xff;
        printf("deallocate: %dMB\n", count);