You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2004/02/19 17:56:25 UTC

[Bug 3067] New: Memory leak in libspamc

http://bugzilla.spamassassin.org/show_bug.cgi?id=3067

           Summary: Memory leak in libspamc
           Product: Spamassassin
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Libraries
        AssignedTo: spamassassin-dev@incubator.apache.org
        ReportedBy: nkukard@lbsd.net


As below there are 2 memory leaks which i've picked up, the actual problem came
to be when I was using libspamc to analize messages. I then used valgrind on
spamc and found the following....

The funniest thing of all though is that the VMSIZE of the application we
designed shoots up to 1Gb+ after running the linked-in version of our spam
analysis tool.


[nkukard@nigel-lappy.landonet nkukard]$ valgrind --tool=memcheck
--leak-check=yes -v /tmp/spamc -d 127.0.0.1 -p 783 -s 256000 -t 600 -u root -c <
/tmp/message.raw
==28651== Memcheck, a memory error detector for x86-linux.
==28651== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==28651== Using valgrind-2.1.0, a program supervision framework for x86-linux.
==28651== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==28651== Command line
==28651==    /tmp/spamc
==28651==    -d
==28651==    127.0.0.1
==28651==    -p
==28651==    783
==28651==    -s
==28651==    256000
==28651==    -t
==28651==    600
==28651==    -u
==28651==    root
==28651==    -c
==28651== Startup, with flags:
==28651==    --suppressions=/usr/local/lib/valgrind/default.supp
==28651==    --leak-check=yes
==28651==    -v
==28651== Reading syms from /tmp/spamc
==28651== Reading syms from /lib/ld-2.3.2.so
==28651== Reading syms from /usr/local/lib/valgrind/vgskin_memcheck.so
==28651== Reading syms from /usr/local/lib/valgrind/valgrind.so
==28651== Reading syms from /lib/libdl-2.3.2.so
==28651== Reading syms from /usr/lib/libssl.so.0.9.7
==28651== Reading syms from /usr/lib/libcrypto.so.0.9.7
==28651== Reading syms from /lib/libc-2.3.2.so
==28651== Reading suppressions file: /usr/local/lib/valgrind/default.supp
==28651== Estimated CPU clock rate is 1298 MHz
==28651==
3.4/5.0
==28651==
==28651== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==28651== malloc/free: in use at exit: 528386 bytes in 2 blocks.
==28651== malloc/free: 4 allocs, 2 frees, 529774 bytes allocated.
==28651==
==28651== searching for pointers to 2 not-freed blocks.
==28651== checked 4666444 bytes.
==28651==
==28651== 256001 bytes in 1 blocks are possibly lost in loss record 1 of 2
==28651==    at 0x40025D4F: malloc (vg_replace_malloc.c:160)
==28651==    by 0x804949A: message_read_raw (libspamc.c:339)
==28651==    by 0x8049097: main (spamc.c:257)
==28651==
==28651==
==28651== 272385 bytes in 1 blocks are possibly lost in loss record 2 of 2
==28651==    at 0x40025D4F: malloc (vg_replace_malloc.c:160)
==28651==    by 0x8049C43: _message_filter (libspamc.c:661)
==28651==    by 0x804A400: message_filter_with_failover (libspamc.c:920)
==28651==    by 0x80490BE: main (spamc.c:259)
==28651==
==28651== LEAK SUMMARY:
==28651==    definitely lost: 0 bytes in 0 blocks.
==28651==    possibly lost:   528386 bytes in 2 blocks.
==28651==    still reachable: 0 bytes in 0 blocks.
==28651==         suppressed: 0 bytes in 0 blocks.
==28651== Reachable blocks (those to which a pointer was found) are not shown.
==28651== To see them, rerun with: --show-reachable=yes
--28651--     TT/TC: 0 tc sectors discarded.
--28651--            985 chainings, 0 unchainings.
--28651-- translate: new     1902 (30583 -> 418558; ratio 136:10)
--28651--            discard 0 (0 -> 0; ratio 0:10).
--28651--  dispatch: 0 jumps (bb entries), of which 4685 (468500%) were unchained.
--28651--            153/2166 major/minor sched events.  1904 tt_fast misses.
--28651-- reg-alloc: 240 t-req-spill, 79281+1488 orig+spill uis, 9374 total-reg-r.
--28651--    sanity: 152 cheap, 7 expensive checks.
--28651--    ccalls: 8468 C calls, 52% saves+restores avoided (26126 bytes)
--28651--            11004 args, avg 0.86 setup instrs each (3066 bytes)
--28651--            0% clear the stack (25404 bytes)
--28651--            2997 retvals, 33% of reg-reg movs avoided (1936 bytes)
[nkukard@nigel-lappy.landonet nkukard]$



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.