How can I find/detect an infinite loop? Is there a script?
4 replies, posted
Hey, I'm just wondering, how may I detect an infinite loop? I've looked on the wiki, aka [URL="http://wiki.garrysmod.com/page/debug/sethook"]http://wiki.garrysmod.com/page/debug/sethook[/URL]
but I have no idea how to use that. Is there a script that can detect any infinite loops throughout the gamemode, because I know there are some in there, but I can't seem to find them and it's really frustrating.
May someone provide me with a script or with how to use [url]http://wiki.garrysmod.com/page/debug/sethook[/url]
Thanks! :smile:
[QUOTE=UniqueGuy;46119086]Is there a script that can detect any infinite loops throughout the gamemode, because I know there are some in there, but I can't seem to find them and it's really frustrating.[/QUOTE]
Using debug.sethook lets you disable the infinite loop detection (or set up your own style of detection), by default it should already be detecting any infinite loops.
Just run your gamemode and when one is encountered it should print an error to the console (after running long enough to set off the detector). I don't understand how you can know that there are infinite loops but not be able to find them.
Thanks for replying mate, I was told by a scripter that the problem I was having was caused by an infinite loop (the problem was all the players' GMod was crashing and it was saying they timed out.) The servers been left on all night, I just checked the console from last night and there's no print of an error of an infinite loop. I have no idea what the problem is.
*BUMP*
Need to get this sorted, if anyone could help, or point me in the right direction, that'd be great.
P.S:
I've also looked at the THINK Hooks.
Add me on steam and I can take a swing at helping you out. In a little rush so you may be able to catch me.
Steam: [url]http://steamcommunity.com/profiles/76561198009157874[/url]
Sorry, you need to Log In to post a reply to this thread.