source: rtems/cpukit/libmisc/stackchk/README @ dc2a1750

4.104.114.84.9
Last change on this file since dc2a1750 was ac200c1, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 29, 2004 at 8:34:01 PM

2004-09-29 Joel Sherrill <joel@…>

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