AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Deadlock? (https://forums.alliedmods.net/showthread.php?t=128661)

bucky0 06-03-2010 16:51

Deadlock?
 
Hey all,

I've managed to get a bug in a plugin I'm writing that I can't really find. Basically, at some point, the server will lock and become unresponsive to the console. Is there a signal or something I can send HLDS to cause it to dump a backtrace? I can't really think of any other way to figure out where my error is.

best,
Buck

Sylwester 06-04-2010 13:49

Re: Deadlock?
 
Comment parts of code that may be related to that "some point" until you find it.

bucky0 06-04-2010 15:18

Re: Deadlock?
 
I'm making changes to a giant bit of code (War3FT), so even thinking of where it's happening is difficult. I can code c++, I'm not opposed to putting in a watchdog to see if pawn doesn't return control to AMXX in n seconds and bombing out from there.

Drak 06-04-2010 16:01

Re: Deadlock?
 
Usually when it locks, it's because of an infinite loop, could be caused by a query or a socket problem too But most likley infinite loop.

bucky0 06-04-2010 17:40

Re: Deadlock?
 
Quote:

Originally Posted by Drak (Post 1199783)
Usually when it locks, it's because of an infinite loop, could be caused by a query or a socket problem too But most likley infinite loop.

right, so it'd be nice to be able hit something and see where that loop is

bucky0 06-25-2010 15:11

Re: Deadlock?
 
Any suggestions?

grimvh2 06-25-2010 19:36

Re: Deadlock?
 
Quote:

Originally Posted by Drak (Post 1199783)
Usually when it locks, it's because of an infinite loop, could be caused by a query or a socket problem too But most likley infinite loop.

Same opinion.

Try to debug the plugin, get the error logs ( and if ur not able to fix it, post the error log and maybe also the code )

bucky0 06-29-2010 10:59

Re: Deadlock?
 
Quote:

Originally Posted by grimvh2 (Post 1219937)
Same opinion.

Try to debug the plugin, get the error logs ( and if ur not able to fix it, post the error log and maybe also the code )

If it infinite loops somewhere, and no error gets printed out, how do I know where to look?

In c, you can just run it in GDB and send a signal that will raise an exception. Then, you catch the exception, and the traceback will show you where it's stuck. Is there no similar thing in AMXX?

Drak 06-29-2010 20:09

Re: Deadlock?
 
No, there's not. The easiest way, is check all the files you edited with "while(" and make sure it looks right. Since it's not an internal error, and if you know what you edited. I'm guessing it's a while() loop, since sockets would eventually free the server. And not to many people use do() loops, so i can cancel that out.


All times are GMT -4. The time now is 05:27.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.