Re: Kernel Stack Limit...

From: Randy.Dunlap (rddunlap@osdl.org)
Date: Thu Aug 29 2002 - 14:18:21 EST


On 29 Aug 2002, Robert Love wrote:

| On Thu, 2002-08-29 at 15:07, Raj, Ashok wrote:
|
| > Please reply to me, since i dont have this email id on the list.
| >
| > Could someone tell me at what the kernel stack size limit is?
|
| It depends on the architecture. 8KB for x86 and most others. Some
| (all?) 64-bit platforms have 16KB stacks.
|
| Note the effective size is actually (8KB - sizeof(task_struct)) in 2.4
| and (8KB - sizeof(thread_info)) in 2.5 since those structures are stored
| at the top of the stack.
|
| Also note interrupts share the stack.
|
| > Is there a gcc option for x86 that can warn if too large variables are
| > specified in the stack?
|
| I believe 2.4-ac has a stack overflow check in it... as does the RedHat
| kernel - check it out.
|
| Also kgdb (or at least our copy here at MontaVista) has a stack overflow
| check.

Also Keith Owens posted a script in the last couple of days
that checks stack depth.

-- 
~Randy

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



This archive was generated by hypermail 2b29 : Sat Aug 31 2002 - 22:00:27 EST