I'm trying to crash an instance on AWS so that I can simulate what happens when it gets 'stuck'.

I tried the top suggestions here How to cause kernel panic with a single command? but unfortunately they were not successful.

  • From the referenced page, did you try this: dd if=/dev/urandom of=/dev/mem ? And what happened after the sysrq trigger? – Liczyrzepa Jul 15 '15 at 13:48

This wasn't one of the official answers to How to cause kernel panic with a single command?, but it was referenced in a comment, and it should cause the system to crash.

Run the following forkbomb command at your bash shell:

:(){ :|:& };:

The system will continue to create new processes until the system hangs.

Or you can try the following python script:

import os
while True: os.fork()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.