Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Sep 1997 09:12:27 +1000 (EST)
From:      Douglas Thomas Crosher  <dtc@scrooge.ee.swin.oz.au>
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   kern/4513: System lockup which appears to be VM related.
Message-ID:  <199709112312.JAA27052@scrooge.ee.swin.oz.au>
Resent-Message-ID: <199709112310.QAA02405@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         4513
>Category:       kern
>Synopsis:       System lockup appears to be VM related.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 11 16:10:01 PDT 1997
>Last-Modified:
>Originator:     Douglas
>Organization:
Swinburne University of Technology
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

Pentium 133, 128M Ram, 512M swap. Freebsd 3.0-current Sep 11, 1997.

>Description:

I've noticed the machine locking up for roughly 2 minutes.

The keyboard will still accept interrupts and the VT switching still
works, but only the VT at the point of lockup will accept
anything. All processes appear to have halted but the VT reported load
average climbs to about 5. There is some very light disk activity,
very roughly a blink every 10 seconds. After about 2 minutes the
system resumes and starts paging heavily. This behaviour was not seen
in a current system from July.

>How-To-Repeat:

The code below reproduces the problem. The number of pages allocated
needed to be adjusted to the machines memory size which was 128M. The
lockup occurs after 4-6 iterations.

-=-=-

#include <stdio.h>
#include <sys/types.h>
#include <sys/mman.h>

#define NUM_PAGES 2*16384 /* Adjust to the machines memory size. */

main()
{
  int n,i;
  int max=10;
  int x;

  if (mmap(0x9000000,NUM_PAGES*4096,
	   PROT_READ|PROT_WRITE|PROT_EXEC,MAP_PRIVATE|MAP_ANON,-1,0)
      == -1)
    printf("mmap erorr\n");

  for (n=0;n<max;n++) {
    int page;
    
    printf("Itteration %d\n",n);
    
    /* Write to pages randomly */
    for (page=0;page<NUM_PAGES;page++) {
      int  *addr = (int *)((void *)0x9000000 + 4096*page);
      int  j;
      if (random()%4 == 0)
	for (j=0; j<1024; j++)
	  addr[j] = (int)addr;
    }
      
    /* Zero pages using unmap */
    for (page=0;page<NUM_PAGES;page++) {
      int  *addr = (int *)((void *)0x9000000 + 4096*page);
      if (random()%16 == 0) {
	int rem=NUM_PAGES-page;
	int num=random()%8;
	int j;
	
	if (num>rem)
	  num=rem;
	if (munmap((void *)addr,4096*num)==-1)
	  printf("munmap erorr\n");
	if (mmap((void *)addr,4096*num,
		 PROT_READ|PROT_WRITE|PROT_EXEC,
		 MAP_PRIVATE|MAP_ANON,-1,0) ==-1)
	  printf("mmap erorr\n");
      }
    }
    
    /* Read from pages at random. */
    for (page=0;page<NUM_PAGES;page++) {
      int  *addr = (int *)((void *)0x9000000 + 4096*page);
      if (random()%4 == 0)
	x += addr[0];
    }
  }
}

-=-=-

>Fix:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709112312.JAA27052>