All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: "Alexandra N. Kossovsky" <Alexandra.Kossovsky@oktetlabs.ru>
Cc: Len Brown <lenb@kernel.org>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-acpi@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Huang Ying <ying.huang@intel.com>
Subject: Re: kmemleak in apei_res_add
Date: Wed, 21 Aug 2013 10:38:08 +0100	[thread overview]
Message-ID: <CAHkRjk4y06puTL_Gq5RbpoV+kpEp+k32z5aq3HpEu9u3qsS_Aw@mail.gmail.com> (raw)
In-Reply-To: <20130812024556.GB29956@sanechka.spb.ru>

On 12 August 2013 03:45, Alexandra N. Kossovsky
<Alexandra.Kossovsky@oktetlabs.ru> wrote:
> When running 3.10.3 with kmemleak enabled, I see following warnings from
> kmemleak:
>
> unreferenced object 0xffff88024d2219a0 (size 32):
>   comm "swapper/0", pid 1, jiffies 4294894532 (age 26865.180s)
>   hex dump (first 32 bytes):
>     58 de 0c 73 02 88 ff ff 58 de 0c 73 02 88 ff ff  X..s....X..s....
>     18 50 fd 7d 00 00 00 00 3f 50 fd 7d 00 00 00 00  .P.}....?P.}....
>   backtrace:
>     [<ffffffff813ddf40>] kmemleak_alloc+0x21/0x3e
>     [<ffffffff8111cb99>] kmemleak_alloc_recursive.constprop.58+0x16/0x18
>     [<ffffffff8111efac>] kmem_cache_alloc_trace+0xe6/0x12f
>     [<ffffffff81278f0e>] apei_res_add+0xb9/0xe8
>     [<ffffffff81278faa>] collect_res_callback+0x6d/0x7c
>     [<ffffffff812788ed>] apei_exec_for_each_entry+0x78/0x93
>     [<ffffffff8127891d>] apei_exec_collect_resources+0x15/0x17
>     [<ffffffff81b010e5>] erst_init+0x278/0x2a3
>     [<ffffffff810020b5>] do_one_initcall+0x7b/0x116
>     [<ffffffff81ac9ee7>] kernel_init_freeable+0x13f/0x1cc
>     [<ffffffff813db19f>] kernel_init+0x9/0xd6
>     [<ffffffff813fe5bc>] ret_from_fork+0x7c/0xb0
>     [<ffffffffffffffff>] 0xffffffffffffffff

Are there any "APEI:" errors in the kernel log? It could be some
freeing missing on an error path.

apei_res_add() allocates struct apei_res objects and places them on
the erst_resources.{iomem,ioport} list heads as given by erst_init().
The erst_resources is just a local variable on the erst_init() stack,
hence kmemleak doesn't have any trace of the allocated objects.

It looks like erst_init() calls apei_resources_request() which should
merge the local erst_resources list heads with the global
apei_resources_all but for whatever reason, this or any of the
previous calls in erst_init() fail and we don't get the merging. Some
of the goto err_fini in this function should probably be err_release.
I cc'ed Huang as the driver author.

-- 
Catalin

  reply	other threads:[~2013-08-21  9:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12  2:45 kmemleak in apei_res_add Alexandra N. Kossovsky
2013-08-21  9:38 ` Catalin Marinas [this message]
2013-08-21 13:44   ` Alexandra N. Kossovsky
2013-08-22  8:43     ` Huang Ying
2013-08-23 12:32       ` Alexandra N. Kossovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHkRjk4y06puTL_Gq5RbpoV+kpEp+k32z5aq3HpEu9u3qsS_Aw@mail.gmail.com \
    --to=catalin.marinas@arm.com \
    --cc=Alexandra.Kossovsky@oktetlabs.ru \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.