RE: trap 12 with interrupts disabled, need help

2008-01-08 Thread Andrew Duane
Obvious question: is your stack set up properly, and is it big enough? It could be that you haven't set up a bigger kernel stack yet, and have overrun the small boot stack that the processor was running on. Do you know what the stack pointer is? If it is a few bytes below a page boundary, then

Graceful failure instead of panicking in kmem_malloc

2008-01-08 Thread Bharma Ji
In FreeBSD 6_2, if kmem_malloc is unable to find space it panics. The relevant code is in vm_kern.c if ((flags M_NOWAIT) == 0) panic(kmem_malloc(%ld): kmem_map too small: %ld total allocated, (long)size, (long)map-size); Is there any way

Re: Graceful failure instead of panicking in kmem_malloc

2008-01-08 Thread Kris Kennaway
Bharma Ji wrote: In FreeBSD 6_2, if kmem_malloc is unable to find space it panics. The relevant code is in vm_kern.c if ((flags M_NOWAIT) == 0) panic(kmem_malloc(%ld): kmem_map too small: %ld total allocated, (long)size,

Re: Graceful failure instead of panicking in kmem_malloc

2008-01-08 Thread Bharma Ji
Thanks for the response. I am hoping to keep some memory aside specifically for handling out of memory allocation situations. Yes the real fix is to avoid out of memory allocation. Thanks for the patch. Will try that. As a first cut I am just trying to handle failure gracefully. So asking again -