home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / lisp / mcl / 1247 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  1.7 KB

  1. Path: sparky!uunet!gossip.pyramid.com!olivea!apple!apple!cambridge.apple.com!bill@cambridge.apple.com
  2. From: bill@cambridge.apple.com (Bill St. Clair)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: Stack Overflow Error
  5. Message-ID: <9208171856.AA04152@cambridge.apple.com>
  6. Date: 17 Aug 92 19:58:57 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 31
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10. Full-Name: Bill St. Clair
  11. Original-To: frege@eecs.umich.edu
  12. Original-Cc: info-mcl
  13.  
  14. >   Here is what I get:
  15. >
  16. >> Error: Stack overflow.
  17. >> While executing: #<STANDARD-METHOD FOCUS-VIEW (SIMPLE-VIEW)>
  18. >> Type Command-. to abort.
  19. >
  20. >   Is there a way to set the size of the system stack space?
  21. >
  22. >- Young-pa So
  23.  
  24. There is a way, but I doubt very much that it will help. The stack
  25. almost always overflows because your code is doing infinite recursion,
  26. not because it needs more stack. Look at the output of:
  27.  
  28. (print-call-history)
  29.  
  30. or use the Stack Backtrace dialog and look for a function that is called
  31. multiple times with the same arguments. If you are indeed using up the stack
  32. because of code that needs a huge amount of it, page 5 of the MCL 2.0 Release
  33. Notes documents the :STACK-MAXIMUM and :STACK-MINIMUM keywords for the
  34. :MEMORY-OPTIONS argument to SAVE-APPLICATION. You can also change these
  35. values by editing the 'LSIZ' resource with ResEdit.
  36.  
  37. If you are still stumped, send me the output (or part of the output, it
  38. will be long) from (print-call-history).
  39.  
  40. P.S. There is one other place that can sometimes cause stack overflow
  41. even without infinite recursion. Code that recurses on both the
  42. CAR and CDR of a list will often stack overflow when given a long
  43. list as an argument. This code should be rewritten to recurse on
  44. the CAR and iterate (often via a tail-call) on the CDR.
  45.