----------------------- GURU MEDITATION NUMBERS. ------------------------ By Mike Cross, September 1990 He is red, he is black and he is a flasher. who is he? He is every Amiga coders nightmare - The Guru. The Readers Digest pocket dictionary (hmm, very flash!) defines a Guru as being a Hindu spiritual healer, maybe it was a smart ass joke by Commodore to call the wrecker of source a healer, maybe, maybe not, we will never know. For most people a Guru means a forced reset and possibly the loss of valuable data, but have you ever wondered what exactly a guru meditation number means? The Hardware manual and Systems programmers guide do not even touch upon this important subject, and I have had to turn to the Compute! book `Amiga Machine Language Programmers guide' (wow what an original title) This book fully doccuments what exactly a meditation number is, and helps the careless programmer to rectify the error that cause the Guru. If you do not have the Compute! book then do not worry as I have just spent ages typing all the relevant text in, so read on . . . . A guru meditation number decoding table can help debug Amiga - specific programming errors. A guru meditation number has 16 hexadecimal digits and look like : 81000009.00281002 You can decode such a message this way : SSGESPER.00ADDRES SS two-digit subsytem code GE two-digit general error code SPER four-digit specific error code ADDRES six-digit task memory address Subsytems : CODE MEANING 00 CPU Trap (see below) 01 Exec 02 Graphics 03 Layers 04 Intuition 05 Math 06 Clist 07 Dos 08 Ram 09 Icon 0A Expansion 10 Audio 11 Console 12 Gameport 13 Keyboard 14 TrackDisk 15 Timer 20 CIA Chip 21 Disk 22 Miscellaneous 30 BootStrap 31 Workbench 32 DiskCopy Sometimes the first digit of the subsystem is an 8 (as in the example above). In that case, ignore the 8, and read the subsytem number as a 1 in our example. That means there was an Exec error. General Error Codes CODE MEANING 01 Not enough memory 02 MakeLibrary 03 OpenLibrary 04 OpenDevice 05 OpenResource 06 I/O Error 07 Signal Absent Specific Error Code Exec: CODE MEANING 0001 Checksum: exception vector 0002 Checksum: ExecBase 0003 Checksum: Library 0004 No memory for library 0005 Memory list danaged 0006 No memory for interrupt server 0007 InitAPtr 0008 Damaged Semaphore 0009 Can`t free already free memory 000A Bogus Exception Graphics: CODE MEANING 0001 No memory for Copper display list 0002 No memory for Copper instruction list 0003 Overloaded Copper list 0004 Overloaded Copper intermediate list 0005 No memory for Copper list head 0006 No memory (long frame) 0007 No memory (short frame) 0008 No memory for flood fill 0009 No memory for TmpRas in text operation 000A No memory for BlitBitmap call 000B Region Memory 0030 MakeVPort error 1234 GfxNoLCM Layers: CODE MEANING 0001 No memory Intuition: CODE MEANING 0001 Unknown gadget type 0002 No memory for port 0003 No memory to allocate item plane 0004 No memory for sub allocation 0005 No memory for plane allocation 0006 Item`s top less than RelZero 0007 No memory to open screen 0008 No memory to allocate screen raster 0009 Unknown screen type to window 000A No memory to add SW gadgets 000B No memory to open window 000C Bad state return entering Intuition 000D Bad message recieved by IDCMP 000E Weird echo causing incomprehension 000F Can`t open console device Dos: CODE MEANING 0001 No memory at startup 0002 EndTask did not end task 0003 Qpkt quick I/O failure 0004 Unexpected packet recieved 0005 Freevec failure 0006 Disk block sequence error 0007 Bitmap damaged 0008 Key already free 0009 Checksum error 000A Disk error 000B Key out of range 000C Bad Overlay (may be linker-related) Ram: CODE MEANING 0001 Bad sement list Expansion: CODE MEANING 0001 Bad expansion free TrackDisk: CODE MEANING 0001 Calibration timing seek error 0002 Timer wait error Timer: CODE MEANING 0001 Bad request 0002 Bad supply Disk: CODE MEANING 0001 Unit already has disk 0002 Interrupt; no active unit BootStrap: CODE MEANING 0001 System boot code returned error CPU Traps are internal microprocessor errors: CODE MEANING 0002 Bus error 0003 Address error 0004 Illegal instruction 0005 Divide by zero 0006 CHK instruction 0007 TRAPV (TrapVector) instruction 0008 Supervisor mode privilege violation 0009 Trace 000A Line A trap (OpCode 1010) 000B Line B trap (OpCode 1011) The CPU trap errors can often be traced back to programming errors like misused instruction sizes. Arranging the program so that words or long words fall on odd memory addresses frequently results in 00000003 or 00000004 errors. The actual subsystem general and specific errors above are usually traceable to misuse of memory (for instance, trying to free memory that is already free) or the failure of a library function. If a library function call returns an error code and your program does not bother to respond to it, the program will usually crash and present you with a guru message. For example, if OpenWindow fails and a program tries later to attach a menu to the nonexistant window, you will run into problems. If you try to allocate memory and fail, and then try to use the nonexistant memory, be prepared to visit the Guru. Memory that is not currently allocated, also cannot be freed. The process of debugging is an art, and a complete discussion of machine language debugging would fill an entire book. You should always check for errors after any library call, this will help to reduce problems later on. The best debugging is bug prevention. The Amiga ROM Kernal - Reference Manual: Exec has more information on Amiga debugging tools. The Guru meditation example 81000009.00xxxxxx means Exec error (ignore initial eight), General Error 00 (no general error) and SPecific ERror 0009 (tried to free memory already free.). The xxxxxx will be the address of the instruction that caused the error. M J Cross, 22.45, 16 October 1990