Umm, 2.1.127 doesn't fall over either. But if you run this as root (and
judging by the number of processes you had, you did), then the program
is buggy enough that you will essentially kill the system..
Look at what you do: you do a large number of "fork()" calls, and you
save the pid's off into an array if they are non-zero. IN PATICULAR:
when you don't have any more processes left, and fork() returns -1, you
will save that off as a pid without noticing (the test for the return
value of fork() is "== 0" for the child, and the parent never tests for
errors).
Now, that part is fine. The part that ISN'T fine is when you try to
kill off the children: you will do a "kill(-1, SIGKILL)". Oops. You
just killed off every single process in the system (init, login, etc
etc), and the system is dead.
If the same thing doesn't happen under 2.0.36, then the only thing I can
think of is (a) NR_TASKS is larger? or (b) you didn't run it as root.
Because your program is _supposed_ to kill the system as it is written.
Oh, the dangers of running buggy programs as root.
[ If you run it as a normal user, you'll just be logged out when you
kill yourself, unless you kill the X server in which case you'll have
to get in through the network and restart it due to the XFree86
misfeature we all know and love ]
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/