--- Pat LaVarre <p.lavarre@ieee.org> wrote: > Can I somehow easily ... > > Erase the kernel stack of a process, run awhile, and > then see how many > bytes of that kernel stack changed? > > I'm interested in guessing how close to overflow I > commonly am running. > Just a guess. Extract the least significatn 13 bits of %esp, subtract that value from 7k (look below why so). This should give you how much of the kernel stack is still available. > http://marc.theaimsgroup.com/?l=kernelnewbies&s=stack+depth > tells me: > "i386 ... kernel stack is a (per process) area of > 8KBytes". > The 8 kb includes the process descriptor and the kernel stack (from the opposite end). The process descriptor is about 1Kb (Need to verify this. printk a sizeof(struct task_struct) and check this). The other 7Kb of the 8K is for the stack. When you do a char buf[65534], this being a local variable is on the stack and this is what makes the kernel go boom. Can give you more details if required. ===== Regards, Kiran Kumar Immidi __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/