Re: Stack Trace dump in do_IRQ

From: Jörn Engel (joern@wohnheim.fh-wedel.de)
Date: Tue Apr 29 2003 - 07:59:04 EST


On Tue, 29 April 2003 18:04:28 +0530, Chandrasekhar wrote:
>
> We have a custom driver which runs on Red Hat Advanced Server 2.1(kernel
> version 2.4.9-e.3).
> On loading the driver (using insmod) and running our configuration program,
> we got folowing warning message "do_IRQ: stack overflow: 1786" and along
> with the stack trace.
>
> The configuration program, however, ran successfully.
>
> On going through the do_IRQ code in arch/i386/kernel/irq.c we found that is
> is used for debugging check for stack overflow i.e if the stack size is less
> than 2KB free.
> There is no similar debugging check in other kernels like 2.4.7-10,2.4.18-3
> and 2.4.18-14.
> What is the significance of this debugging information and why other kernels
> dont have the same check? Also, if the stack overflow can cause future
> problems, then
> how can we increase the stack size? Thanks in advance for any information on
> this.

I don't know those kernel versions, they appear to be redhat-specific.
But current mainline kernels, both 2.4 and 2.5 have had this check for
a while already. You have to set a config option to enable them.

In principle, there is absolutely no way how linux can tell when the
check will spill over. The check in do_irq simply checks if the kernel
was close, at the time of that interrupt. This is enough to catch
dangerous code paths and fix them, before any real problems occur.

"close" for mainline kernels means, there is less than 1k of free
stack left. Your redhat kernel seems to use 2k, I even go as far as
5k, but that definitely fills my logs. 1786 is the number of bytes
still free on the stack. Should be enough for you.

If you can reproduce something as low as 1786 for a recent 2.4 or 2.5
kernel, I'd be interested in the backtrace. For 2.4.9, I just don't
care. :)

Jörn

-- 
Fantasy is more important than knowlegde. Knowlegde is limited,
while fantasy embraces the whole world.
-- Albert Einstein
-
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 : Wed Apr 30 2003 - 22:00:31 EST