[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

malloc.c:get_from_chain() endless loop



we have a process stuck in malloc.c:get_from_chain() which looks to be in 
an endless loop.  the elt->next list points back to itself, and `remains'
is always >= min_remain:
	    if (remains >= 0 && remains < min_remain) {
		oldgoodp = oldp;
		min_remain = remains;
	    }
	    if (remains == 0) {
		break;
	    }

I doubt I'll be able to reproduce the problem at will, but I've included
some debug info below that might shed some light, any ideas what might
trigger this?

(gdb) printf "%d:%s\n", PL_curcop->cop_line, \
   ((XPV*)(*(XPVGV*)PL_curcop->cop_filegv->sv_any) \
   ->xgv_gp->gp_sv->sv_any)->xpv_pv 

105:/usr/repoman/V1_1_19991221_01/lib/perl5/site_perl/5.005/HTTP/Message.pm

(gdb) where
#0  get_from_chain (size=2048) at malloc.c:839
#1  0x805edb2 in morecore (bucket=11) at malloc.c:1123
#2  0x805e2c0 in malloc (nbytes=1212) at malloc.c:747
#3  0x805f528 in realloc (mp=0x906dac8, nbytes=1198) at malloc.c:1425
#4  0x80a65fd in Perl_sv_grow (sv=0x8ef32b4, newlen=1198) at sv.c:1136
#5  0x80aa637 in Perl_sv_catpvn (sv=0x8ef32b4, 
    ptr=0x8d44d03 "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD
HTML//EN\">\r\n<html>\r\n\r\n<head>\r\n<meta
http-equiv=\"Content-Type\"\r\ncontent=\"text/html;
charset=iso-8859-1\">\r\n\r\n<title>NPR's Talk of the
Nation</title>\r\n\r\n\r\n\r\n</head>\r\n\r"..., len=1197) at sv.c:2460
#6  0x809d256 in Perl_pp_concat () at pp_hot.c:177
#7  0x809c5c4 in Perl_runops_debug () at run.c:66
#8  0x805a183 in perl_run (sv_interp=0x810d428) at perl.c:1095
#9  0x8057f73 in main (argc=2, argv=0x7ffffc74, env=0x7ffffc80)
    at perlmain.c:51
#10 0x2ab4ecb3 in __libc_start_main (main=0x8057ef0 <main>, argc=2, 
    argv=0x7ffffc74, init=0x80570e0 <_init>, fini=0x80f228c <_fini>, 
    rtld_fini=0x2aab5350 <_dl_fini>, stack_end=0x7ffffc6c)
    at ../sysdeps/generic/libc-start.c:78

(gdb) p elt
$15 = (struct chunk_chain_s *) 0x8ed1c00
(gdb) p elt->next
$16 = (struct chunk_chain_s *) 0x9007400
(gdb) p elt->next->next
$17 = (struct chunk_chain_s *) 0x8ed1c00
(gdb) p elt->next->next->next
$18 = (struct chunk_chain_s *) 0x9007400
(gdb) p elt->next->next->next->next
$19 = (struct chunk_chain_s *) 0x8ed1c00
(gdb) p elt->next->next->next->next->next
$20 = (struct chunk_chain_s *) 0x9007400

829             if (elt->size >= size) {
(gdb) p elt->size
$21 = 26624
(gdb) p size
$22 = 2048
(gdb) n
830                 long remains = elt->size - size;
(gdb) 
831                 if (remains >= 0 && remains < min_remain) {
(gdb) p remains
$23 = 24576
(gdb) p min_remain
$24 = 24576
(gdb) n
835                 if (remains == 0) {

% perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.5-15, archname=i686-linux
    uname='linux sedona 2.2.5-15 #1 mon apr 19 23:00:46 edt 1999 i686
unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux
(egcs-1.1.2
 release)
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/lib /usr/lib /usr/local/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING
  Built under linux
  Compiled at Dec 21 1999 15:49:43
  @INC:
    /usr/repoman/V1_1_19991221_01/lib/perl5/5.00503/i686-linux
    /usr/repoman/V1_1_19991221_01/lib/perl5/5.00503
    /usr/repoman/V1_1_19991221_01/lib/perl5/site_perl/5.005/i686-linux
    /usr/repoman/V1_1_19991221_01/lib/perl5/site_perl/5.005
    .



Follow-Ups from:
Ilya Zakharevich <ilya@math.ohio-state.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]