* Create your FREE website now *

fork bomb

Tags:  

Someone wanted to use the old %0|%0 forkbomb a little more ... conservatively. I whipped this up:

  1. @echo off
  2. setlocal
  3. set counter = 0
  4. call :DOIT %0
  5. goto :eof
  6.  
  7. :DOIT
  8. set /a counter=%counter% + 1
  9. if %counter% gtr 10 goto :EXIT
  10. %1|%1
  11. REM 1 ping = 1 second
  12. ping -n 1 -w 1000 127.0.0.1 > nul
  13. goto :eof
  14.  
  15. :EXIT
  16. echo ran %counter% times. Exiting now.
  17. endlocal

... I didn't actually run it myself, you understand. No guts, no glory system crash. But he says it 'spawned a whole lot of copies, which all self destructed'. It seems to me that since each new iteration spawns ten forks, each of which spawn 10 forks, each of which pawn ten forks ... that it would go on infinitely. But maybe, just maybe, they all share the same environment, and so ran into the same %counter% limit. I just ain't sure!


0 Comments
Post a comment



 RSS of this page

Written by:   Written by:   Version:   Last Edited By:   Modified