[comp.sys.mac.programmer] Help program runs in THINK Debugger Application crashes

slewis@aerospace.aero.org (02/07/91)

I am hiving problems with my programs running perfectly in the Think C Debugger
and crashing when compiles as an application. Here is my initialization code.
I sometimes get complete crashes and sometimes error 28 (stack overflow). 
Setting the Stack to 100000 or 150000 does not cure the problem.

The call to MaxApplZone can be in or out ( I have had problems running on
the SE with it.

Any Suggestions?

This is my initialization code.

void InitializeSystem()
{
	
	/* Increase the stack size */
	if(!(SetStackSize( 50000L) == noErr))
		error_exit("Cannot raise stack size");
	
	MaxApplZone(); /* SE Cannot run with this */
	InitGraf(&thePort);					/* initialize QuickDraw, 'thePort' holds
										    QuickDraw's variables 					*/

	InitFonts();						/* initialize the Font Manager				*/
	FlushEvents(everyEvent, 0);			/* get rid of pending events in the queue	*/
	InitWindows();						/* initialize the Window Manager			*/
	InitMenus();						/* initialize Menu Manager					*/
	TEInit();							/* initialize TextEdit						*/
	InitDialogs(0L);					/* initialize the Dialog Manager			*/
	InitTheCursor();					/* gives predefined arrow cursor, level = 0	*/
}

Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) (02/09/91)

slewis@aerospace.aero.org writes in a message to All

S> I am hiving problems with my programs running perfectly in the 
S> Think C Debugger and crashing when compiles as an application. 
S> Here is my initialization code. I sometimes get complete crashes 
S> and sometimes error 28 (stack overflow). Setting the Stack to 
S> 100000 or 150000 does not cure the problem

One thing that "got" me was having a reference to the TextWindow that was never
initialized. Apparently the linker didn't catch it when I ran my Think program
as a stand-alone.


Lawson
 

--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!300!15.88!Lawson.English
Internet: Lawson.English@p88.f15.n300.z1.fidonet.org