lkml.org 
[lkml]   [2000]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: User-mode linux stack overflow: could be generic problem
Date
From
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/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.077 / U:12.732 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site