Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Oct 2011 19:57:50 GMT
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/161755: Kernel fails to report negative malloc type statistics
Message-ID:  <201110171957.p9HJvoRh091465@red.freebsd.org>
Resent-Message-ID: <201110172000.p9HK0QHl004957@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         161755
>Category:       kern
>Synopsis:       Kernel fails to report negative malloc type statistics
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 17 20:00:26 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Arnaud Lacombe
>Release:        10-current
>Organization:
n/a
>Environment:
>Description:
When malloc-type are uninit, a verification is made to ensure that no memory has been leaked, however, it fails to report if memory allocation have been badly accounted (ie `malloc(X, M_FOO)' followed by `free(Y, M_BAR)').


from `sys/kern/kern_malloc.c':
 
if (temp_allocs > 0 || temp_bytes > 0) {
    printf("Warning: memory type %s leaked memory on destroy "
        "(%ld allocations, %ld bytes leaked).\n", mtp->ks_shortdesc,

this do not report whenever `temp_allocs' or `temp_bytes' are negative, which should be reported, else, whatever is printed can not be trusted.
>How-To-Repeat:

>Fix:
Patch available at:

https://github.com/lacombar/freebsd/commit/8b498200a0389ec48021959e32eaf198c075b6ca

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110171957.p9HJvoRh091465>