Stack overflows

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I use intel processers,Arm and X86. I want to find stack overflow.
Somone said that it is possible to use a "stack descriptor" in an
Intel processor to catch
exactly this kind of fault. But I don't know how? Does anyone know
this?

Re: Stack overflows

Quoted text here. Click to load it

If you're running in a protected mode, the Intel segmentation model gives a
possibility to catch an addressing attempt outside of a segment. The segment
boundaries are in the segment descriptor, which is a table element in the
global descriptor table (GDT) or local descriptor table (LDT) of the process
executing. The tables are built by the kernel running the protected mode
environment.

The detailed instructions depend heavily upon the environment you're running
your code in.

For hardware details, get a book on Intel 386+ architecture and look at
protected mode programming model. The segmentation is already in 80286, but
in limited 16 bit form.

HTH

Tauno Voipio
tauno voipio @ iki fi



Re: Stack overflows


or if you're using paged memory model, using a "guard page" is a popular and
simple arrangement.

-bryan

Quoted text here. Click to load it
a
segment
process
running
but



Re: Stack overflows
Quoted text here. Click to load it

Have a look at MPATROL and EFENCE. They help you track down memory related
bugs. If nothing else they will help you understand what you should be
looking for in terms of tools.

Regards
Sergio Masci

http://www.xcprod.com/titan/XCSB - optimising structured PIC BASIC compiler



Re: Stack overflows
Quoted text here. Click to load it

For older, non-MMU processors, the tactic always has been to 'fill' the
stack with a certain 'guard' pattern on thread initialisation, and check
the guard pattern at the top once in a while. (in interrupt, for example)

This detects stack overflows but doesn't prevent the accompanying damage.

Wumpus


Re: Stack overflows

Quoted text here. Click to load it

It does if the only damage is the corruption of the guard pattern.




Site Timeline