Re: User-mode linux stack overflow: could be generic problem

From: Jeff Dike (jdike@karaya.com)
Date: Sun Oct 08 2000 - 11:21:01 EST


jeremy@goop.org said:
> Even with this patch, the overflow is 808 bytes (without the patch
> it's 1232 bytes).

I was mulling over some other changes that would have saved another 256 bytes,
but those don't look like they would help. Try the patch below. It
essentially gives up and lets the stack occupy half of the lower page.

Also, could you look at the stack pointer at each frame, to see if you are
encountering any stack hogs in the generic kernel? In a different situation,
I found devfs putting a 3K structure on the stack.

                                Jeff

--- arch/um/kernel/process_kern.c~ Mon Sep 25 15:34:25 2000
+++ arch/um/kernel/process_kern.c Fri Oct 6 12:07:28 2000
@@ -711,8 +711,13 @@
 
 void check_stack_overflow(void *ptr)
 {
- if((((unsigned long) ptr) & PAGE_MASK) == (unsigned long) current)
- panic("Stack overflowed onto current_task page");
+ unsigned long addr, c;
+
+ addr = (unsigned long) ptr;
+ c = (unsigned long) current;
+
+ if(addr - c < PAGE_SIZE / 2)
+ panic("Stack overflowed well into the current_task page");
 }
 
 int singlestepping(void *t)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 21:00:10 EST