Running destructive commands just to see what happens
Running destructive commands just to see what happens
Posted Feb 13, 2016 5:58 UTC (Sat) by pr1268 (guest, #24648)In reply to: Bricking systems using rm by pbonzini
Parent article: Bricking systems using rm
You've never run destructive commands just to see what happens?
Well, yes I have. But rm -rf --no-preserve-root / seems so boring. And, I already know what happens there.
Some fun examples I've done (Kids, do not try this at home!):
- In 2003-era Red Hat 9.0, open a shell terminal, change the preferences to black background and green text (to look like an old green monochrome display), then run % man $0. It's the Matrix!
- When first learning Java (on a Windows NT 4.0 workstation with JDK version 1.2.2 or so, vintage 2000), while running a simple console program that printed a bunch of numbers in a loop, I tried closing the command-line window. Rather than closing, the JRE barfed out a whole lot of scary-looking verbiage about an "ApplicationUnownedException" or similar. But the program kept running! Clicking the close button repeatedly really made the JRE scream volumes of exception text. (Later version of Windows and/or Java didn't do this; either the JRE simply gave up, or the OS pulled the plug mercilessly.)
- % echo "453827^691643" | bc -l — I don't remember actually waiting for the result, but it did heat up the room nicely.
- main(){for(;;)fork();} (or its shell cousin, % :(){ :|:& };: ) — At least I had a per-user process limit set up (with ulimit -u).
- Deluxe version of above: main(){for(;;)void*p=malloc(1<<24);memset(p,'9',1<<24);fork();} (the memset() ensured that the allocation was not deferred) — ulimit -u couldn't save me here.
Granted, I kinda felt like that mean bully kid who runs sadistic experiments on his toys in Toy Story... ;-)