Skip to contentSkip to conversation

non-root pthread code (attached) "crashes" 2.4.20-8 on Intel...how about 2.4.22

DISCUSSION C. David Shaffer 2 participants 2 messages Oct 24, 2003

lore
Share & tools
lore
#0 lore raw

Attached is an incorrect solution to a classroom problem which reliably crashes (more later) every linux machine that I've tried it on. crash = machine becomes unresponsive to user input, no external network connections are successful (can't connect to ssh, apache etc) but no information is placed in the log. The program is otherwise harmless so I encourage you to try it yourself :-) Compile with:

gcc -o fibFork fibFork.c -lpthread

Run it with:

./fibFork t 30

Here is as much info as I could think to provide (as I said, I've "crashed" several machines with this but here is one config):

RedHat 9 "server" install
Intel P3 800MHz
uname -a: Linux shaffer2.cs.westminster.edu 2.4.20-20.9 #1 Mon Aug 18 11:45:58 EDT 2003 i686 i686 i386 GNU/Linux glibc-2.3.2-27.9
gcc-3.2.2-5

I would be happy to provide more information but I'm hoping that you'll be able to reproduce the problem.

David Shaffer
[email protected]

#1 lore raw
Quoted 3 lines · C. David Shaffer

Attached is an incorrect solution to a classroom problem which reliably crashes (more later) every linux machine that I've tried it on. crash = machine becomes unresponsive to user input, no external

Two words: "fork bomb". Known problem since Ritchie, Kernighan, and Thompson were coding the fork() syscall 30 years ago.

'man ulimit' and look at 'max user processes' (-u).

And before anybody flames about why this is the default value for that ulimit, ask yourself "what value should be used by default instead?" and be prepared to justify your answer.