home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 13931 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  2.0 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!samsung!transfer!ceylon!choffman.gte.com!user
  2. From: chuck@gte.com (Chuck Hoffman)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Help!  System error #28
  5. Message-ID: <chuck-130892084411@choffman.gte.com>
  6. Date: 13 Aug 92 12:49:44 GMT
  7. References: <chuck-120892123052@choffman.gte.com>
  8. Sender: news@ceylon.gte.com
  9. Followup-To: comp.sys.mac.programmer
  10. Organization: GTE Laboratories
  11. Lines: 35
  12.  
  13. In article <chuck-120892123052@choffman.gte.com>, chuck@gte.com (Chuck
  14. Hoffman) wrote:
  15. > SystemErrors DA says "stack has moved into application heap."  Is this
  16. > simply a memory management problem, or is it really something else
  17. > masquerading as a memory problem with a bogus return?
  18.  
  19. In article <chuck-120892141258@choffman.gte.com>, chuck@gte.com (Chuck
  20. Hoffman) wrote:
  21. > Arrrrgggghhhh!!!!  I changed the program SIZE parameter and the error
  22. > changed to #25 (out of memory).  Something is definitely running amok.
  23.  
  24. Problem solved.
  25.  
  26. I got some very interesting and helpful information about stack management
  27. from John Wallace at TRW.  Thanks much, John.  I appreciate it.
  28.  
  29. The problem turned out to be a dumb error masquerading as a memory
  30. management problem, though.  I had passed an int to FSRead for the number
  31. of bytes to read.  It was expecting a long, so FSRead thought the few bytes
  32. ahead of my int were the upper half of a long word with a VERY large value.
  33.  Naturally, the read overflowed the buffer in the stack and manifested
  34. itself as error #28 or #25.
  35.  
  36. This kind of problem would have been much easier to debug at the assembly
  37. level with MacsBug, rather than at the source level with THINK C Debugger. 
  38. I'm a very experienced programmer using IBM System/370 Assembly Language
  39. (mainframe).  I simply must learn 680x0 assembly language.  Any
  40. recommendations for textbook, course, or assembler software?
  41.  
  42. -Chuck Hoffman
  43.  
  44. I'm not sure why we're here, but I am sure that while we're here we're
  45. supposed to help each other.
  46.