home *** CD-ROM | disk | FTP | other *** search
- 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
- From: parkhugj@NeXTwork.Rose-Hulman.Edu (Gregory J Parkhurst)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Truly odd stack overflow situation.
- Date: 13 Dec 1992 10:47:48 GMT
- Organization: Computer Science Department at Rose-Hulman
- Lines: 35
- Message-ID: <1gf4ckINN1i8@master.cs.rose-hulman.edu>
- References: <9212100328.AA00556@csugrad.cs.vt.edu>
- Reply-To: parkhugj@NeXTwork.Rose-Hulman.Edu (Gregory J Parkhurst)
- NNTP-Posting-Host: purple.nextwork.rose-hulman.edu
-
- I'm posting this for a friend. (GJP)
-
- In article <9212100328.AA00556@csugrad.cs.vt.edu> jaker@csugrad.cs.vt.edu (Jake
- Rose) writes:
-
- > I'm working on a screen blanker commodity, and I'm having the most bizarre
- >stack overflow error I've ever seen. If I run the program from the Workbench
- >or from the cli, it runs fine (no enforcer hits, either, so nyah! :) ).
-
- >However, if I place it in the WBStartup drawer it causes a stack overflow when
- >it attempts to blank the screen. I've tracked down the point of overflow to
- >a single function call, which passes a pointer and three longs. This is
- >obviously no major stack operation, so I upped the stack size for the program
- >(using Info) just to see what would happen. Surprizingly, even at twice the
- >stack space, there's no change in its behavior.
-
- >Here's the line that brings it down (It *is* on this line, not in the function
- >it calls - don't you just love cut & paste (TERM 2.4!)):
-
- > if (!(Data=BuildData(Screen,Data1,Data2,Data3,Data4)))
-
- I was also writing a screen-blanker Commodity (seems like everybody is
- now!) and ran into the same problem. The problem is with the stack checker.
- When you are in this routine that calls BuildData(), your code is running as a
- part of another task or process. Therefore, you need to inform the compiler of
- this fact by using the __interrupt keyword on *any* function called in an
- interrupt or call-back type situation (where the code in question does not use
- the same stack as the main program). You probably put the one for the routine
- that initially gets called, but not for BuildData().
- Another solution is to turn off stack checking altogether. I prefer to
- keep the __interrupt keywords in in case I or someone else turns the stack
- checking on and then runs into the problem again.
-
- Craig M. Buchek
-
-