You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Craig Dunn <li...@codenation.net> on 2006/02/13 13:04:10 UTC

Segfault with embedded URL's.

Hi all,

I'm getting a strange segfault when I try to expand a hash inside an <A>
tag, but only when I do it inside a table.


Here's my excact code;

[-
        $req = shift;
        $tfo = { %fdat };
        $tfo->{'reptype'} = 'GOO';
        @REPORTS = @ { $req->{REPORTS} };
-]
<a href="?[+ $tfo +]">TEST </a>
<table width=100% border=1>
 <tr>
  <td><a href="?[+ $tfo +]">[+ $REPORTS[$col]->{name} +]</a></td>
 </tr>
</table>

This fails promptly with a segmentation fault but no other error.

If however I remove ?[+ $tfo + ] from the second link and replace it
with static text, the page comes up fine and the first link "TEST"
contains the query string that I want to generate and the rest of the
table part is displayed so this error only seems to happen when I use
the same code for the "TEST" link and use it within a table loop.

My versions are; Apache/2.0.55 (Unix) Embperl/2.1.0 mod_perl/2.0.2
Perl/v5.8.6 


Can anyone shed any light on why this might be occuring?

Many Thanks
Craig

------ Further info;

 
log; [notice] child pid 21737 exit signal Segmentation fault (11)

strace;
times({tms_utime=8, tms_stime=1, tms_cutime=0, tms_cstime=0}) =
481961453
times({tms_utime=8, tms_stime=1, tms_cutime=0, tms_cstime=0}) =
481961453
times({tms_utime=8, tms_stime=1, tms_cutime=0, tms_cstime=0}) =
481961453
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
chdir("/export/www")                    = 0
rt_sigaction(SIGSEGV, {SIG_DFL}, {SIG_DFL}, 8) = 0
kill(22177, SIGSEGV)                    = 0
sigreturn()                             = ? (mask now [])
--- SIGSEGV (Segmentation fault) @ 0 (0) ---



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Intermittent Segfaults

Posted by Gerald Richter <ri...@ecos.de>.
>  
> I have continued testing, and I can confidently say that the 
> problem is definitely not an out-of-memory issue. 

ok

> The new dev 
> version you sent is segfaulting about once for every 100 page 
> requests in dev now, with no load except me clicking around, 
> on a machine with 2G total RAM and plenty of free memory. 
>  
> The segfaults have occurred during pretty much every type of 
> page request, and also not occurred on those same requests. 
> Hitting refresh will always result in the page being 
> correctly sent, with not segfault, on at most a couple pushes.
>  
> Did you get the back-traces I sent? 

Yes. These backtraces are with the new version I sent, right? (I need to
make sure the line numbers of the backtrace matches my source)

> I sent them to your 
> personal account, but I realized that you may check the list 
> more. Every back-trace points to "EMBPERL2_Node_appendChild 
> .... at epdom.c:2835" as the point of segfaulting.
>  
> The only Embperl tags I ever use are the PerlBlock '[* *], [+ 
> +], [- -]' tags. Is there someway I can bypass this 'epdom' 
> code all together? (I don't see any reason for dom-parsing)
>  

This code also parses [..] tags, so you will need it. (It never builds a
full dom tree of your source, it only parses out the tags that you tell
Embperl to process)

I have to take a deeper look at the backtraces. I will come back to you as
soon as possible

Gerald




 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Intermittent Segfaults

Posted by BeeThere Admin <ad...@beethere.net>.
Thanks,
 
I have continued testing, and I can confidently say that the problem is definitely not an out-of-memory issue. The new dev version you sent is segfaulting about once for every 100 page requests in dev now, with no load except me clicking around, on a machine with 2G total RAM and plenty of free memory. 
 
The segfaults have occurred during pretty much every type of page request, and also not occurred on those same requests. Hitting refresh will always result in the page being correctly sent, with not segfault, on at most a couple pushes.
 
Did you get the back-traces I sent? I sent them to your personal account, but I realized that you may check the list more. Every back-trace points to "EMBPERL2_Node_appendChild .... at epdom.c:2835" as the point of segfaulting.
 
The only Embperl tags I ever use are the PerlBlock '[* *], [+ +], [- -]' tags. Is there someway I can bypass this 'epdom' code all together? (I don't see any reason for dom-parsing)
 
This is pretty scary. 
 
Thanks,
 
-Carl

----- Original Message ----
From: Gerald Richter <ri...@ecos.de>
To: BeeThere Admin <ca...@beesw.com>; embperl@perl.apache.org
Sent: Wednesday, March 15, 2006 11:28:50 PM
Subject: RE: Intermittent Segfaults


> 
> I noticed segfaults in my error logs a couple days ago. I am 
> getting 1 for about every 1K page views. I am able to 
> reproduce it now, but still can't make any sense of it. I'm 
> sending a backtrace, and my environment.
>  

I will send you my current development version per private mail, because it
contains some more checks for out of memory conditions.

Please install it with

perl Makefile.pl debug
make
make install

This will give additional informations in the backtrace, in case the the
segfault happens again. If you still get the segfault, please send me the
backtrace again

Gerald




** Virus checked by BB-5000 Mailfilter **

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Intermittent Segfaults

Posted by Gerald Richter <ri...@ecos.de>.
> 
> I noticed segfaults in my error logs a couple days ago. I am 
> getting 1 for about every 1K page views. I am able to 
> reproduce it now, but still can't make any sense of it. I'm 
> sending a backtrace, and my environment.
>  

I will send you my current development version per private mail, because it
contains some more checks for out of memory conditions.

Please install it with

 perl Makefile.pl debug
 make
 make install

This will give additional informations in the backtrace, in case the the
segfault happens again. If you still get the segfault, please send me the
backtrace again

Gerald



 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Intermittent Segfaults

Posted by BeeThere Admin <ad...@beethere.net>.
I noticed segfaults in my error logs a couple days ago. I am getting 1 for about every 1K page views. I am able to reproduce it now, but still can't make any sense of it. I'm sending a backtrace, and my environment.
 
It is not based on any particular or even area of my site URL. It definately happens under greater load.
 
Note: Though there are a few lines in the backtrace about caching, I am NOT using any of the caching functionality right now. At least, I do not have any of it enabled.
 
My Env:
Perl: 5.8.7
EmbPerl: 2.0.0 (I did get a patch to get the caching to work via the infinate benevolence of Gerald)
Apache: 2.0.54
 
The relevant (Embperl) parts of my httpd.conf is:
 
LoadModule  embperl_module /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
PerlRequire Embperl.pm
PerlRequire /home/carl/projects/GOB/uis/pre_compile_pages.pl
Embperl_Top_Include "use strict;"
Embperl_Input_Escmode 0
Embperl_Syntax EmbperlBlocks
Embperl_Object_Base base.htt
Embperl_Options 524432
Embperl_UseEnv on
EMBPERL_LOG /home/carl/projects/GOB/third-party/apache/logs/embperl_log
EMBPERL_SESSION_HANDLER_CLASS no
EMBPERL_OPTIONS 524432
EMBPERL_ESCMODE 0
EMBPERL_DEBUG 0

* I have 3 directories that contain EmbPerl apps (3 base.htt files). 
* I'm not using the Object functionality.
 
The backtrace is below.
 
I would really appreciate some input on this. I am just about to have a major release, with a whole lot more data, a major marketing push, and a bunch of relationships that are going to drive traffic. All of that is waiting on resolution of this problem. I will happily do anything I can on my side to help.
 
-Carl
 
#0  0xf7d9c89d in EMBPERL2_Node_appendChild () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
(gdb) bt
#0  0xf7d9c89d in EMBPERL2_Node_appendChild () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#1  0xf7d97a73 in embperl_Parse () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#2  0xf7da55a7 in ProviderEpParse_GetContentIndex () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#3  0xf7da4300 in Cache_GetContentIndex () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#4  0xf7da571a in ProviderEpCompile_GetContentIndex () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#5  0xf7da41c0 in Cache_GetContentSvIndex () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#6  0xf7da5985 in ProviderEpRun_GetContentIndex () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#7  0xf7da4300 in Cache_GetContentIndex () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#8  0xf7d8558b in ProcessFile () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#9  0xf7d859ba in embperl_RunComponent () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#10 0xf7d85c93 in embperl_ExecuteComponent () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#11 0xf7dc26be in XS_Embperl__Req_execute_component () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#12 0xf7eac35e in Perl_pp_entersub () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#13 0xf7eaaead in Perl_runops_standard () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#14 0xf7e5e62b in S_call_body () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#15 0xf7e5f175 in Perl_call_sv () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#16 0xf7d8ac24 in EMBPERL2_CallStoredCV () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#17 0xf7da0000 in embperl_Execute () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#18 0xf7da59b9 in ProviderEpRun_GetContentIndex () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#19 0xf7da4300 in Cache_GetContentIndex () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#20 0xf7d8558b in ProcessFile () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#21 0xf7d860df in embperl_RunRequest () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#22 0xf7dc23f4 in XS_Embperl__Req_run () from /home/carl/projects/GOB/third-party/perl/lib/5.8.7/i686-linux/auto/Embperl/Embperl.so
#23 0xf7eac35e in Perl_pp_entersub () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#24 0xf7eaaead in Perl_runops_standard () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#25 0xf7e5e62b in S_call_body () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#26 0xf7e5f175 in Perl_call_sv () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#27 0xf7e4b984 in modperl_callback () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#28 0xf7e4bd6c in modperl_callback_run_handlers () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#29 0xf7e4c112 in modperl_callback_per_dir () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#30 0xf7e482ad in modperl_response_handler_run () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#31 0xf7e4842a in modperl_response_handler_cgi () from /home/carl/projects/GOB/third-party/apache/modules/mod_perl.so
#32 0x080673db in ap_run_handler (r=0x8571550) at config.c:152
#33 0x08069d85 in ap_invoke_handler (r=0x8571550) at config.c:364
#34 0x080655df in ap_process_request (r=0x8571550) at http_request.c:249
#35 0x08060e6c in ap_process_http_connection (c=0x857b660) at http_core.c:251
#36 0x0807013b in ap_run_process_connection (c=0x857b660) at connection.c:43
#37 0x080664e8 in child_main (child_num_arg=Variable "child_num_arg" is not available.
) at prefork.c:610
#38 0x08066671 in make_child (s=Variable "s" is not available.
) at prefork.c:704
#39 0x08066701 in startup_children (number_to_start=2) at prefork.c:722
#40 0x08066dcd in ap_mpm_run (_pconf=0x809c0a8, plog=0x80c6150, s=0x809de58) at prefork.c:941
#41 0x0806be4a in main (argc=3, argv=0xffffc3a4) at main.c:618
(gdb) 

RE: Segfault with embedded URL's.

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

> 
> I'm getting a strange segfault when I try to expand a hash 
> inside an <A> tag, but only when I do it inside a table.
> 

Does the same problem occur when you run it offline, i.e. via embpexec.pl or
only when you use mod_perl?

Gerald


> 
> Here's my excact code;
> 
> [-
>         $req = shift;
>         $tfo = { %fdat };
>         $tfo->{'reptype'} = 'GOO';
>         @REPORTS = @ { $req->{REPORTS} }; -] <a href="?[+ 
> $tfo +]">TEST </a> <table width=100% border=1>  <tr>
>   <td><a href="?[+ $tfo +]">[+ $REPORTS[$col]->{name} 
> +]</a></td>  </tr> </table>
> 
> This fails promptly with a segmentation fault but no other error.
> 
> If however I remove ?[+ $tfo + ] from the second link and 
> replace it with static text, the page comes up fine and the 
> first link "TEST"
> contains the query string that I want to generate and the 
> rest of the table part is displayed so this error only seems 
> to happen when I use the same code for the "TEST" link and 
> use it within a table loop.
> 
> My versions are; Apache/2.0.55 (Unix) Embperl/2.1.0 mod_perl/2.0.2
> Perl/v5.8.6 
> 
> 
> Can anyone shed any light on why this might be occuring?
> 
> Many Thanks
> Craig
> 
> ------ Further info;
> 
>  
> log; [notice] child pid 21737 exit signal Segmentation fault (11)
> 
> strace;
> times({tms_utime=8, tms_stime=1, tms_cutime=0, tms_cstime=0}) =
> 481961453
> times({tms_utime=8, tms_stime=1, tms_cutime=0, tms_cstime=0}) =
> 481961453
> times({tms_utime=8, tms_stime=1, tms_cutime=0, tms_cstime=0}) =
> 481961453
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> chdir("/export/www")                    = 0
> rt_sigaction(SIGSEGV, {SIG_DFL}, {SIG_DFL}, 8) = 0
> kill(22177, SIGSEGV)                    = 0
> sigreturn()                             = ? (mask now [])
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 
>  
> ** Virus checked by BB-5000 Mailfilter ** 
> !DSPAM:43f0757a277486448910832!
> 


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org