|
Home Table Of Contents Support Pages Feedback & Contact Apple Computer, Inc. Mirror Sites Huh? |
By Brian Betchel
Both Type 11 and "No FPU Installed" errors occur on Power Macintosh computers, depending on various factors. Both error messages are the result of programming errors. The "No FPU Installed" error usually means that your program is executing data rather than instructions. The Type 11 error is any error (such as a bus error) in native code.
About "No FPU Installed" ErrorsOn a Power Macintosh computer, the error message "No FPU Installed" usually means your code has jumped to a non-code area and is executing "garbage". In other words, somewhere in that data (which is being interpreted as instructions) is an instruction whose op code begins with the hex value F. No FPU Installed is equivalent to a Type 10 error -- that is, your program has attempted to execute an unknown instruction op code starting with the hex value F."No FPU Installed" can mean some program has jumped to an area of data and has tried to execute any data word starting with the hex value F. The PowerPC chip has floating point support built in, but that floating-point support is different from the Motorola 680x0 family floating-point support. The Motorola 680x0 family uses an external floating-point unit. (There are also external memory management units (MMUs) and other specialized coprocessors.) Motorola 680x0 CPUs use instructions starting with hex value F as instructions for these coprocessors.
680x0 Microprocessor InstructionsAll Motorola 680x0 microprocessors have instructions consisting of at least one word (the operation word); some instructions can have up to eleven words (see the Motorola MC68020 32-bit Microprocessor User's Manual, Third edition, page 3-1.) The operation word determines what kind of instruction is to be executed.For example, the instruction:
MOVE.B D1, D2 translates to the hexadecimal value
1401 This instruction starts with the hex value 1. The instruction
FMOVE.X FP3,-(A7) translates to
F227 6980 This instruction starts with the hex value F.
F-line InstructionsThe Motorola 680x0 architecture was originally designed to support a floating-point coprocessor chip. This chip, the Floating Point Unit (FPU), communicates with the CPU using a special set of instructions called F-line instructions. These instructions always start with an operation word beginning with the hex value F.A program can be compiled to take advantage of the hardware assistance the FPU provides, and thus yield faster floating-point calculations than would be available with Standard Apple Numerics Package (SANE). Such programs would have instructions in the program which start with the hex value F. A program only using SANE would never have an instruction starting with the hex value F. Some Macintosh models, such as the Macintosh SE/30, the Macintosh IIci, and the Macintosh IIfx, shipped with an FPU coprocessor installed. Other 680x0-based Macintosh computers, such as the Macintosh IIsi and the Macintosh Color Classic, had an optional FPU coprocessor. For these machines, it was possible to purchase an optional card with an FPU coprocessor.
68040 & 68LC040 MicroprocessorsThe 68LC040 is a cost-reduced version of the 68040 chip. Savings came about by removing the FPU portion of the chip. Not only does a 68LC040 chip have no FPU, there is no way to add one.
The Power MacintoshPower Macintosh computers emulate a Motorola 68LC040; that is, a machine without FPU support. When you get a bomb with the message "No FPU Installed", it means some instruction has been executed with an operation word starting with the hex value F, and that your program is running on a machine without a FPU. This machine could be one of the following:
Power Macintosh computers contain very fast floating-point support as part of the CPU. This floating-point support is different from the floating-point support provided by the Motorola 680x0 microprocessors. Inside Macintosh: PowerPC Numerics, describes Power Macintosh floating-point support.
Defining a Type 11 ErrorA Type 11 error means an illegal interrupt vector on a 680x0 machine. On a Power Macintosh computer, a Type 11 error is any exception in native code not handled by one of the installed exception handlers. On a Power Macintosh, a Type 11 error can be almost any error that occurred in native code. Type 11 errors may include:
The exception handlers installed for native code do not correctly handle the particular condition which was raised, and the error is returned back to the System Error manager via the Mixed Mode manager. The System Error manager maps all such exceptions to the system error Type 11 error. If you install Macsbug 6.5.2 or later, some Type 11 errors may be reported as a PowerPC unmapped memory exception. This is equivalent to a bus error, that is, an error indicating your program is accessing memory that doesn't exist. The Modern Memory Manager was designed to be less forgiving than the classic (68K) Memory Manager. Disposing of something twice, disposing of memory that was never allocated, and other memory handling problems will often generate a Type 11 error, while on a 68K machine the problem may go unnoticed.
Other Situations Causing Type 11 ErrorsThe following sections document some of the known issues which have been observed when using various products that may cause Type 11 errors.
Color Picker vs. Third-Party SCSI DriversOne reproducible problem stems from a known bug in several third-party SCSI hard disk drivers. The bug causes Color Picker to crash when trying to resolve a startup volume alias it makes at startup time.This problem exists in any system when Color Picker 2.0 or 2.0.1 is installed and the startup volume is not a removable drive. The fundamental cause of the problem is that the SCSI driver incorrectly marks the startup drive as a removable drive during the startup process and changes it to be properly marked as a fixed device after startup. To find its code, the Color Picker resolves the startup volume alias it made during startup. Since the alias passed to the Alias Manager is for a removable drive, the Alias Manager can't resolve the alias (since the device is now marked as fixed). The Color Picker design did not anticipate the startup volume not being found. This results in a Type 11 error. The fix is to upgrade your SCSI driver to a later version.
Calling a Routine That May Move Memory at Interrupt TimeThe Apple Media Kit (AMK), release 1.2, created a situation that could cause random errors. During a VBL task, AMK was calling SetCCursor. SetCCursor can possibly move memory. Moving memory during interrupt time is a very bad idea. The Memory Manager may be in an unstable state, such as compacting memory, when an interrupt routine gets called. This can cause a Type 11 error in native code.A replacement cursor.c file has been provided in the Apple Media Tool/Programming Environment Runtime folder, and we do have a replacement Runtime Maker:Codes:Program file for Apple Media Tool. If you are currently developing titles, replacing these files and rebuilding your projects will remove the bug.
Not Enough Heap SpaceThere are some situations where having small amounts of memory available in the system heap may lead to a Type 11 error. As an example, if the shared library manager can't load a shared library, you may get a Type 11 error. This can happen when QuickTime tries to load a decompressor for certain kinds of images.
Writing Past the End of an ArrayIn Open Transport 1.0.5 or earlier, there was a bug in the TCP/IP control panel code that could corrupt memory if there were more than 256 zones and a MacIP server was found in a zone past the 256th zone. Under these conditions, the control panel code wrote past the end of one of its buffers. This bug would manifest itself if the user opened the select zone dialog and the TCP/IP control panel was left open long enough for the NBP lookup calls for zones past the 256th zone to complete. This is corrected in OpenTransport 1.0.6 and later, but is given here as an example of a Type 11 error.
Insufficient Stack SpaceHeavy use of local variables or recursion may cause your program to run out of stack space. When this happens, you may have crashes that are difficult to track down. Increasing your program's stack is one solution. Whenever you are using a large number of local variables or recursive routines, you should increase your program's stack (using the procedure listed in Inside Macintosh: Memory on page 1-40).As an extreme example, a faceless background application (documented in Technical Note PS 2) has only a 2K stack by default. A 68K application has 24K of stack on most modern machines (8K if no Color QuickDraw is installed, 32K if A/UX is installed). You can use the low memory accessor function LMGetDfltStack to find your current stack size. Native QuickDraw has several changes in algorithms that have increased the size of some structures. PowerPC alignment issues may cause the size of data structures to increase. Check your compiler documentation for further details. To help detect collisions between the stack and the heap, a "stack sniffer" VBL task is installed that compares the current ends of the stack and heap and generates a system error 28 in case of a collision. Unfortunately, the Thread Manager is forced to disable the stack sniffer whenever it is installed. (This is because threads can have a stack in places where the stack sniffer doesn't expect them; if the stack sniffer is enabled, it would generate a system error 28.) This means you don't have the same level of protection as you did under older system software versions without the Thread Manager installed.
Too Much Recursion in QuickDrawNative QuickDraw before version 2.4.1 used a recursive routine to handle regions. This recursive code could cause your stack to run into the heap when handling certain region shapes. Version 2.4.1 of QuickDraw changed to a non-recursive routine which eliminates this error. (You can detect the version of QuickDraw using the Gestalt selector 'qd' which returns a version.) In general, recursion on Power Macintosh computers is dangerous unless you have substantial stack space available; PowerPC stack frames are very large, and putting many of them on the stack may quickly exhaust available stack.
Interrupts Not Handled by Device DriversSome Type 11 errors may legitimately be illegal interrupt vector errors, rather than simply unhandled exceptions in native code. If a device driver for a NuBus or PCI card does not install an interrupt service routine, but the card raises an interrupt, you will receive a Type 11 error. This will happen whether you are running in 68K code or PowerPC code. The only solution for such a problem is to update the driver to correctly handle the interrupt issued by the card.
Other Programming ErrorsCommon programming errors may cause Type 11 or "No FPU Installed" errors. These include the same kinds of errors that usually result in address errors on 680x0-based Macintosh computers. For example:
Troubleshooting TipsHere are some user-level suggestions recommended by Apple about how to deal with unexplained Type 11 or "No FPU Installed" errors:
SummaryThere are no easy solutions for handling Type 11 Error or "No FPU Installed" errors. Only careful debugging and testing by the programmers of the software you use can reduce the number and frequency of these errors. Most problems stem from common programming errors which you can do nothing about unless you are the programmer who wrote the software.
[Previous] [Top] [Next] |
||||
"The Information Alley", in all formats, is copyright Apple Computer, Inc.
All Rights Reserved.