Re: [3.15-rc1 slab] Oops when reading /proc/slab_allocators

From: Tetsuo Handa
Date: Thu Apr 10 2014 - 07:55:35 EST


Joonsoo Kim wrote:
> There was another report about this problem and I have already fixed
> it, although it wasn't reviewed and merged. See following link.
>
> https://lkml.org/lkml/2014/3/11/119

OK. That patch fixes this problem.

Commit b1cb0982 changed the way of walking objects, didn't it? Then,
it could happen that slab leak detector code walking all objects
triggers an oops.

> In that time, I thought that this problem wasn't related to my patches,
> but your bisect report say that it is from my patches. I will dig into
> the problem more deeply as soon as possible and make proper fix.

I see. Here is a minimal kernel config and test script for qemu on CentOS 6.5.
http://I-love.SAKURA.ne.jp/tmp/config-pre-3.15-rc1-min

---------- test.sh start ----------
#!/bin/sh
mkdir -p tmp/
cc -Wall -O3 --static -o tmp/init -x c - << "EOF"
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/reboot.h>
#include <linux/reboot.h>

int main(int argc, char **argv)
{
FILE *fp;
mkdir("/proc", 0755);
mount(NULL, "/proc", "proc", 0, NULL);
fp = fopen("/proc/slab_allocators", "r");
if (fp) {
char buffer[4096];
printf("Reading /proc/slab_allocators\n");
while (fgets(buffer, sizeof(buffer), fp));
fclose(fp);
}
printf("Shutting down.\n");
reboot(LINUX_REBOOT_CMD_POWER_OFF);
return 0;
}
EOF
(cd tmp; echo init | cpio -o -H newc | gzip -9) > initrd
exec /usr/libexec/qemu-kvm --kernel arch/x86/boot/bzImage --initrd initrd --nographic --append "console=ttyS0,115200n8"
---------- test.sh end ----------
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/