Re: kernel BUG at slab.c:640!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prasad Koya wrote:
Guys

I may be doing something wrong here but I built this
2.4.20-8 kernel. Its been working nice for a long
time. I'm writing this small kernel module and my
module crashes during startup. Here is the stuff from
dmesg:

There probably aren't a lot of people who are interested in 2.4.20 kernels. E.g., the oldest that I have source code for is 2.4.27. However, mm/slab.c, line 640, is still a BUG() in 2.4.27, and it's complaining about the (invalid) parameters that were passed to kmem_cache_create() [or being called in_interrupt(), but that shouldn't be the problem here]:

	/*
	 * Sanity checks... these are all serious usage bugs.
	 */
	if ((!name) ||
		((strlen(name) >= CACHE_NAMELEN - 1)) ||
		in_interrupt() ||
		(size < BYTES_PER_WORD) ||
		(size > (1<<MAX_OBJ_ORDER)*PAGE_SIZE) ||
		(dtor && !ctor) ||
		(offset < 0 || offset > size))
			BUG();

What is sizeof(somestruct) in your code sample?


------------[ cut here ]------------
kernel BUG at slab.c:640!
invalid operand: 0000
psskmod parport_pc lp parport autofs keybdev mousedev
input hid usb-uhci usbcore ext3 jbd
CPU: 0
EIP: 0060:[<c0138216>] Not tainted
EFLAGS: 00010202
EIP is at kmem_cache_create [kernel] 0x66
(2.4.20-8kdp)
eax: 00000000 ebx: 00000000 ecx: 00000013 edx:
c0308cc4
esi: 00000000 edi: d0891be5 ebp: 00002000 esp:
ce02fec0
ds: 0068 es: 0068 ss: 0068
Process insmod (pid: 1795, stackpage=ce02f000)
Stack: 00000000 00000020 00002000 ce02fed8 c1b00dc8
ffffffe0 00000000 ffffffea
00000000 00000000 ce02ff18 d0891101 d0891bd1
00000014 00000000 00002000
00000000 00000000 d0892480 ffffffea 00000000
00000000 d0891000 c011d291
Call Trace: [<d0891101>] lkm_kmod_init [lkmkmod]
0xa1 (0xce02feec))
[<d0891bd1>] .rodata.str1.1 [lkmkmod] 0x45
(0xce02fef0))
[<d0892480>] lkm_ops [lkmkmod] 0x0 (0xce02ff08))
[<c011d291>] sys_init_module [kernel] 0x4e1
(0xce02ff1c))
[<d0891060>] lkm_kmod_init [lkmkmod] 0x0 (0xce02ff20))
[<d0891060>] lkm_kmod_init [lkmkmod] 0x0 (0xce02ff58))
[<c0109537>] system_call [kernel] 0x33 (0xce02ffc0))



Its dying during my module init: lkm_kmod_init() { xyz_cache = kmem_cache_create("xyz_cache", sizeof(struct somestruct), 0, SLAB_HWCACHE_ALIGN, NULL, NULL); if ( !xyz_cache ) { return -1; } }

-- ~Randy - : send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux