in reply to Re^3: Segmentation fault with HTML::TagParser module
in thread Segmentation fault with HTML::TagParser module

Thank you shmem, for your valuable suggestion.
1) When I tried debugging(used print statements) in my script it got terminated with Segmentaion Fault after the HTML::TagParser instance is called . So, in HTML::TagParser module, I got the segmentaion fault in its parse sub routine.
2) The output of using gdb debug is given below.
(gdb) run burst_spider.pl -s "http://technologyreview.com/aggregates.a +spx?p=1" -toolbar Starting program: /usr/bin/perl burst_spider.pl -s "http://technologyr +eview.com/aggregates.aspx?p=1" -toolbar (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1212090688 (LWP 12793)] (no debugging symbols found)
Program received signal SIGSEGV, Segmentation fault. Switching to Thread -1212090688 (LWP 12793) 0xb7ecf9de in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so

Replies are listed 'Best First'.
Re^5: Segmentation fault with HTML::TagParser module
by shmem (Chancellor) on Mar 04, 2009 at 09:41 UTC

    Produce a backtrace with the gdb 'bt' command. At this point, seeing some code of yours would be helpful to help, too. But not the whole bunch - a minimal version which exhibits the same problem.

      Shmem
      This error seems to be occuring when we Parse the web page. The code from where we are getting the error is mentioned below :
      my $html_local = HTML::TagParser->new($local_content); my $ele = $html_local->getElementsByTagName("title"); # get element + by title tag

      The $local_content is the entire content of the web page which we are crawling.

      The back trace result is provided for your reference
      (gdb) run burst_spider.pl -s "http://technologyreview.com/aggregates.a +spx?p=5" -toolbar Starting program: /usr/bin/perl burst_spider.pl -s "http://technologyr +eview.com/aggregates.aspx?p=5" -toolbar (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1211443520 (LWP 14136)] (no debugging symbols found) bt Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1211443520 (LWP 14136)] 0xb7f6d9de in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so (gdb) bt #0 0xb7f6d9de in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so #1 0xb7f7120b in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so #2 0xb7f7120b in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so #3 0xb7f7120b in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so #4 0xb7f7120b in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so #5 0xb7f7120b in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so #6 0xb7f7120b in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so #7 0xb7f7120b in Perl_regclass_swash () from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so

      It seems to be never ending.