home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pop / 86 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  2.2 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!mailgzrz.TU-Berlin.DE!math.fu-berlin.de!news.belwue.de!ira.uka.de!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!ames!agate!doc.ic.ac.uk!uknet!news.cs.bham.ac.uk!axs
  2. From: axs@cs.bham.ac.uk (Aaron Sloman)
  3. Newsgroups: comp.lang.pop
  4. Subject: Re: User stack overflow: Detecting the culprit
  5. Summary: changing sysPUSH to record stack operations
  6. Keywords: stack
  7. Message-ID: <By4LDJ.B3s@cs.bham.ac.uk>
  8. Date: 22 Nov 92 16:20:06 GMT
  9. References: <By4Gty.Ax2@cs.bham.ac.uk>
  10. Sender: news@cs.bham.ac.uk
  11. Organization: School of Computer Science, University of Birmingham, UK
  12. Lines: 33
  13. Nntp-Posting-Host: emotsun
  14.  
  15. lpb@cs.bham.ac.uk (Luc Beaudoin) writes:
  16.  
  17. > Date: Sun, 22 Nov 1992 14:41:57 GMT
  18. >
  19. > Does anyone out there have tools for detecting the source of user stack
  20. > overflow (I take "stack overflow" to mean having unintended items on the
  21. > stack)? (I'm not looking for a piece of hardware that video records the
  22. > programmer, the real culprit :).)Particularly useful would be a utility
  23. > which, for every item currently on the stack, keeps track of which
  24. > procedure left the item there. Given such a utility, one could ask it
  25. > who is responsible for the Nth item on the stack.
  26.  
  27. The only thing I can think of is to sysunprotect("sysPUSH") (and
  28. "sysPUSHQ") then redefine them so that if pop_stack_debugging is non
  29. false then the new version, after calling the old version, plants a
  30. call of a procedure that you could define (e.g. sys_pusher_of (??))
  31. that stores information about the item on top of the stack and the
  32. current caller, obtained either at run time using caller(0), or at
  33. compile time by using the name of the procedure being compiled. The
  34. latter would probably be best.
  35.  
  36. There may already be a global variable holding the name of the
  37. procedure currently being defined. If not redefine sysPROCEDURE so
  38. that it saves its first argument in an accessible global.
  39.  
  40. None of this will give you access to stack pushes produced by system
  41. procedures.
  42. Aaron
  43. -- 
  44. Aaron Sloman, School of Computer Science,
  45. The University of Birmingham, B15 2TT, England
  46. EMAIL   A.Sloman@cs.bham.ac.uk  OR A.Sloman@bham.ac.uk
  47. Phone: +44-(0)21-414-3711       Fax:   +44-(0)21-414-4281
  48.