home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Orlando_1993 / Devcon93.1 / DebugTools / tooldocs / mungwall.doc < prev    next >
Encoding:
Text File  |  1993-01-12  |  7.0 KB  |  166 lines

  1. 14-Dec-92 Mungwall 37.58 doc.
  2.  
  3. Mungwall munges memory and watches for illegal FreeMem's.
  4. Mungwall is especially useful in combination with Enforcer.
  5. Output is either serial or parallel (mungwall.par).
  6.  
  7. Revisions
  8. =========
  9.  
  10. Since 37.49 MungWall, NAMETAG option tags each allocation with the name
  11. of the allocator.  The new "MUNGLIST" program examines used memory areas
  12. for mungwall tag info, and outputs a list of who owns the various
  13. pieces of allocated memory, their sizes, etc.  If you have used the
  14. NAMETAG option of MungWall, this list will include the name of the
  15. task or command that allocated the memory.  Note that certain
  16. allocations belonging to your program may be displayed as belonging
  17. to another task (such as the task of a disk device that you
  18. locked a file on or accessed).
  19.  
  20. Mungwall 37.51 adds an AvailMem wedge which reduces reported available
  21. memory by the size which Mungwall will add to any allocation.  It also
  22. correct a problem which had caused the NAMETAG option to crash on a
  23. 68000.
  24.  
  25. Mungwall 37.52 fixes Enforcer hits in task name comparisons and adds
  26. better A6 handling when calling the real memory functions.
  27.  
  28. Mungwall 37.53 should finally fix mungwall crashes on 68000 when
  29. using taskname-related options.
  30.  
  31. Mungwall 37.54 - some fixes to output during initialization
  32.  
  33. Mungwall 37.55 - fixes a bug in Mungwall where last chunk of memory
  34.    could be lost, and fixes a similar bug in munglist which could occur
  35.    if munglist's buffer filled.  Also added munglist bufsize argument.
  36.  
  37. Mungwall 37.57 - stops null terminating cli_CommandName in place which
  38.    makes mungwall name options again compatible with DMAKE and ARexx
  39.    scripts with 1-character names.  Adds new SHOWFAIL option which
  40.    tells Mungwall to report all failed allocations.  Changes the output
  41.    text "(at 0xhhhhhhh)" to "(task 0xhhhhhhh)" to be easier to understand.
  42.  
  43. Mungwall 37.58 - adds matching NO and UPDATE options for MEGASTACK,
  44.    NAMETAG, and SHOWFAIL.
  45.  
  46.  
  47. What Mungwall Does
  48. ==================
  49.  
  50. Memory munging:
  51.  
  52.  - Except when Enforcer is running, location 0 is set to $C0DEDBAD, i.e.
  53.    programs referencing location zero will not f.e. find a null string.
  54.  
  55.  - On startup all free memory is munged with $ABADCAFE. If this number
  56.    shows up, someone is referencing memory in the free list.
  57.  
  58.  - Except when MEMF_CLEAR is set, memory is pre-munged on allocation with
  59.    $DEADFOOD. When this is used in an Enforcer report, the caller is
  60.    allocating memory and doesn't initialize it before using it. Note that
  61.    only memory which has a cookie attached will be pre-munged.
  62.  
  63.  - Memory is filled with $DEADBEEF before it is freed, encouraging
  64.    programs reusing free'ed memory to crash.
  65.  
  66. Memory watching:
  67.  
  68. Mungwall places a magic cookie before the memory allocation.
  69. Along with a wall of bytes on either side of the allocation to keep an
  70. eye on the memory just before or after the allocation. If the
  71. memory wall is trashed, mungwall complains and shows the damaged area.
  72. If memory is trashed so bad that the cookie is completely gone, Mungwall
  73. will not consider it a walled memory allocation and lets it go. Changes
  74. are you'll be corrupting the memory list and/or overwriting other memory
  75. allocation and crash soon after that. If a mungwall hit occurs, memory
  76. will not be munged or free'ed, to give you a change to look at what was
  77. written there.
  78.  
  79. Both null pointer FreeMem()'s and null sized Alloc/FreeMem()'s trigger
  80. mungwall. Mungwall also gets upset when a memoryblock is free'ed with a
  81. size different from the one used for allocating the memoryblock, and will
  82. say so. The integrity of the walls will be tested according to the size
  83. specified on allocation time, but will not be free'ed.
  84.  
  85. Pointers passed to FreeMem() will be rejected if they are non-longword
  86. alligned. Thus possible catching bogus pointers otherwise left untouched
  87. by mungwall.
  88.  
  89. Unless a specific task(s) is watched and that task leaves before mungwall
  90. does, mungwall will always lose some memory.
  91.  
  92. NOTES:
  93.  
  94. Other debugging tools which SetFunction() AllocMem() and/or
  95. FreeMem() and JSR to what they think is the old memory routine,
  96. should be run BEFORE mungwall. Mungwall needs to know the returnaddress
  97. of the initial caller. Running other debugging tools after mungwall
  98. will result in false reports about layers.library and invalid
  99. mungwall reports about the caller. The 'scratcher' for example must
  100. be run before mungwall, 'memoration' can be run afterwards, since it
  101. JMP's.
  102.  
  103. When mungwall is being stopped, the walls around the original allocations
  104. which are not free'ed at that point, will never get free'ed, only the block
  105. within. Thus causing memory fragmentation and memoryloss.
  106.  
  107. Memory allocations larger than 3 gigabytes will not be marked by mungwall.
  108.  
  109.  
  110.  
  111. MUNGWALL [UPDATE] [[TASK name][WAIT]] [SNOOP] [NOSNOOP] [NOWAIT] [INFO]
  112.          [MEGASTACK] [NOMEGASTACK] [NAMETAG] [NONAMETAG]
  113.      [SHOWFAIL] [NOSHOWFAIL] [PRESIZE n] [POSTSIZE n] [FILLCHAR 0xXX]
  114.  
  115. TASK name   - Watch only the task(s), or all but the task(s) specified
  116.               with 'name'. Multiple tasknames are indicated by placing
  117.               a '|' between the names. If the names are preceeded by an
  118.               exclamation mark, all tasks except the ones indicated are
  119.               tracked. ALL is a reserved name, indicating all tasks
  120.               should be tracked. Default ALL.
  121.  
  122. PRESIZE     - Size of wall before memory allocation in bytes. Minimum 4,
  123.               maximum 64. Default 32.
  124.  
  125. POSTSIZE    - Size of wall after memory allocation in bytes. Minimum 4,
  126.               maximum 64. The actual number of bytes after the allocation
  127.               may vary slightly, since it's upped to the nearest longword.
  128.               Default 32.
  129.  
  130. FILLCHAR n  - Character to build the memory wall with. Can be indicated
  131.               both hexadecimal and decimal. Default 0xBB.
  132.  
  133. SNOOP       - Produce snoop compatible output. No snoop output is given
  134.               for illegal FreeMem's. Default OFF. Layers AllocMem's and
  135.               FreeMem's are never snooped. SNOOP is particulary useful
  136.               in combination with TASK. Snoop output can be filtered
  137.               with 'snoopstrip' to find the origin of memory loss.
  138.  
  139. WAIT        - Halt task causing a hit and wait for Ctrl-C. Make sure you
  140.             - can issue a break to the task. WAIT can be used without
  141.               specifying a specific taskname to watch. Default OFF.
  142.  
  143. INFO        - Show configuration information.
  144.  
  145. MEGASTACK   - Show 32 longwords of the stack whenever a hit/snoop occurs
  146.  
  147. NAMETAG     - Tag each allocation with allocating task or command's name
  148.  
  149. SHOWFAIL    - Tells mungwall to report all memory allocation failures
  150.  
  151. UPDATE      - Indicates an already running mungwall task should be up-
  152.               dated with new parameters. Presize, postsize and fillchar
  153.               can never be updated.
  154.  
  155. The following are extra updating parameters.
  156.  
  157. NOSNOOP     - Turn snooping off.
  158.  
  159. NOWAIT      - No longer halt a task in case of an error.
  160.  
  161. NONAMETAG   - Turn off taskname storage
  162.  
  163. NOMEGASTACK - Turn off megastack option
  164.  
  165. NOSHOWFAIL  - Turn off option that display memory allocation failures
  166.