tech-kern archive

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

POOL_DIAGNOSTIC broken



I can file a PR on this too, if people would prefer.

I attempted to boot a kernel with POOL_DIAGNOSTIC, and got the following panic:

Boot: tnetbsd
4277588+363440 [224448+217087]=0x4d91e0
 start=0x100000
trap: kernel write DSI trap @ 0x9fe81088 by 0x304b90 (DSISR 0x42000000,
err=14), lr 0x304b70
Press a key to panic.
panic: trap
Stopped in pid 0.1 (system) at  netbsd:cpu_Debugger+0x10:       lwz     r0, r1,
0
x14
db{0}> bt
0x005dfc30: at panic+0x228
0x005dfc80: at trap+0x138
0x005dfd10: kernel DSI write trap @ 0x9fe81088 by malloc+0x33c: srr1=0x1032
            r1=0x5dfdd0 cr=0x4000028 xer=0 ctr=0x3e0268 dsisr=0x42000000
0x005dfdd0: at malloc+0x318
0x005dfe10: at pool_init+0x2d0
0x005dfe50: at uvm_km_vacache_init+0x120
0x005dfe80: at kmeminit+0x98
0x005dfeb0: at uvm_init+0x70
0x005dfed0: at main+0x48
0x005dff30: at 0x1000c4

This is caused by line 806 of subr_pool.c, which calls malloc inside pool_init.

The following patch seems to work around the problem for me, but I don't know
if it's the right thing to do.

RCS file: /cvsroot/src/sys/kern/kern_malloc.c,v
retrieving revision 1.119
diff -u -r1.119 kern_malloc.c
--- kern/kern_malloc.c  17 Mar 2008 17:05:54 -0000      1.119
+++ kern/kern_malloc.c  8 Apr 2008 21:08:15 -0000
@@ -908,7 +908,7 @@
        kmem_map = uvm_km_suballoc(kernel_map, &kmb,
            &kml, ((vsize_t)nkmempages << PAGE_SHIFT),
            VM_MAP_INTRSAFE, false, &kmem_map_store);
-       uvm_km_vacache_init(kmem_map, "kvakmem", 0);
+       //uvm_km_vacache_init(kmem_map, "kvakmem", 0);
        kmembase = (char *)kmb;
        kmemlimit = (char *)kml;
 #ifdef KMEMSTATS
@@ -925,6 +925,7 @@
        /* Attach all of the statically-linked malloc types. */
        __link_set_foreach(ksp, malloc_types)
                malloc_type_attach(*ksp);
+       uvm_km_vacache_init(kmem_map, "kvakmem", 0);
 }
 
 #ifdef DDB


---
Tim Rightnour <root%garbled.net@localhost>
NetBSD: Free multi-architecture OS http://www.netbsd.org/
Genecys: Open Source 3D MMORPG: http://www.genecys.org/


Home | Main Index | Thread Index | Old Index