ghettofinger has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Methods to debug CGI issues
by chb (Deacon) on Apr 20, 2005 at 06:35 UTC | |
by mvandenb (Beadle) on Apr 20, 2005 at 15:02 UTC | |
by ghettofinger (Monk) on Apr 20, 2005 at 16:12 UTC | |
|
Re: Methods to debug CGI issues
by polettix (Vicar) on Apr 20, 2005 at 08:31 UTC | |
|
Re: Methods to debug CGI issues
by eXile (Priest) on Apr 20, 2005 at 06:51 UTC | |
|
Re: Methods to debug CGI issues
by kprasanna_79 (Hermit) on Apr 20, 2005 at 07:04 UTC | |
by chb (Deacon) on Apr 20, 2005 at 07:16 UTC | |
|
Re: Methods to debug CGI issues
by ropey (Hermit) on Apr 20, 2005 at 13:00 UTC | |
|
Re: Methods to debug CGI issues
by sfink (Deacon) on Apr 20, 2005 at 16:30 UTC | |
by ghettofinger (Monk) on Apr 20, 2005 at 17:59 UTC | |
|
Re: Methods to debug CGI issues
by arc_of_descent (Hermit) on Apr 20, 2005 at 14:46 UTC |