A propos de l'erreur 11 sur PowerMac

A propos de l'erreur 11 sur PowerMac

#6781 - Part 5 - Benoît Manet

Après mes mésaventures de stabilité de système 7.5.2, j'ai cherché et trouvé un article de chez Apple qui traitait de ces erreurs (InfoAlley.V2.Iss16). Je vous le livre dans son intégralité car il me parait intéressant pour compléter le dossier des erreurs 11. Les conclusions me paraissent toutefois laisser peu d'issues à l'utilisateur:

==============================================
The Information Alley, Volume 2, Issue 16 -- November 27, 1995
Copyright 1994-95, Apple Computer, Inc.

The "Information Alley" is a publication of Apple Computer, Inc., Support Information Services. It is available to all Apple customers and Apple computer users through a variety of online services.
==============================================

"Type 11 & No FPU Errors on a Power Macintosh
---------------------------------------------
By Brian Betchel

The contents of this article are taken from a Apple Developers' Technote. It explains some of the causes of "Type 11" and "No FPU Installed" errors experienced by some users of Power Macintosh computers. The Technote includes some programmers' and developers' source code information and programming tips which have been excluded from this article. To receive a copy of the original Technote, please contact Apple Developer Services (APDA) or you can read it on the World Wide Web at http://www.info.apple.com/dev/technotes/Main.html.

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" Errors

On 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 Instructions

All 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 Instructions

The 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 Microprocessors

With the introduction of the 68040 and 68LC040 chips, things got a bit more complicated. The 68040 microprocessor has most of the 68882 FPU included on the chip. Not everything in the 68881/68882 FPU is in the 68040 chip, however -- just the routines that Motorola determined were most frequently used. The rest of the FPU routines are automatically emulated by software. Because the FPU is "built-in," as it were, the 68040 chip handles instructions that start with an operation word beginning with the hex value F by itself. There is no way to add a coprocessor to a 68040 chip; the instructions are never brought out of the chip itself.

The 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 Macintosh

Power 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:

- a Macintosh with a 68020 or 68030 microprocessor and no FPU coprocessor

- a Macintosh with a 68LC040 microprocessor (which can never have a FPU)

- a Macintosh with a PowerPC chip running 68K code in emulation (since the 68K emulator emulates a 68LC040 microprocessor).

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 Error

A 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:

- an address error

- a bus error

- an illegal instruction error that occurred in native code

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 Errors

The 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 Drivers

One 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 Time

The 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 Space

There 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 Array

In 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 Space

Heavy 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 QuickDraw

Native 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 Drivers

Some 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 Errors

Common 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:

- Indexing through an array incorrectly so that your program goes outside the memory allocated for that array (as demonstrated above)

- Disposing of memory twice

- Disposing of memory that was never allocated

- Calling DisposeHandle on a resource handle (use DisposeResource instead, to ensure that the Resource Manager doesn't lose handles behind its back)

*Troubleshooting Tips

Here are some user-level suggestions recommended by Apple about how to deal with unexplained Type 11 or "No FPU Installed" errors:

- Upgrade your hard disk driver(s) to the latest version available. There are some known problems between SCSI Manager 4.3 and some SCSI disk drivers. Starting with System 7.5, the SCSI Manager 4.3 is installed on all Macintosh Quadras and Power Macintosh computers. There are some known programming problems in some older third-party disk drivers.

- Upgrade to the latest System Software appropriate for your system. Several significant bug fixes in system updates should reduce the number of Type 11 and No FPU Installed errors you encounter.

- Do a clean install of your System Software. Use the Extensions Manager control panel to determine if any additional control panels or extensions are conflicting with your system software.

- Some Type 11 errors may result from corrupted PRAM. Unfortunately, most of extended PRAM is undocumented. (See Inside Macintosh:Operating System Utilities, chapter 7, Parameter RAM Utilities, for what details are documented.) You can restore your default PRAM values by holding down Command-Option-P-R at system startup time, or by using a shareware utility such as TechTool.
Make sure you are not using composite RAM in a Power Macintosh. Memory specifications are in the developer hardware notes for each computer.

- Some users claim that installing the shareware extension SoftwareFPU cuts down on "No FPU Installed" problems. This extension emulates the Motorola FPU (at a considerably slower speed), thus preventing bombs from software which incorrectly makes FPU calls. This may alleviate "No FPU Installed" errors, but it doesn't address the fundamental problem, namely that some software is executing unexpected data or making illegal calls to a non-existent FPU.
Upgrade any software you find that causes repeatable errors.

**Summary

There 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."


Up one level
Back to document index

Original file name: 9602-A propos de l'erreur 11 su

© Mactivity Estonia 1996



Google

Hot: Index Compatibility Description old Macintosh Games
Copyright © 1995-2005 EUREGIO.NET AG - Legal Use - Privacy Policy - Security Info - Advertise - Contact Info
Last modified: 02/12/2008 - URL: http://www.euregio.net/mactivity/0296fr/X0113_9602-A_propos_de_ler.html

Some Websites powered by Euregio.Net:

Green House

Detrooz

Euro Pass

Franz-Jost

Handicap

Agri Expo

Nissan

 

Ford

Moebel

Bodarwe

Marketing

Art

SMIG

Weiterbildung

Bischoff

Chateau-Peltzer

Gangolf

Sonnenhof

Webdesign

Steuerberatung

E-Day

BS St.Vith

EKD Design

Drechslerei

Concept Design

Tourism

Wintergardens

Kirchens

Wirtzfelder Schnee

Hedach

Sutures

House of Beauty

Messerich

Zukunft

Eupen-Info

Leufgen

Promoptica

Autisme

Euregiochambers

ZAWM

ZAWM-St.Vith

Rittersprung

Tilgenkamp

Bauko

Ich Bin Online

BSTI

Treuhand Group


Click here for more interesting topics powered by Euregio.Net:

EasyScopes:

weekly horoscopes

astrology information

web cam movies

daily horoscopes

free horoscopes

free love test quiz

calculate compatibility

new music quiz

song lyrics search