linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Jim Cromie <jim.cromie@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] kmemleak-test: drop __init to get better backtrace
Date: Fri, 28 Apr 2023 18:11:54 +0100	[thread overview]
Message-ID: <ZEv+Wi3eSD3fw0hR@arm.com> (raw)
In-Reply-To: <20230425222446.170486-4-jim.cromie@gmail.com>

On Tue, Apr 25, 2023 at 04:24:46PM -0600, Jim Cromie wrote:
> Drop the __init on kmemleak_test_init().  With it, the storage is
> reclaimed, but then the symbol isn't available for "%pS" rendering,
> and the backtrace gets a bare pointer where the actual leak happened.
> 
> unreferenced object 0xffff88800a2b0800 (size 1024):
>   comm "modprobe", pid 413, jiffies 4294953430
>   hex dump (first 32 bytes):
>     73 02 00 00 75 01 00 68 02 00 00 01 00 00 00 04  s...u..h........
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   backtrace (ck 603070071):
>     [<00000000fabad728>] kmalloc_trace+0x26/0x90
>     [<00000000ef738764>] 0xffffffffc02350a2
>     [<00000000004e5795>] do_one_initcall+0x43/0x210
>     [<00000000d768905e>] do_init_module+0x4a/0x210
>     [<0000000087135ab5>] __do_sys_finit_module+0x93/0xf0
>     [<000000004fcb1fa2>] do_syscall_64+0x34/0x80
>     [<00000000c73c8d9d>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
> 
> with __init gone, that trace entry renders like:
> 
>     [<00000000ef738764>] kmemleak_test_init+<offset>/<size>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>


  reply	other threads:[~2023-04-28 17:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 22:24 [PATCH 0/3] kmemleak report format changes Jim Cromie
2023-04-25 22:24 ` [PATCH 1/3] kmemleak: drop (age <increasing>) from leak record Jim Cromie
2023-04-25 22:24 ` [PATCH 2/3] kmemleak: add checksum to backtrace report Jim Cromie
2023-04-25 22:24 ` [PATCH 3/3] kmemleak-test: drop __init to get better backtrace Jim Cromie
2023-04-28 17:11   ` Catalin Marinas [this message]
2023-04-28 17:25 ` [PATCH 0/3] kmemleak report format changes Catalin Marinas
2023-11-11  0:19   ` jim.cromie
2023-11-16 17:56     ` Catalin Marinas

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=ZEv+Wi3eSD3fw0hR@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=jim.cromie@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox