From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julian Graham Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: Possible Memory Leak with stream-for-each Date: Thu, 2 Sep 2010 12:20:20 -0400 Message-ID: References: <8762yoe2eo.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1283444746 2135 80.91.229.12 (2 Sep 2010 16:25:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Sep 2010 16:25:46 +0000 (UTC) Cc: guile-user@gnu.org, guile-devel@gnu.org To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Sep 02 18:25:44 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OrCbY-0002KE-R8 for guile-devel@m.gmane.org; Thu, 02 Sep 2010 18:25:37 +0200 Original-Received: from localhost ([127.0.0.1]:40643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrCbX-0000ko-Ie for guile-devel@m.gmane.org; Thu, 02 Sep 2010 12:25:35 -0400 Original-Received: from [140.186.70.92] (port=43101 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrCWV-0006Yx-Oy for guile-devel@gnu.org; Thu, 02 Sep 2010 12:20:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrCWU-0001Rp-9v for guile-devel@gnu.org; Thu, 02 Sep 2010 12:20:23 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:35427) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrCWU-0001RX-6s; Thu, 02 Sep 2010 12:20:22 -0400 Original-Received: by iwn33 with SMTP id 33so956751iwn.0 for ; Thu, 02 Sep 2010 09:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CnMYG6pLvTEDXxvUqIMKOm9MaZ0J9c/IT5dI76mmVxM=; b=AcKLQRD7qeBtMYIHAdLwi29uBjdfBXyXcyS0sOhwM/riKL2RaYkjZhGKuFL88CkFRs 4+K9zLfXYqQj1rRpFxVDQhdyizD6F904lbjX/dVp3OqBDWBJLba9yG30yX4PqRjAYnOT /wP3UbDWpO/N1Gv0U4uMdQ7eDOYzFCcxkyDcQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ODf5zANqPQQpmVHaXXKlgBltAwmXiDlmkpFVWz8RLAm14d8tycUBllhpud1hwnhGcn D2zTjTQCREoTakMAyr3DprLUEK5hZyxCSuSSO7TYZ4MiIKBQsgq+gfnYI4r58GMOFHfl MTJKSYGL5R2MGilXnSXG/MZMU+KopA+kcnLP0= Original-Received: by 10.231.191.6 with SMTP id dk6mr10781680ibb.51.1283444420605; Thu, 02 Sep 2010 09:20:20 -0700 (PDT) Original-Received: by 10.231.25.164 with HTTP; Thu, 2 Sep 2010 09:20:20 -0700 (PDT) In-Reply-To: <8762yoe2eo.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10838 gmane.lisp.guile.user:8142 Archived-At: Hey Ludovic, On Thu, Sep 2, 2010 at 8:49 AM, Ludovic Court=E8s wrote: > I believe this patch fixes the problem: > > =A0http://git.sv.gnu.org/cgit/guile.git/commit/?id=3Df57fdf07d6374028f35b= cb1ee748a94022deda6d > > Basically =91force=92 was leaking memory because it uses =91lock-mutex=92= , which > was the culprit (!). > > Julian: Could you please review this patch? Sure. That looks alright to me, especially in light of our discussion on IRC. Summary: The list of held mutexes is not weak; it's a list of weak-car pairs. So if a particular mutex in the list goes away, the pair's still hanging around. The patch introduces more explicit cleanup of that mutex list. (Thanks for clarifying that!) Regards, Julian