Bad idea to break out of an infinite loop?

Posted by Zeno on Mon 12 Dec 2005 07:50 PM — 3 posts, 14,131 views.

USA #0
Is it a bad idea to break out of an infinite loop by attaching gdb to the process, and doing a return out of the function?
Australia Forum Administrator #1
I assume you mean as an emergency measure? ;)

I can't see a big problem with that, I presume you want to get control of your server back long enough to save things and so on.

USA #2
Sort of a harsh way to do it, but I suppose that works. Personally I prefer using the alarm handlers in Smaug for this and setting game_loop up on a 30 second timer. I haven't run into much that requires game_loop to lock for that long so it's usually reasonable to assume it's stuck after that long.