home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17304 < prev    next >
Encoding:
Internet Message Format  |  1992-12-13  |  2.4 KB

  1. Path: sparky!uunet!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!usenet.ucs.indiana.edu!master.cs.rose-hulman.edu!master.cs.rose-hulman.edu!news
  2. From: parkhugj@NeXTwork.Rose-Hulman.Edu (Gregory J Parkhurst)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Truly odd stack overflow situation.
  5. Date: 13 Dec 1992 10:47:48 GMT
  6. Organization: Computer Science Department at Rose-Hulman
  7. Lines: 35
  8. Message-ID: <1gf4ckINN1i8@master.cs.rose-hulman.edu>
  9. References: <9212100328.AA00556@csugrad.cs.vt.edu>
  10. Reply-To: parkhugj@NeXTwork.Rose-Hulman.Edu (Gregory J Parkhurst)
  11. NNTP-Posting-Host: purple.nextwork.rose-hulman.edu
  12.  
  13. I'm posting this for a friend.  (GJP)
  14.  
  15. In article <9212100328.AA00556@csugrad.cs.vt.edu> jaker@csugrad.cs.vt.edu (Jake  
  16. Rose) writes:
  17.  
  18. >  I'm working on a screen blanker commodity, and I'm having the most bizarre
  19. >stack overflow error I've ever seen.  If I run the program from the Workbench
  20. >or from the cli, it runs fine (no enforcer hits, either, so nyah! :) ).
  21.  
  22. >However, if I place it in the WBStartup drawer it causes a stack overflow when
  23. >it attempts to blank the screen.  I've tracked down the point of overflow to
  24. >a single function call, which passes a pointer and three longs.  This is
  25. >obviously no major stack operation, so I upped the stack size for the program
  26. >(using Info) just to see what would happen.  Surprizingly, even at twice the
  27. >stack space, there's no change in its behavior.
  28.  
  29. >Here's the line that brings it down (It *is* on this line, not in the function
  30. >it calls - don't you just love cut & paste (TERM 2.4!)):
  31.  
  32. >         if (!(Data=BuildData(Screen,Data1,Data2,Data3,Data4)))
  33.  
  34.      I was also writing a screen-blanker Commodity (seems like everybody is  
  35. now!) and ran into the same problem.  The problem is with the stack checker.
  36. When you are in this routine that calls BuildData(), your code is running as a
  37. part of another task or process.  Therefore, you need to inform the compiler of  
  38. this fact by using the __interrupt keyword on *any* function called in an  
  39. interrupt or call-back type situation (where the code in question does not use  
  40. the same stack as the main program).  You probably put the one for the routine  
  41. that initially gets called, but not for BuildData().
  42.      Another solution is to turn off stack checking altogether.  I prefer to  
  43. keep the __interrupt keywords in in case I or someone else turns the stack  
  44. checking on and then runs into the problem again.
  45.  
  46. Craig M. Buchek
  47.  
  48.