From owner-freebsd-bugs@FreeBSD.ORG Wed Oct 10 22:58:28 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B75DF86 for ; Wed, 10 Oct 2012 22:58:28 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 3A5748FC1C for ; Wed, 10 Oct 2012 22:58:28 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9AMwSOh003811 for ; Wed, 10 Oct 2012 22:58:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9AMwShc003810; Wed, 10 Oct 2012 22:58:28 GMT (envelope-from gnats) Resent-Date: Wed, 10 Oct 2012 22:58:28 GMT Resent-Message-Id: <201210102258.q9AMwShc003810@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mateusz Guzik Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FFA5575 for ; Wed, 10 Oct 2012 21:37:46 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 39B818FC18 for ; Wed, 10 Oct 2012 21:37:46 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9ALbk5i054400 for ; Wed, 10 Oct 2012 21:37:46 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q9ALbk23054399; Wed, 10 Oct 2012 21:37:46 GMT (envelope-from nobody) Message-Id: <201210102137.q9ALbk23054399@red.freebsd.org> Date: Wed, 10 Oct 2012 21:37:46 GMT From: Mateusz Guzik To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/172577: hwpmc can leak memory on unload X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 22:58:28 -0000 >Number: 172577 >Category: kern >Synopsis: hwpmc can leak memory on unload >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 10 22:58:27 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Mateusz Guzik >Release: head r241305 >Organization: >Environment: >Description: On unload of hwpmc the following is reported: Warning: memory type pmc leaked memory on destroy (2 allocations, 512 byt es leaked). Cause: on load pmc_md_initialize() causes some buffers to be allocated on unload the following code from pmc_cleanup is executed: if (md->pmd_cputype == PMC_CPU_GENERIC) pmc_generic_cpu_finalize(md); else pmc_md_finalize(md); pmc_generic_cpu_finalize does not free any memory allocated by functions called by pmc_md_initialize. >How-To-Repeat: I have CPU: Intel(R) Core(TM)2 Duo CPU P9600 @ 2.66GHz (2660.06-MHz K8-class CPU) and ran the following in VirtualBox: # kldload hwpmc # kldunlod hwpmc >Fix: >Release-Note: >Audit-Trail: >Unformatted: