ADC Home > Reference Library > Technical Notes > Legacy Documents > Hardware & Drivers >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

System Error 33, "zcbFree has gone negative"

CONTENTS

System 3.2 introduced a new system error, ID=33, generated by the Memory Manager when it notices that a heap had been corrupted in a certain way. This error is listed in the file "SysErr.a" as "negZcbFreeErr".

[Sep 01 1987]






Introduction

The Memory Manager will trigger an "ID=33" system error when, during some operation which scans the objects in the heap, it sees that its running count of free bytes (zcbFree, an internal value) has become negative (an impossible feat in normal operation). This is nearly always caused by writing zeros past the end of one of the Memory Manager's heap blocks (overwriting and corrupting the next block's header, making it appear to be a free block).

If you get this error, use a debugger (like Macsbug or TMON) when you attempt to reproduce the error, to check the consistency of the heap up to the point where the error occurs. You may need to do this repeatedly until you isolate the operation that is corrupting the heap.

Note that although the heap may become corrupted during a system call, this doesn't mean you've found a bug in the ROM; your code could be passing incorrect or invalid parameters to this or a previous system call, or could have corrupted a data structure used by a system call. More debugging is usually in order in this case; tools like Discipline (included in TMON; also available from users' groups and electronic services) can help detect invalid parameters in system calls. Also, there is a Macsbug command, AH, that can check the consistency of the heap on every system call. See the documentation that came with your debugger to see what special features it offers.

Back to top

A note about "SysErr.a"

Technical Support is often asked for an up-to-date list of error codes. In general, this is provided in "SysErr.a", the file of error numbers shipped with the most current version of MPW. Admittedly, the documentation value of "SysErr.a" is sometimes low (as in the case of negZCBFreeErr), but it may give you a clue as to what the error might mean.

Back to top

References

The Memory Manager

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (28K)

Download


Back to top


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.