From: Yves M. <yme...@fr...> - 2007-03-30 17:12:28
|
Hi ! I have no perfparse development environment so I can only read from the mail. What I see is that p2 is far too big. It increments until it finds a \0 character. If p2 is so big, there is a problem before in the string that p2 iterates on. Enjoy :) Yves On Fri, 30 Mar 2007 12:49:38 -0300, "Paulo Afonso Graner Fessel" <pau...@de...> wrote: > I've traced the problem with greater detail and found that the problem is > at perf_get_next at log_parser.c file. > > The problem occurs within these lines of code: > > if(p1[0] == '\'') { > p1++; > p2 = p1; > /* Check length of label */ > while(p2[0] != '\0') { > if((p2[0] == '\\') && (p2[1] == '\'')) { > p2++; > } else if((p2[0] == '\\') && (p2[1] == '\\')) { > p2++; > } else if(p2[0] == '\'') { > break; > } > p2++; > } > if(p2[0] == '\0') return(-2); > if(p2[1] != '=') return(-3); > /* Reallocate memory for label if necessary */ > l = p2-p1; > if(l>= p->label_len) { > p->label_len += 20; > perfparse stops here => p->label = > realloc(p->label,p->label_len*sizeof(char)); > if(NULL == p->label) return(-4); > } > > > And here go perfparse-log2mysql famous last words: > > 154 l = p2-p1; > (gdb) n > 155 if(l>= p->label_len) { > (gdb) > 157 p->label = > realloc(p->label,p->label_len*sizeof(char)); > (gdb) > 156 p->label_len += 20; > (gdb) > 157 p->label = > realloc(p->label,p->label_len*sizeof(char)); > (gdb) > *** glibc detected *** realloc(): invalid next size: 0x09853f98 *** > > Program received signal SIGABRT, Aborted. > 0x006327a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 > (gdb) backtrace full > #0 0x006327a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 > No symbol table info available. > #1 0x006727f5 in raise () from /lib/tls/libc.so.6 > No symbol table info available. > #2 0x00674199 in abort () from /lib/tls/libc.so.6 > No symbol table info available. > #3 0x006a64ea in __libc_message () from /lib/tls/libc.so.6 > No symbol table info available. > #4 0x006ae8c2 in _int_realloc () from /lib/tls/libc.so.6 > No symbol table info available. > #5 0x006af786 in realloc () from /lib/tls/libc.so.6 > No symbol table info available. > #6 0x002ff067 in perf_get_next (data=0x98408b8, p=0x98409e8) at > log_parser.c:157 > p1 = 0x772820 "\001" > p2 = 0x9853f98 "" > l = Variable "l" is not available. > > I've found a link > (http://www.archivesat.com/Linux_C_programming/thread1222039.htm) which > tells about some kind of programming error which "blows away bookkeeping > of the memory allocator". In this case, is this a Perfparse bug or a glibc > bug? > > []'s and TIA > > Paulo Afonso Graner Fessel > Administrador de Ambiente e Sistemas UNIX > pau...@de... > Fone: +55 (11) 3848-7422 (Novo número) > http://www.dedalusprime.com.br > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Perfparse-users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perfparse-users -- - Homepage - http://ymettier.free.fr - http://www.logicacmg.com - - GPG key - http://ymettier.free.fr/gpg.txt - - Maitretarot - http://www.nongnu.org/maitretarot/ - - C en action - http://www.oreilly.fr/catalogue/2841772896.html - |