I am having some issues with a cgi script that I have written that uses LWP::UserAgent to scrape webpages and the runs through each page using a regex to match content and puts said content into a hash. It also extracts links using HTML::SimpleLinkExtor and follows specified links to run the whole process over again. At the end it puts the information into a database.
This script works like a champ on a page with a small amount of content, but when it is presented with a large amount of content it chokes. This script is run on a web server using CGI. There are no errors in the apache logs, nor is any error presented to the screen.
I will spare everyone here from burning their eyes on my hobbled code, but I have a couple of questions about debugging in this kind of scenario. Does anyone use the strace command on the process id? I tried that. This is what I get:
fcntl64(9, F_GETFL) = 0x2 (flags O_RDWR) fcntl64(9, F_SETFL, O_RDWR|O_NONBLOCK) = 0 write(9, "GET /ublank/0___files/4155."..., 416) = 416 select(16, [9], NULL, NULL, {180, 0}) = ? ERESTARTNOHAND (To be rest +arted) --- SIGTERM (Terminated) ---
This is really cryptic and starts to scare me after a while. Can anyone recommend maybe other ways of getting low level debugging output from a script? Does this sound like a memory issue? If so, could it be due to poorly written code, or maybe even buggy perl (5.6.1 on Debian)?
I appreciate everyone's help.
Take care,
ghettofinger
In reply to Methods to debug CGI issues by ghettofinger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |