source: rtems/cpukit/libmisc/stackchk/README

Last change on this file was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1Introduction
2============
3
4This directory contains a stack bounds checker.  It provides two
5primary features:
6
7   + check for stack overflow at each context switch
8   + provides an educated guess at each task's stack usage
9
10Enabling
11========
12
13Add the stack checker extension to the initial user extension set.
14If using confdefs.h to build your configuration table, this is
15as simple as adding -DSTACK_CHECK_ON to the gcc command line which
16compiles the file defining the configuration table.  In the RTEMS
17test suites and samples, this is always init.c
18
19Background
20==========
21
22The stack overflow check at context switch works by looking for
23a 16 byte pattern at the logical end of the stack to be corrupted.
24The "guesser" assumes that the entire stack was prefilled with a known
25pattern and assumes that the pattern is still in place if the memory
26has not been used as a stack.
27
28Both of these can be fooled by pushing large holes onto the stack
29and not writing to them... or (much more unlikely) writing the
30magic patterns into memory.
31
32This code has not been extensively tested.  It is provided as a tool
33for RTEMS users to catch the most common mistake in multitasking
34systems ... too little stack space.  Suggestions and comments are appreciated.
35
36NOTES:
37
381.  Stack usage information is questionable on CPUs which push
39    large holes on stack.
40
412.  The stack checker has a tendency to generate a fault when
42    trying to print the helpful diagnostic message.  If it comes
43    out, congratulations. If not, then the variable Stack_check_Blown_task
44    contains a pointer to the TCB of the offending task.  This
45    is usually enough to go on.
46
47FUTURE:
48
491.  Determine how/if gcc will generate stack probe calls and support that.
Note: See TracBrowser for help on using the repository browser.