Messages in this thread |  | | From | <> | Subject | stress test; kill(-1,...) | Date | Tue, 16 Apr 1996 01:13:08 -0500 (CDT) |
| |
Should'nt this program terminate safely ? While its running the machine is unusable but after the kill -1, I'm expecting all children to die and everything to return to normal. It works as expected if the "malloc(1000000)" isn't there.
This always renders the machine unusable, have to hit reset.
#include <stdio.h> #include <stdlib.h> #include <linux/kernel.h> #include <linux/sys.h> #include <signal.h> #include <unistd.h>
main() { int i;
if (fork()) { sleep(10); fprintf(stderr, "%d\n", kill(-1, SIGTERM)); } else { for (i = 0; i < 100; i++) { malloc(1000000); fork(); } } }
With just the for loop (no kill) for (i = 0; i < 100; i++) { malloc(1000000); fork(); }
If I try a shutdown or a killall from some other terminal the log/console fills up with:
socrates kernel: swap_free: swap-space map bad (entry 00038700) socrates kernel: swap_duplicate: trying to duplicate unused page socrates last message repeated 2 times socrates kernel: swap_free: swap-space map bad (entry 00038700) socrates kernel: swap_duplicate: trying to duplicate unused page socrates last message repeated 3 times socrates kernel: Hmm.. Trying to use unallocated swap (00038700) socrates last message repeated 8 times socrates kernel: swap_free: swap-space map bad (entry 00038700) socrates last message repeated 4 times socrates kernel: swap_duplicate: trying to duplicate unused page socrates last message repeated 3 times socrates kernel: Hmm.. Trying to use unallocated swap (00038700) socrates kernel: swap_free: swap-space map bad (entry 00038700) socrates kernel: Hmm.. Trying to use unallocated swap (00038700) socrates kernel: swap_free: swap-space map bad (entry 00038700) socrates kernel: Hmm.. Trying to use unallocated swap (00038700)
This is not always reproducible, you have to play with it for a while.
Machine: linux 1.3.89, P90 PCI, 24M RAM + 50M Swap. The kernel has essential stuff + profiling turned on and everything else is a module:
# lsmod Module: #pages: Used by: nfs 13 7 (autoclean) smc-ultra 1 1 (autoclean) 8390 2 [smc-ultra] 0 (autoclean) msdos 2 1 (autoclean) fat 6 [msdos] 1 (autoclean)
No X. -- Raghavan Menon <rmenon@tisl.ukans.edu> Electrical Engineering, University of Kansas
|  |