linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Zhang, Tianfei" <tianfei.zhang@intel.com>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	Andi Kleen <ak@linux.intel.com>,
	"Xiao, Guangrong" <guangrong.xiao@intel.com>
Subject: about kmemcheck on Linux-3.14
Date: Fri, 25 Sep 2015 04:15:10 +0000	[thread overview]
Message-ID: <BA6F50564D52C24884F9840E07E32DEC2A90B9D9@CDSMSX102.ccr.corp.intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]

Hi all:

I am using linux-3.14 on Android device, want to use kmemcheck.

I write a sample test module, it seems the kmemcheck and slub_debug cannot detect it, any suggestion?

CONFIG_SLUB_DEBUG=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
CONFIG_SLUB_CPU_PARTIAL=y
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_KMEMCHECK=y
# CONFIG_KMEMCHECK_DISABLED_BY_DEFAULT is not set
CONFIG_KMEMCHECK_ENABLED_BY_DEFAULT=y
# CONFIG_KMEMCHECK_ONESHOT_BY_DEFAULT is not set
CONFIG_KMEMCHECK_QUEUE_SIZE=64
CONFIG_KMEMCHECK_SHADOW_COPY_SHIFT=5
CONFIG_KMEMCHECK_PARTIAL_OK=y


Best,
tianfei

static int kmem_free_test(void)
{
       char *buf = kmalloc(100, GFP_KERNEL);
       if (buf) {
              kfree(buf);
              *buf = 200;
       *(buf+10) = 'a';
       *(buf +105) = 200;
              printk("you hit a random char\n");
       }
       return 0;
}

static int __init kmem_test_init(void)
{
       kmem_free_test();
       return 0;
}

static void __exit kmem_test_exit(void)
{
}

module_exit(kmem_test_exit);
module_init(kmem_test_init);

[-- Attachment #2: Type: text/html, Size: 7783 bytes --]

             reply	other threads:[~2015-09-25  4:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25  4:15 Zhang, Tianfei [this message]
2015-10-09  0:39 ` Figo.zhang

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=BA6F50564D52C24884F9840E07E32DEC2A90B9D9@CDSMSX102.ccr.corp.intel.com \
    --to=tianfei.zhang@intel.com \
    --cc=ak@linux.intel.com \
    --cc=guangrong.xiao@intel.com \
    --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