CGI Hung Process Help!

Bernard Devlin revolution at knowledgeworks.plus.com
Sun May 6 03:18:28 EDT 2007


Hi Sivakatirswami

I think the most important thing is that you introduce some simple  
logging mechanism into your code.  That way you can be you are  
correctly identifying the critical process that is causing your CGI  
to hang.

I can't stress to much the importance of such a logging mechanism.   
In fact, I liberally sprinkle all my code with logging statements.  I  
pass a logging statement and a positive number to my logging  
function.  If the number is lower than the logging threshold, the  
statement gets logged.  That way, I can turn of logging completely  
e.g. by having an environment variable or a global where the logging  
threshold is set to 0.  This kind of debugging aid is absolutely  
essential in server-side development.

At this stage of the game you only need to put a statement before and  
after the section that you and Andre suspect.  Then when your process  
hangs you just need to do:

tail /path/to/my/log

and you will see whether or not your CGI went into that suspect  
section and never came out again.  If so, then I would suggest you  
also log what was entered by the user, to find out what is causing  
the problem.  It could even be some weird combination of characters.

Then again, the problem may lie somewhere else entirely.

Bernard


> Andre and I suspect possibly this email  segment



More information about the use-livecode mailing list