Subject: SERIOUS memory bug in 1.0, 386 port
To: None <netbsd-help@NetBSD.ORG, port-i386@NetBSD.ORG>
From: Joao Carlos Mendes Luis <jonny@gaia.coppe.ufrj.br>
List: netbsd-help
Date: 10/02/1995 19:13:33
Hi all,

  I have found a SERIOUS bug in the memory/swap manager in the netbsd
1.0, 386 port.  Describing it fastly: When there's no more memory
available in SWAP, the system freezes !

  Try running the following program, with "datasize unlimited".

------------------------  Cut Here  ----------------------------
main()
{
  int Size = 0;
  int Got = 1024;

  while ( Got != 0 ) {
    if ( calloc( Got*1024, 1 ) ) {
      Size += Got;
      printf( "Alocated: %d Kb...\n", Size );
    }
    else {
      Got /= 2;
    }
  }
  printf( "No more memory, pausing...\n" );
  pause();
}
----------------------------------------------------------------

  No need to run in supervisor mode.  A mortal can crash the system
this way, and there's NO WAY (at least, one that I know off) to
detect what happened.

  Has anybody noted this ?  Has this been fixed in -current ?

					Jonny

--
Joao Carlos Mendes Luis			jonny@coe.ufrj.br
+55 21 290-4698 ( Job )			jonny@adc.coppe.ufrj.br
Network Manager				UFRJ/COPPE/CISI
Universidade Federal do Rio de Janeiro