On Wed, Jun 15, 2005 at 11:47:39AM -0700, Justin Erenkrantz wrote:
> As I've mentioned before, we (apache.org) are seeing our qpsmtpd processes 
> stuck in an infinite loop.  We're using qpsmtpd-forkserver.

I've switched to a debug (i.e. -g) build of perl so that we can get some
better stack traces.

First off, one set of segfaults we get produce this:

Core was generated by `perl5.8.6'.
Program terminated with signal 11, Segmentation fault.
...
#0  Perl_malloc (nbytes=672735716) at malloc.c:1514
1514            if ( (PTR2UV(p->ov_next) & (MEM_ALIGNBYTES - 1))
(gdb) print *p
Cannot access memory at address 0x10ff05
(gdb) print p
$1 = (union overhead *) 0x10ff05
(gdb) where
#0  Perl_malloc (nbytes=672735716) at malloc.c:1514
#1  0x2810575f in Perl_sv_grow (sv=0x898a8b0, newlen=5) at sv.c:1647
#2  0x2810a379 in Perl_sv_setpvn (sv=0x898a8b0, ptr=0xbfbfebf8
"�223�\020",
    len=4) at sv.c:4148
#3  0x2810eef7 in Perl_newSVpvn (s=0xbfbfebf8 "�223�\020", len=4)
    at sv.c:6862
#4  0x282d9dae in XS_Socket_unpack_sockaddr_in (cv=0x83602fc) at Socket.xs:445
#5  0x28102c64 in Perl_pp_entersub () at pp_hot.c:2890
#6  0x280eab09 in Perl_runops_debug () at dump.c:1449
#7  0x280a2efa in S_run_body (oldscope=1) at perl.c:1934
#8  0x280a2ac9 in perl_run (my_perl=0x804d030) at perl.c:1853
#9  0x08049150 in main (argc=9, argv=0xbfbfee1c, env=0xbfbfee44)
    at perlmain.c:98

AFAICT, Socket.xs is identical between 5.8.6 and 5.8.7.

Another coredump I have produces:

Core was generated by `perl5.8.6'.
Program terminated with signal 11, Segmentation fault.
#0  0x2810befd in Perl_sv_clear (sv=0x898abd4) at sv.c:5164
5164            if (SvMAGIC(sv))
(gdb) print sv
$1 = (SV *) 0x898abd4
(gdb) print *sv
$2 = {sv_any = 0x0, sv_refcnt = 0, sv_flags = 255}
(gdb) where
#0  0x2810befd in Perl_sv_clear (sv=0x898abd4) at sv.c:5164
#1  0x2810c43c in Perl_sv_free (sv=0x898abd4) at sv.c:5376
#2  0x280f90cb in Perl_av_clear (av=0x86e57e0) at av.c:470
#3  0x281258f4 in Perl_leave_scope (base=36) at scope.c:933
#4  0x28123664 in Perl_pop_scope () at scope.c:144
#5  0x280fffc1 in Perl_pp_leave () at pp_hot.c:1850
#6  0x280eab09 in Perl_runops_debug () at dump.c:1449
#7  0x280a2efa in S_run_body (oldscope=1) at perl.c:1934
#8  0x280a2ac9 in perl_run (my_perl=0x804d030) at perl.c:1853
#9  0x08049150 in main (argc=9, argv=0xbfbfee1c, env=0xbfbfee44)
    at perlmain.c:98

I have these two corefiles set aside and can do any examination folks would
like to see on it.  I don't know enough about Perl's internal structure to do
much good by myself.  Ask has access to our mail server: these are
~smtpd/qpsmtpd/1.core and ~smtpd/qpsmtpd/2.core respectively.

If I can catch the runaway processes and get a better stack trace/coredump of
them, I'll post those too.

Thanks and any help is appreciated!  -- justin

Reply via email to