home *** CD-ROM | disk | FTP | other *** search
- 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
- From: axs@cs.bham.ac.uk (Aaron Sloman)
- Newsgroups: comp.lang.pop
- Subject: Re: User stack overflow: Detecting the culprit
- Summary: changing sysPUSH to record stack operations
- Keywords: stack
- Message-ID: <By4LDJ.B3s@cs.bham.ac.uk>
- Date: 22 Nov 92 16:20:06 GMT
- References: <By4Gty.Ax2@cs.bham.ac.uk>
- Sender: news@cs.bham.ac.uk
- Organization: School of Computer Science, University of Birmingham, UK
- Lines: 33
- Nntp-Posting-Host: emotsun
-
- lpb@cs.bham.ac.uk (Luc Beaudoin) writes:
-
- > Date: Sun, 22 Nov 1992 14:41:57 GMT
- >
- > Does anyone out there have tools for detecting the source of user stack
- > overflow (I take "stack overflow" to mean having unintended items on the
- > stack)? (I'm not looking for a piece of hardware that video records the
- > programmer, the real culprit :).)Particularly useful would be a utility
- > which, for every item currently on the stack, keeps track of which
- > procedure left the item there. Given such a utility, one could ask it
- > who is responsible for the Nth item on the stack.
-
- The only thing I can think of is to sysunprotect("sysPUSH") (and
- "sysPUSHQ") then redefine them so that if pop_stack_debugging is non
- false then the new version, after calling the old version, plants a
- call of a procedure that you could define (e.g. sys_pusher_of (??))
- that stores information about the item on top of the stack and the
- current caller, obtained either at run time using caller(0), or at
- compile time by using the name of the procedure being compiled. The
- latter would probably be best.
-
- There may already be a global variable holding the name of the
- procedure currently being defined. If not redefine sysPROCEDURE so
- that it saves its first argument in an accessible global.
-
- None of this will give you access to stack pushes produced by system
- procedures.
- Aaron
- --
- Aaron Sloman, School of Computer Science,
- The University of Birmingham, B15 2TT, England
- EMAIL A.Sloman@cs.bham.ac.uk OR A.Sloman@bham.ac.uk
- Phone: +44-(0)21-414-3711 Fax: +44-(0)21-414-4281
-