Skip to contentSkip to conversation

2.6.0-test1 oops mm/slab.c:1631

DISCUSSION Manfred Spraul 1 participant 1 message Jul 14, 2003 Memory management

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · Nicolas

kernel BUG at mm/slab.c:1631!

That's

     BUG_ON(GET_PAGE_CACHE(page) != cachep);

Someone called kmem_cache_free(cachep, obj), but cachep is for a different object type.

Quoted 3 lines
Call Trace:
[sys_open+120/133] sys_open+0x78/0x85

Within sys_open - probably putname().
I have no idea how the bug could be triggered. If you can easily reproduce it: can you try the attached patch? It prints additional data.

And please add more details: Which gcc compiler, which filesystems, etc.

--
Manfred

mm/slab.c +7 -1
@@ -1628,7 +1628,13 @@
 	kfree_debugcheck(objp);
 	page = virt_to_page(objp);
 
-	BUG_ON(GET_PAGE_CACHE(page) != cachep);
+	if (GET_PAGE_CACHE(page) != cachep) {
+		printk(KERN_ERR "mismatch in kmem_cache_free: expected cache %p, got %p\n",
+				GET_PAGE_CACHE(page),cachep);
+		printk(KERN_ERR "%p is %s.\n", cachep, cachep->name);
+		printk(KERN_ERR "%p is %s.\n", GET_PAGE_CACHE(page), GET_PAGE_CACHE(page)->name);
+		WARN_ON(1);
+	}
 	slabp = GET_PAGE_SLAB(page);
 
 	if (cachep->flags & SLAB_STORE_USER) {