Re: Bad code in rcorder(8) (Was: Re: New RCorder: abi loaded too late)

From: Ulrich Spoerlein <q_at_galgenberg.net>
Date: Tue, 21 Feb 2006 19:04:40 +0100
Doug Barton wrote:
> Divacky Roman wrote:
> > I tried running rcorder under valgrind and it showed me massive
> > leaks/double-frees etc. unfortunately I am not able to run valgrind on recent
> > 7-current (when I start it it just creates 2.8G coredump)
> > 
> > it would be great to run coverity on rcorder or something to reveal the bugs. I
> > am willing to hack on it but I'd appreciate some help (either the valgrind
> > running or list of coverity revealed bugs)
> 
> I actually requested a coverity check of the code, and it didn't turn up
> anything. The code for rcorder is the same in both HEAD and RELENG_6,
> although obviously you won't get the new malloc if you are running in the
> latter. However, I'm guessing that if you fix things that are obviously bugs
> that are exposed by valgrind on RELENG_6, it would still be valuable to
> bring those fixes into HEAD first.

Looks fine to me ...

% valgrind --leak-check=yes rcorder -s nostart /etc/rc.d/* /usr/local/etc/rc.d/*
==7236== Memcheck, a memory error detector for x86-linux.
==7236== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward.
==7236== Using valgrind-2.1.0, a program supervision framework for x86-linux.
==7236== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.
==7236== Estimated CPU clock rate is 998 MHz
==7236== For more details, rerun with: -v
==7236== 
/etc/rc.d/rcconf.sh
/etc/rc.d/dumpon
/etc/rc.d/initrandom
...
/etc/rc.d/bsnmpd
/etc/rc.d/bgfsck
==7236== 
==7236== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==7236== malloc/free: in use at exit: 18734 bytes in 612 blocks.
==7236== malloc/free: 4090 allocs, 3478 frees, 744580 bytes allocated.
==7236== For counts of detected errors, rerun with: -v
==7236== searching for pointers to 612 not-freed blocks.
==7236== checked 1323540 bytes.
==7236== 
==7236== 2032 bytes in 110 blocks are definitely lost in loss record 1 of 3
==7236==    at 0x3C032183: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck.so)
==7236==    by 0x80489DA: emalloc (ealloc.c:75)
==7236==    by 0x8048E56: strnode_add (rcorder.c:216)
==7236==    by 0x8049055: add_keyword (rcorder.c:388)
==7236== 
==7236== LEAK SUMMARY:
==7236==    definitely lost: 2032 bytes in 110 blocks.
==7236==    possibly lost:   0 bytes in 0 blocks.
==7236==    still reachable: 16702 bytes in 502 blocks.
==7236==         suppressed: 0 bytes in 0 blocks.
==7236== Reachable blocks (those to which a pointer was found) are not shown.
==7236== To see them, rerun with: --show-reachable=yes

If the problem lies with a specific rc script, you should probably try
to find out which one, or post them somewhere, so people can take a
look.

Ulrich Spoerlein
-- 
 PGP Key ID: 20FEE9DD				Encrypted mail welcome!
Fingerprint: AEC9 AF5E 01AC 4EE1 8F70  6CBD E76E 2227 20FE E9DD
Which is worse: ignorance or apathy?
Don't know. Don't care.

Received on Tue Feb 21 2006 - 17:04:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:52 UTC