From owner-freebsd-bugs@FreeBSD.ORG Thu Oct 20 15:24:21 2005 Return-Path: X-Original-To: freebsd-bugs@FreeBSD.org Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19E9B16A41F; Thu, 20 Oct 2005 15:24:21 +0000 (GMT) (envelope-from bhughes@trolltech.com) Received: from esparsett.troll.no (esparsett.troll.no [80.232.37.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D67C43D9A; Thu, 20 Oct 2005 15:24:16 +0000 (GMT) (envelope-from bhughes@trolltech.com) Received: from esparsett.troll.no (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 6E54AB4F; Thu, 20 Oct 2005 17:24:15 +0200 (CEST) Received: from [80.232.37.28] (reticent.troll.no [80.232.37.28]) by esparsett.troll.no (Postfix) with ESMTP id 5A0ECAC2; Thu, 20 Oct 2005 17:24:15 +0200 (CEST) Message-ID: <4357B69F.7050108@trolltech.com> Date: Thu, 20 Oct 2005 17:24:15 +0200 From: Bradley T Hughes Organization: Trolltech AS User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050908) X-Accept-Language: en-us, en MIME-Version: 1.0 To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org References: <200510201520.j9KFKIZQ029076@freefall.freebsd.org> In-Reply-To: <200510201520.j9KFKIZQ029076@freefall.freebsd.org> Content-Type: multipart/mixed; boundary="------------070208000107050800030908" Cc: Subject: Re: bin/87729: most calls to malloc(3) generate warnings in valgrind X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2005 15:24:21 -0000 This is a multi-part message in MIME format. --------------070208000107050800030908 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit FreeBSD-gnats-submit@FreeBSD.org wrote: > Thank you very much for your problem report. > It has the internal identification `bin/87729'. > The individual assigned to look at your > report is: freebsd-bugs. > > You can access the state of your problem report at any time > via this link: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=87729 > > >>Category: bin >>Responsible: freebsd-bugs >>Synopsis: most calls to malloc(3) generate warnings in valgrind >>Arrival-Date: Thu Oct 20 15:20:18 GMT 2005 Here is the patch that I couldn't attach when using the web form. -- Bradley T. Hughes - bhughes at trolltech.com Trolltech AS - Waldemar Thranes gt. 98 N-0175 Oslo, Norway --------------070208000107050800030908 Content-Type: text/plain; name="malloc.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="malloc.c.diff" --- malloc.c Wed Oct 19 13:30:01 2005 +++ malloc.c~ Wed Oct 19 13:29:01 2005 @@ -635,8 +635,11 @@ for(;k-i >= MALLOC_BITS; i += MALLOC_BITS) bp->bits[i / MALLOC_BITS] = ~0; - for(; i < k; i++) - bp->bits[i/MALLOC_BITS] |= 1<<(i%MALLOC_BITS); + if (i < k) { + bp->bits[i/MALLOC_BITS] = 0; + for(; i < k; i++) + bp->bits[i/MALLOC_BITS] |= 1<<(i%MALLOC_BITS); + } if (bp == bp->page) { /* Mark the ones we stole for ourselves */ --------------070208000107050800030908--