[comp.sys.mac.programmer] What is this system error??

paleo@ecsvax.uncecs.edu (Constantine A. LaPasha) (11/12/88)

Could some kind soul attempt to raise me up from the depths of
darkness?  I have been trying to get a relatively simple pascal
program running on a MAC-SE (1M) under 6.0.1 using Turbo Pascal
(:-( -- (hope to have LSP in a few days)  The program fiddles with
some simple text in 2-4 windows on the screen.  I think I am
allocating windows, handles, pointers etc. properly, and it looks
like I am disposing of everything properly before quitting.

Now the trouble comes if you try to run this thing more than once. 
Doesn't seem to matter if it is run from inside TP or off the 
desktop.  Fisrt time thru generally works ok. Quit, then try again
-> screen comes up and opens 2 status windows ok but bombs when
you first try to make a menu selection or respond to a keydown event.
The bomb box say there has been a system error and mentions 33.
What is the 33??  OK, if from inside TP, click on resume about
7-9 times, then return to the edit window.  Try to run again and
it bombs with 33 just after opening the screen (windows don't open).
Sometimes can resume to the TP edit window, but often MACSBUG now
intercepts and displays "ILGL ERR" ... use ES and MACSBUG displays
"COPR ERR" ... now EA sometimes will display a box with a message
to the effect that TURBO is damaged or busy --> time to RB and 
reboot... Now, after the system comes back, the application cannot
be run from the desktop without bombing, and the source can't be
run from TP without bombing (similar to above)... Dose'nt matter if
I use restart or shutdown first or not.  I tried reinstalling the 
system from 2 different sets of original apple disks (from 2 machines),
and tried reinstalling new copies of TP from the 2 separate copies
(new master disks) that we have... no difference.  Powering down
or leaving the machine for about an hour or so seems to help slightly
(you might get one run of the program) but still get graced with
the bomb 33 message...

Yuck, this is too long winded... there is more bizzare stuff, but
I'll leave it at this for now.  Does anyone have any suggestions
as to where I should start to try to track this down?? I've been
fussing with this for about a month now off and on. I WOULD REALLY
APPRECIATE ANY SUGGESTIONS.  THANKS IN ADVANCE!

==================================================================
Nine out of ten politicians prefer incumbent bikes -- the only way
to run...
=====================================================================
Kostya LaPasha        paleo@uncecs.edu   or   paleo@ecsvax.uncecs.edu
=== NCSU takes no responsibility for anything above ===
==================... beware of root nematodes ...==================
-- 
=====================================================================
Kostya LaPasha        paleo@uncecs.edu   or   paleo@ecsvax.uncecs.edu
=== NCSU takes no responsibility for anything above ===
==================... beware of root nematodes ...==================

bob@eecs.nwu.edu (Bob Hablutzel) (11/12/88)

... Stuff ...
> The bomb box say there has been a system error and mentions 33.
> What is the 33??

... More stuff ...


System bomb 33 is the dreaded negZcbFreeErr. Simply put, a heap thinks that
it has negative amounts of memory free, a condition which simply cannot 
happen in the normal course of human events. Probably you are writting
into some memory you shouldn't touch, either via a dangling pointer, invalid
dereference, or whatever. The only way I can think of finding the problem with
Discipline is to catch every trap, and check the state of the heaps before and
after each trap. While it is not neccessarily a trap which is trashing the 
heap, traps happen often enough that if you can say "at trap x it's ok, and the
next trap, y, reports a problem", you have a smaller area to look in.

Have fun - these can be the worst kinds of errors to have to track down.

Bob Hablutzel	BOB@NUACC.ACNS.NWU.EDU