From owner-freebsd-bugs Sat Dec 11 11:50: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 7140414E30 for ; Sat, 11 Dec 1999 11:50:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id LAA81355; Sat, 11 Dec 1999 11:50:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 1614414D16; Sat, 11 Dec 1999 11:42:45 -0800 (PST) Message-Id: <19991211194245.1614414D16@hub.freebsd.org> Date: Sat, 11 Dec 1999 11:42:45 -0800 (PST) From: mitja@ksop-cscp.si To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: kern/15420: 3.3-RELEASE Kernel freeze Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 15420 >Category: kern >Synopsis: 3.3-RELEASE Kernel freeze >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 11 11:50:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Mitja Horvat >Release: 3.3-RELEASE >Organization: >Environment: FreeBSD weha.nonet.si 3.3-RELEASE FreeBSD 3.3-RELEASE #7: Thu Dec 9 00:21:47 CET 1999 root@weha.nonet.si:/usr/src/sys/compile/WOW i386 >Description: Kernel freezes under heavy VM load. >How-To-Repeat: Spawn few programs that chew up all memory. The bug may not show up immediately, so run the programs few times. This script triggers the problem on two PCs I tested on: --------------------------------->8-------------------------------- #!/bin/sh cat << EOF > qq.c void main(void) { for(;;) memset(malloc(1000000), 0, 1000000); } EOF cc qq.c -o qq ./qq & ./qq & ./qq & ./qq & wait rm -f qq qq.c --------------------------------->8-------------------------------- >Fix: The following kernel patch fixes the problem for me, but since this is my first FreeBSD hacking attempt, I'm not sure if it's OK. --------------------------------->8-------------------------------- --- vm_pageout.c.orig Fri Dec 10 01:49:54 1999 +++ vm_pageout.c Fri Dec 10 01:54:22 1999 @@ -1136,8 +1136,8 @@ * make sure that we have swap space -- if we are low on memory and * swap -- then kill the biggest process. */ - if ((vm_swap_size == 0 || swap_pager_full) && - ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min)) { + if (vm_swap_size == 0 || swap_pager_full || + (cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) { bigproc = NULL; bigsize = 0; for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { --------------------------------->8-------------------------------- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message