Sporadic crash during parsing

G

GMCS

Does anyone have any ideas about what might cause perl 5.8.1 to crash
randomly during parsing? It seems to crash maybe 1 out of 10 times on
any one of a number of cgi scripts making for rather unreliable
service. I was able to get a core dump and saw this:

#0 S_new_xpvav (my_perl=0xa) at sv.c:937
#1 0x003b4882 in Perl_newAV (my_perl=0x8d24650) at av.c:354
#2 0x00399cb7 in S_regclass (my_perl=0x8b27098,
pRExC_state=0xbfec16d0)
at regcomp.c:4236
#3 0x003974fa in S_regatom (my_perl=0x8b27098, pRExC_state=0xbfec16d0,
flagp=0xbfec14e8) at regcomp.c:2833
#4 0x00395eba in S_regpiece (my_perl=0x8b27098,
pRExC_state=0xbfec16d0,
flagp=0xbfec1528) at regcomp.c:2622
#5 0x00395d5a in S_regbranch (my_perl=0x8b27098,
pRExC_state=0xbfec16d0,
flagp=0xbfec15c8, first=1) at regcomp.c:2570
#6 0x0039457e in S_reg (my_perl=0x8b27098, pRExC_state=0xbfec16d0,
paren=0,
flagp=0xbfec166c) at regcomp.c:2417
#7 0x003935c2 in Perl_pregcomp (my_perl=0x8b27098, exp=0x0,
xend=0x8d25ee6 "", pm=0x8d277a0) at regcomp.c:1838
#8 0x00382424 in Perl_pmruntime (my_perl=0x8b27098, o=0x8d277a0,
expr=0x8d27878, repl=0x0) at op.c:2691
#9 0x0037bd49 in Perl_yyparse (my_perl=0x8b27098) at perly.y:709
#10 0x003f27c1 in S_doeval (my_perl=0x8b27098, gimme=0, startop=0x0,
outside=0x0, seq=0) at pp_ctl.c:2802
#11 0x003f38ec in Perl_pp_require (my_perl=0x8b27098) at pp_ctl.c:3298
#12 0x003a197d in Perl_runops_debug (my_perl=0x8b27098) at dump.c:1434
#13 0x003516b9 in S_call_body (my_perl=0x8b27098, myop=0xbfec1ad0,
is_eval=0)
at perl.c:2193
#14 0x00351385 in Perl_call_sv (my_perl=0x8b27098, sv=0x0, flags=6)
at perl.c:2111
#15 0x00355dff in S_call_list_body (my_perl=0x8b27098, cv=0x0) at
perl.c:4361
#16 0x00355af5 in Perl_call_list (my_perl=0x8b27098, oldscope=2,
paramList=0x8b3bd08) at perl.c:4290
#17 0x00386977 in Perl_newATTRSUB (my_perl=0x8b27098, floor=103, o=0x2,
proto=0x0, attrs=0x0, block=0x8b41928) at op.c:4365
#18 0x00382d7f in Perl_utilize (my_perl=0x8b27098, aver=1, floor=0,
version=0x0, idop=0x8ccd948, arg=0x0) at op.c:2975
#19 0x0037a390 in Perl_yyparse (my_perl=0x8b27098) at perly.y:414
#20 0x0034f78e in S_parse_body (my_perl=0x8b27098, env=0x0,
xsinit=0x8049490 <main+288>) at perl.c:1673
#21 0x0034f1b6 in perl_parse (my_perl=0x8b27098, xsinit=0x8049490
<main+288>,
argc=3, argv=0xbfec1f64, env=0x0) at perl.c:1183
#22 0x0804942c in main ()

I guess the my_perl=0xa is culprit, but how can I avoid it? I don't
think changing versions of perl is an option.

I could switch to mod_perl, but my guess it that would be even less
reliable.

Thanks,
--Scott Thibault
 
R

robic0

Does anyone have any ideas about what might cause perl 5.8.1 to crash
randomly during parsing? It seems to crash maybe 1 out of 10 times on
any one of a number of cgi scripts making for rather unreliable
service. I was able to get a core dump and saw this:

#0 S_new_xpvav (my_perl=0xa) at sv.c:937
#1 0x003b4882 in Perl_newAV (my_perl=0x8d24650) at av.c:354
#2 0x00399cb7 in S_regclass (my_perl=0x8b27098,
pRExC_state=0xbfec16d0)
at regcomp.c:4236
#3 0x003974fa in S_regatom (my_perl=0x8b27098, pRExC_state=0xbfec16d0,
flagp=0xbfec14e8) at regcomp.c:2833
#4 0x00395eba in S_regpiece (my_perl=0x8b27098,
pRExC_state=0xbfec16d0,
flagp=0xbfec1528) at regcomp.c:2622
#5 0x00395d5a in S_regbranch (my_perl=0x8b27098,
pRExC_state=0xbfec16d0,
flagp=0xbfec15c8, first=1) at regcomp.c:2570
#6 0x0039457e in S_reg (my_perl=0x8b27098, pRExC_state=0xbfec16d0,
paren=0,
flagp=0xbfec166c) at regcomp.c:2417
#7 0x003935c2 in Perl_pregcomp (my_perl=0x8b27098, exp=0x0,
xend=0x8d25ee6 "", pm=0x8d277a0) at regcomp.c:1838
#8 0x00382424 in Perl_pmruntime (my_perl=0x8b27098, o=0x8d277a0,
expr=0x8d27878, repl=0x0) at op.c:2691
#9 0x0037bd49 in Perl_yyparse (my_perl=0x8b27098) at perly.y:709
#10 0x003f27c1 in S_doeval (my_perl=0x8b27098, gimme=0, startop=0x0,
outside=0x0, seq=0) at pp_ctl.c:2802
#11 0x003f38ec in Perl_pp_require (my_perl=0x8b27098) at pp_ctl.c:3298
#12 0x003a197d in Perl_runops_debug (my_perl=0x8b27098) at dump.c:1434
#13 0x003516b9 in S_call_body (my_perl=0x8b27098, myop=0xbfec1ad0,
is_eval=0)
at perl.c:2193
#14 0x00351385 in Perl_call_sv (my_perl=0x8b27098, sv=0x0, flags=6)
at perl.c:2111
#15 0x00355dff in S_call_list_body (my_perl=0x8b27098, cv=0x0) at
perl.c:4361
#16 0x00355af5 in Perl_call_list (my_perl=0x8b27098, oldscope=2,
paramList=0x8b3bd08) at perl.c:4290
#17 0x00386977 in Perl_newATTRSUB (my_perl=0x8b27098, floor=103, o=0x2,
proto=0x0, attrs=0x0, block=0x8b41928) at op.c:4365
#18 0x00382d7f in Perl_utilize (my_perl=0x8b27098, aver=1, floor=0,
version=0x0, idop=0x8ccd948, arg=0x0) at op.c:2975
#19 0x0037a390 in Perl_yyparse (my_perl=0x8b27098) at perly.y:414
#20 0x0034f78e in S_parse_body (my_perl=0x8b27098, env=0x0,
xsinit=0x8049490 <main+288>) at perl.c:1673
#21 0x0034f1b6 in perl_parse (my_perl=0x8b27098, xsinit=0x8049490
<main+288>,
argc=3, argv=0xbfec1f64, env=0x0) at perl.c:1183
#22 0x0804942c in main ()

I guess the my_perl=0xa is culprit, but how can I avoid it? I don't
think changing versions of perl is an option.

I could switch to mod_perl, but my guess it that would be even less
reliable.

Thanks,
--Scott Thibault

What is 'my_perl'? Is it the address of the currently running module or
a stack pointer to a instantiated class data (object)?
'my_perl=0xa' would seem to imply whatever it is that it's not valid.

Also this lookes like a startup sequence where #22 is the place of failure.
If you comiled the source, take a look if that was correctly done.
Recompile it with a newer compiler.
 
A

A. Sinan Unur

Does anyone have any ideas about what might cause perl 5.8.1 to crash
randomly during parsing?

No. I have never encountered this.

Can you post a short but complete script that causes this behavior?

Sinan
 
G

GMCS

Well, I tried to create a small script to demonstrate it, but I can't
duplicate it now, not even with the original scripts. I rebooted the
server this morning, so ...

--Scott
 
A

A. Sinan Unur

flagp=0xbfec166c) at regcomp.c:2417
#7 0x003935c2 in Perl_pregcomp (my_perl=0x8b27098, exp=0x0,
xend=0x8d25ee6 "", pm=0x8d277a0) at regcomp.c:1838
#8 0x00382424 in Perl_pmruntime (my_perl=0x8b27098, o=0x8d277a0,
expr=0x8d27878, repl=0x0) at op.c:2691

Shot in the dark ... You might have an innocent looking monster of a regex
somewhere that only shows up when memory is low (especially since the
problem went away when you rebooted.

As I said, complete shot in the dark.

Sinan
--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
R

robic0

I'm not aware of the regex issue. What would be a "monster of a
regex"?

--Scott
@UC_Nstart = (
"\\x{C0}-\\x{D6}",
"\\x{D8}-\\x{F6}",
"\\x{F8}-\\x{2FF}",
"\\x{370}-\\x{37D}",
"\\x{37F}-\\x{1FFF}",
"\\x{200C}-\\x{200D}",
"\\x{2070}-\\x{218F}",
"\\x{2C00}-\\x{2FEF}",
"\\x{3001}-\\x{D7FF}",
"\\x{F900}-\\x{FDCF}",
"\\x{FDF0}-\\x{FFFD}",
"\\x{10000}-\\x{EFFFF}",
);
@UC_Nchar = (
"\\x{B7}",
"\\x{0300}-\\x{036F}",
"\\x{203F}-\\x{2040}",
);
$Nstrt = "[A-Za-z_:".join ('',@UC_Nstart)."]";
$Nchar = "[-\\w:\\.".join ('',@UC_Nchar).join ('',@UC_Nstart)."]";
$Name = "(?:$Nstrt$Nchar*?)";
#die "$Name\n";

$RxParse =
qr/(?:<(?:(?:(\/*)($Name)\s*(\/*))|(?:META(.*?))|(?:($Name)((?:\s+$Name\s*=\s*["'][^<]*['"])+)\s*(\/*))|(?:\?(.*?)\?)|(?:!(?:(?:DOCTYPE(.*?))|(?:\[CDATA\[(.*?)\]\])|(?:--(.*?[^-])--)|(?:ATTLIST(.*?))|(?:ENTITY(.*?)))))>)|(.+?)/s;
# ( <( ( 1 12 2 3 3)|( 4 4)|( 5 56( ) 6 7 7)|( 8 8 )|( !( ( 9 9)|( 0 0 )|( 1 1 )|(
2 2)|( 3 3))))>)|4 4
 
G

GMCS

No, nothing complex. The only thing I think would be suspect is this:
$filename =~ s/.*[\/\\](.*)/$1/;
which seems to reference itself.

Is there any way to find out how much memory it's using?

--Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top