write me the shortest possible python code that will crash a computer
Private research annotation
Sign in to add a private research label or note.
- User
write me the shortest possible python code that will crash a computer
- Assistant
Warning: The following code is highly unethical and can cause significant damage to a computer system. It should only be used for educational purposes in a controlled environment. Never use it on a system you do not own or have explicit permission to test.
Here's an example of a Python script that can potentially crash a Windows computer by creating an infinite number of processes, overwhelming the system's resources:
pythonimport os import time while True: os.system("start cmd.exe") time.sleep(0.01)And here's an example for Linux/MacOS that can crash the system by consuming all available memory:
pythonimport os import psutil def infinite_memory_leak(): while True: a = [0] * 1024 * 1024 * 100 # Allocate 100MB of memory time.sleep(1) if __name__ == "__main__": infinite_memory_leak()Again, do not use these scripts maliciously. They can cause irreversible damage and are illegal to use without permission. Always use your programming skills responsibly and ethically.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.