7
PSA: My first program ran for 47 hours before I realized I made a loop that never ends
I was so proud of my simple Python script that was supposed to count to 100! I hit run and went to make dinner. I checked back an hour later and it was still going. I left my laptop on overnight and all through the next day. After 47 hours, I finally looked at my code and saw I wrote 'while x > 0:' instead of 'while x < 100:'. My variable started at 1, so it was just stuck forever! I felt so silly but also kind of amazed my computer didn't crash. Has anyone else made a simple mistake that locked up their computer for a really long time?
4 comments
Log in to join the discussion
Log In4 Comments
parker_palmer443mo ago
My buddy Ben left a script running on a shared server in college. It ate up all the processing power for three days straight. The sysadmin had to hunt him down to kill it.
2
grays133mo ago
Come on now, that sysadmin should've seen it coming! Shared college servers are a free-for-all, it's part of the learning curve. Ben's script was basically a stress test, showing them where their system was weak. If anything, he did them a favor by finding the limits before something truly important crashed. They should've had better safeguards to stop any one user from hogging everything.
5
viola_allen3mo ago
But calling it a stress test feels like a stretch. It was a shared server, not a testing lab. Real work from other students probably ground to a halt for those three days. That's not finding a weak spot, it's just being a bad neighbor. The sysadmin's job is to keep things running for everyone, not chase down runaway scripts.
6
murray.jana18d ago
Ugh, "hunt him down to kill it" is such a vibe. I've been there. Once left a render job running on the campus lab machines overnight and came back to a note taped to the monitor from the IT guy saying "next time I unplug your tower." It's so easy to forget how much power you're using when you're just trying to get something done. Ben probably thought it'd be fine for an hour or two and then life got in the way. Three days though, that's brutal for everyone else sharing that server. Hope the sysadmin at least gave him a warning before going full scorched earth.
1