killing a process gone bad.

Paul John Falstad pfalstad at rise.Princeton.EDU
Sat Oct 27 03:27:24 AEST 1990


In article <1990Oct25.185822.11838 at nntp-server.caltech.edu> gwoho at nntp-server.caltech.edu (g liu) writes:
>supose someone ran the following program:
>main()
>{
>int i;
>for (i=0; i<32; i++)
>signal(i,(char *)1);
>while (fork()!=-1)
>;
>}
>then ran it. how would i kill it? i could kill one of them, but
>then the others multiply until the limit is reached. then one fails,
>terminates, and a new one appears, etc. so i have 1000 processes
>with constantly changing pids that have too be stopped simultaneously.
>any ideas for stopping it?

Yes.  If YOU ran this, you could kill it with 'kill -9 %%', which would
killpg() the whole process group.  If someone else ran it, you could
use a short C program that would just killpg() the process group of all
1000 processes.  A smart troublemaker would setpgrp(0,getpid()) after
each fork().










Line fodder.
--
Paul Falstad, pfalstad at phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD
"Your attention please.  Would the owner of the Baader-Meinhof shoulder-bag
which has just exploded outside the terminal please pick up the white
courtesy phone."



More information about the Comp.unix.misc mailing list