Hello!

I think, mentioned below program probably show the bug in virtual memory
subsystem in FreeBSD-3.2-RELEASE. After running this program, FreeBSD comes
into "out of swap" state, then hungs.

Why i think this is bug? Because any user can hung FreeBSD, settings in
/etc/login.conf can't help.
Note: in FreeBSD-2.2.8 there is no this problem. The 2.2.8-system
successfully kill this program.

--------------------------------------------------------------------
#include <unistd.h>
#include <stdlib.h>

#define NALLOC          1000
#define SIZEALLOC       1024*1024

void main()
{
 char *p_mem;
 int i, j;

 if (fork() != 0) return;

 for (i=0; i<NALLOC; i++) {
     p_mem = (char *)malloc(SIZEALLOC);
     for (j=0; j<SIZEALLOC; j++) {
         p_mem[j] = 0;
     }
 }

 while (1);
}
--------------------------------------------------------------------

P.S. Sorry for my English...

Good luck,
            Alec



To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to