From nobody@FreeBSD.org  Tue Aug 28 08:47:56 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 2A1FC37B403
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Aug 2001 08:47:56 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f7SFlu980281;
	Tue, 28 Aug 2001 08:47:56 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200108281547.f7SFlu980281@freefall.freebsd.org>
Date: Tue, 28 Aug 2001 08:47:56 -0700 (PDT)
From: Peter <pb.ludd.luth.se@FreeBSD.org (a)>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Machine hangs on swap problems.
X-Send-Pr-Version: www-1.0

>Number:         30164
>Category:       kern
>Synopsis:       Machine hangs on swap problems.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 28 08:50:00 PDT 2001
>Closed-Date:    Fri Dec 28 15:45:47 PST 2001
>Last-Modified:  Fri Dec 28 15:50:03 PST 2001
>Originator:     Peter
>Release:        4.3-RELEASE
>Organization:
>Environment:
FreeBSD host.domain 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Mon Jul  9 05:01:32 CEST 2001     toor@host.domain:/usr/src/sys/compile/WAVEKERNEL  i386

>Description:
I was running netscape v4.76 and after browseing a while the machine
starts to be real slow due swapping. After getting tired of waiting I
tried to switch to text console with Ctrl+Alt+F1. But then XFree freeze.

Tried to connect to the problem machine from a laptop the ssh deamon
only responds by connecting, no ssh init strings.. nothing. The hardisc
led is flickering so I decide to reset the machine.

After rebooting the syslog shows:
  Aug 28 16:55:24 wave /kernel: swap_pager_getswapspace: failed
  Aug 28 16:55:24 wave last message repeated 14 times
  Aug 28 16:55:54 wave last message repeated 25 times

There is a similar bug report for v4.0
o [2000/07/05] kern/19714   dillon   swap_pager_getswapspace: failed

>How-To-Repeat:
My Guess (no tested):
  Let a program allocate all memory available when running xfree86. 
  Then try to switch into textconsole.

>Fix:
debug swap_pager_getswapspace?
The former version I used killed processes when it got out of swap 
rather than letting the system down. An approach might be to let the pid
that cause out of swap (if that's the case?) to be killed.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dillon 
State-Changed-When: Fri Dec 28 15:43:24 PST 2001 
State-Changed-Why:  


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30164 
State-Changed-From-To: closed->open 
State-Changed-By: dillon 
State-Changed-When: Fri Dec 28 15:45:31 PST 2001 
State-Changed-Why:  
Bleh.  hold on.  I'll close it right in a moment. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30164 
State-Changed-From-To: open->closed 
State-Changed-By: dillon 
State-Changed-When: Fri Dec 28 15:45:47 PST 2001 
State-Changed-Why:  
Yes, you don't have enough swap to handle the programs you are running. 
4.3 had a bug in the process killing code and probably was not killing 
the largest process.  We fixed that in later releases but even so it is 
possible that FreeBSD may kill the X server itself rather then the runaway 
process if you don't have enough memory+swap. 

My recommendation is to give yourself much more swap... like 256MB or more, 
and upgrade to 4.5-RELEASE when it comes out (or upgrade to the latest -stable 
if you feel adventurous).  It may also be beneficial to set a datasize 
resource limit in your .xinitrc or .xsession (depending on how you run X), 
just before you start up your window manager, so runaway programs get killed 
before the system runs out of swap.  A 128m datasize limit would be  
reasonable.  The basic problem is that you need enough swap in the first 
place before you can set 'reasonable' resource limits for programs like 
netscape. 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30164 
>Unformatted:
 >swapinfo     (after reboot!)
 Device          1K-blocks     Used    Avail Capacity  Type
 /dev/da0s2b         67456    18112    49344    27%    Interleaved
 
 I suspect netscape used up all memory and freebsd was not handling
 that properly.
