Skip to contentSkip to conversation

How to find out kernel stack over flow?

DISCUSSION nazim khan 3 participants 5 messages Sep 7, 2005 – Sep 8, 2005

lore
Share & tools
lore

nazim khan

author
#0 lore raw

Hi,

I suspect that one of my module that I am inserting in the kernel may be causing the stack overflow which is leading to kernel crash (may because it is corrupting some one lese memory).

How can I find this out?

Thanks in advance.
Nazim

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#1 lore raw
Quoted 6 lines · nazim khan

I suspect that one of my module that I am inserting in the kernel may be causing the stack overflow which is leading to kernel crash (may because it is corrupting some one lese memory).

How can I find this out?

You could enable CONFIG_DEBUG_STACKOVERFLOW.
If you showed us your module's source code, someone might see the bug.

Michal

#2 lore raw
Quoted 11 lines · Michal Schmidt
Quoted 6 lines · nazim khan

I suspect that one of my module that I am inserting in the kernel may be causing the stack overflow which is leading to kernel crash (may because it is corrupting some one lese memory).

How can I find this out?

You could enable CONFIG_DEBUG_STACKOVERFLOW.
If you showed us your module's source code, someone might see the bug.

Quoted 6 lines

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

Additionally, if you have netconsole/netdump set up, you can examine the resultant core file with the crash utility to find telltale signs of an overflow. Nominally a stack overflow results in the corruption of data at the end of a neighboring task_struct.

Regards
Neil

Signature · 5 lines
/***************************************************
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 ***************************************************/
author
#3 lore raw
In reply to Michal Schmidt

Thanks Michal for your response,

I forgot to mention that I am using linux 2.4.26,
and STACKOVERFLOW option is not available here.

regards,
Nazim

--- Michal Schmidt <[email protected]>

Quoted 9 lines · wrote:
Quoted 1 line · nazim khan

I suspect that one of my module that I am

inserting in

Quoted 1 line

the kernel may be causing the stack overflow which

is

Quoted 1 line

leading to kernel crash (may because it is

corrupting

Quoted 2 lines

some one lese memory).

Quoted 8 lines
Quoted 1 line

How can I find this out?

You could enable CONFIG_DEBUG_STACKOVERFLOW. If you showed us your module's source code, someone might see the bug.

Michal

______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/

#4 lore raw
Quoted 8 lines · nazim khan

Thanks Michal for your response,

I forgot to mention that I am using linux 2.4.26,
and STACKOVERFLOW option is not available here.

regards,
Nazim

It shouldn't be a difficult thing to hand-edit in (or at least an approximation thereof). Its really just a comparison of the current stack pointer in relation to the current task_struct preformed in the do_IRQ function (so that it check stack depth on interrupts).

Alternative to this method, or the netdump method I mentioned earlier. If you have some idea of which function(s) you are likely to be executing when the stack overflows, you can also use -finstrument-functions as a finer grained approach to detecting the problem.

Regards
Neil

Quoted 33 lines

--- Michal Schmidt <[email protected]>

Quoted 9 lines · wrote:
Quoted 1 line · nazim khan

I suspect that one of my module that I am

inserting in

Quoted 1 line

the kernel may be causing the stack overflow which

is

Quoted 1 line

leading to kernel crash (may because it is

corrupting

Quoted 2 lines

some one lese memory).

Quoted 8 lines
Quoted 1 line

How can I find this out?

You could enable CONFIG_DEBUG_STACKOVERFLOW. If you showed us your module's source code, someone might see the bug.

Michal

______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 5 lines
/***************************************************
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 ***************************************************/