From owner-freebsd-pf@FreeBSD.ORG Wed Feb 25 13:42:48 2009 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBA851065747 for ; Wed, 25 Feb 2009 13:42:48 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.freebsd.org (Postfix) with ESMTP id C85F28FC1B for ; Wed, 25 Feb 2009 13:42:45 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-066-059-213.pools.arcor-ip.net [88.66.59.213]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MKv1o-1LcK282a4V-000E6F; Wed, 25 Feb 2009 14:42:44 +0100 Received: (qmail 21812 invoked from network); 25 Feb 2009 13:42:44 -0000 Received: from fbsd8.laiers.local (192.168.4.200) by router.laiers.local with SMTP; 25 Feb 2009 13:42:44 -0000 From: Max Laier Organization: FreeBSD To: freebsd-pf@freebsd.org Date: Wed, 25 Feb 2009 14:42:43 +0100 User-Agent: KMail/1.11.0 (FreeBSD/8.0-CURRENT; KDE/4.2.0; i386; ; ) References: <9e20d71e0902250435y6e090fb0rc138233242fe7d60@mail.gmail.com> In-Reply-To: <9e20d71e0902250435y6e090fb0rc138233242fe7d60@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902251442.43794.max@love2party.net> X-Provags-ID: V01U2FsdGVkX194v5eV61yF+p68haUzc+xe3juYjz8tncObHB1 K4lFcWttF930/1/p8I7jV7IlDlB/Hx1gpy/WpHW09fznslCJhp CyWhgHSL7it3E/zuM5+tg== Cc: beck@openbsd.org, samm@os2.kiev.ua, Artis Caune Subject: Re: openbsd spamd is leaking memory? X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2009 13:42:50 -0000 Hello Artis, looks like a valid catch to me. I'm CC'ing the upstream maintainer (Bob, that's you, right?) From a quick glance there is also a minor leak in readsuffixlists in the goto bad case. On Wednesday 25 February 2009 13:35:29 Artis Caune wrote: > we are running spamd-4.1.2 on amd64 boxes for a week now and one of > it's processes are getting bigger and bigger: > spamd: (pf update) (spamd) > SIZE: 836M > RES: 773M > > we use redundant firewalls and they have the same problem. > > grey count is 500'000 - 1'000'000 > white count is 80'000 and growing > 200 - 600 concurrent connections to spamd > /var/db/spamd is 170M > > > > > I look at spamd/grey.c and found that while traversing SLIST in > do_changes() function, entry is removed from head but not freed: > while (!SLIST_EMPTY(&db_changes)) { > dbc = SLIST_FIRST(&db_changes); > ... > free(dbc->key); > free(dbc->data); > SLIST_REMOVE_HEAD(&db_changes, entry); > } > > there is no "free(dbc);" -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News