linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* about kmemcheck on Linux-3.14
@ 2015-09-25  4:15 Zhang, Tianfei
  2015-10-09  0:39 ` Figo.zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang, Tianfei @ 2015-09-25  4:15 UTC (permalink / raw)
  To: linux-mm, Andi Kleen, Xiao, Guangrong

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-09  0:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-25  4:15 about kmemcheck on Linux-3.14 Zhang, Tianfei
2015-10-09  0:39 ` Figo.zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox