Kernel stack limit?

Kernel stack limit?

Post by Thomas Vaugha » Tue, 23 Oct 2001 19:43:19

Hello all-

I'm new to (Free)BSD programming, so this may be a dumb question.

Is there a limit to the stack space available to functions
within the kernel?  Occasionally I'll see a * bug where as
soon as a function is entered, the kernel double faults.

If I then reduce the amount of stack space required by the
function (by allocating some variables on the heap, or
breaking the function into subfunctions), then the problem
goes away.

It's possible it's an obscure GCC bug, but that seems pretty
unlikely.  On the other hand, I didn't think there was a limit
to stack size in the kernel.  Or is there something like a
4K limit per function, or some such?

Any and all help is appreciated.




1. Kernel Stack Limit...


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?

Is there a gcc option for x86 that can warn if too large variables are
specified in the stack?

recently we had a problem with one variable accidently declared on the stack
which was quite large, and when
some calls nested, we noticed stack corruption. Once the variable was moved
to global, the corruption went away. We would always see that some member of

"current" would be corrupted, so when the user mode program exits, we will
notice the files member would be having garbage values.

if there is a compiler option to force that during compilation to point out
such weirdness, or if a runtime check could be done during each function
it would be really useful.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at
Please read the FAQ at

2. Open POSIX Test Suite 1.0.0

3. Process Kernel Stack and Interrupt Stack

4. '64bit exec' prom upgrade on 2.7

5. Possibel to implement system , such that Kernel stack grows on top of User Stack

6. Mandrake 8.1: What's on the ext and supp cds? n/m

7. Kernel Limits and RLOGIND limits

8. CLOSE_WAIT state

9. kernel: release: find kernel stack corruption. Aiee

10. Stack limit

11. Is there a stack size limit under UNIX?

12. Stack Size Limit???

13. Enlarging STACK SIZE limit ?