====================================================================== Microsoft Product Support Services Application Note (Text File) WW0524: TROUBLESHOOTING GP FAULTS (UAEs) ====================================================================== Revision Date: 3/92 No Disk Included The following information applies to Microsoft Windows version 3.1. -------------------------------------------------------------------- | INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY | | ACCOMPANY THIS DOCUMENT (collectively referred to as an | | Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY | | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO | | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A | | PARTICULAR PURPOSE. The user assumes the entire risk as to the | | accuracy and the use of this Application Note. This Application | | Note may be copied and distributed subject to the following | | conditions: 1) All text must be copied without modification and | | all pages must be included; 2) If software is included, all files | | on the disk(s) must be copied without modification [the MS-DOS(R) | | utility DISKCOPY is appropriate for this purpose]; 3) All | | components of this Application Note must be distributed together; | | and 4) This Application Note may not be distributed for profit. | | | | Copyright 1992 Microsoft Corporation. All Rights Reserved. | | Microsoft, MS-DOS, and the Microsoft logo are registered | | trademarks and Windows is a trademark of Microsoft Corporation. | -------------------------------------------------------------------- WHAT IS A GENERAL PROTECTION (GP) FAULT? ======================================== A general protection (GP) fault in Windows 3.1 (referred to as an unrecoverable application error [UAE] in Windows 3.0) occurs only in standard and 386 enhanced mode Windows. A GP fault signifies that something unexpected has happened within the Windows environment, usually an improper memory access. In other words, something running within the Windows environment has made a call to a location in memory that it did not have access to, potentially overwriting and corrupting other program code in that area of memory. More specifically, an application or Windows component might read or write to a memory location that it has not been preallocated, or memory that it does not "own." All memory management within Windows is handled by the Windows environment itself, and when applications and Windows components directly access memory, the result is often a GP fault. Another situation where a GP fault may occur involves the passing of parameters between applications and the Windows environment. Invalid parameters affect the performance of Windows and its applications by forcing an invalid instruction. This is usually the result of an application's internal program code incorrectly passing specific data that could not be correctly interpreted for Windows or another Windows application. The result is often a GP fault. What Is A System Integrity Violation? ------------------------------------- The message referring to the violation of system integrity indicates a general protection violation, or the equivalent of a GP fault that is caused by an MS-DOS-based application. Similar to the GP fault, the system integrity violation indicates that an MS-DOS application is accessing memory that does not belong to that specific application. Since Windows is managing memory in this situation, the MS-DOS application's memory access will often corrupt Windows program code or vital data. The result is an application execution error generated from Windows reporting that the "application has violated system integrity due to an invalid general protection fault and will be terminated." This message can also occur when an MS-DOS-based application has tried to directly access a system's hardware component. How Does Windows 3.1 Handle A GP Fault? --------------------------------------- A new feature of Windows 3.1 called parameter validation allows Windows to check for invalid parameters passed between Windows and applications running in the Windows environment. Windows 3.1 is also designed to better manage and maintain which applications "own" specific memory locations and system resources. As a result, Windows 3.1 is more capable of recovering a particular application's RAM memory and system resources. If you do see a GP fault message while running Windows 3.1, the message will provide specific information about which applications and Windows components were running at the time of the error, and where the error occurred. Depending on the severity of the GP fault, Windows 3.1 can continue to run the application that caused the fault, allowing you to save your work before exiting the application. You can also use Dr. Watson, a program provided with Windows 3.1, to learn more about the cause of the GP fault. Local Restart ------------- Depending on the severity of a GP fault in Windows 3.1, you can press CTRL+ALT+DEL to display information concerning the system integrity and/or information concerning the application that caused the fault. The severity of a GP fault can be measured by how well an application functions within the Windows environment after the fault has occurred. If CTRL+ALT+DEL is pressed when a less severe fault occurs, the following message appears on the screen: System has either become busy or has become unstable - Press any key to return to Windows and wait - Press CTRL+ALT+DEL again to restart your computer (all unsaved information will be lost) If CTRL+ALT+DEL is pressed when a more severe fault occurs, this message will appear: This Windows application has stopped responding to the system - Press ESC to cancel and return to Windows - Press ENTER to close this application (all unsaved information will be lost) - Press CTRL+ALT+DEL again to restart your computer (all unsaved information will be lost) Troubleshooting GP Faults ------------------------- 1. If you are running Windows in standard or 386 enhanced mode, check to see if you are running an application that was designed for an earlier version (2.x) of Windows. If an application has not been properly designed to function correctly under Windows protected mode, it will cause an error. If an application is designed for Windows versions 2.0, 2.03, 2.1, and 2.11, the application will generate a dialog box when executed that advises you of this error. Such applications should be run only under Windows 3.0 real mode, as the dialog box suggests. Since real mode is not available in Windows 3.1, contact the application's manufacturer for possible workarounds or to obtain an upgrade of the software. 2. Check for incompatible terminate-and-stay-resident (TSR) programs or unsupported device drivers in your CONFIG.SYS or AUTOEXEC.BAT file. Temporarily comment out all lines relating to suspect drivers and TSR programs to bring the system to a minimum configuration for testing purposes. (To comment out a line, use a text editor such as Notepad, open the AUTOEXEC.BAT or CONFIG.SYS file, and type "rem" (without the quotation marks) at the beginning of the line.) If this eliminates the problem, then the problem was related to one of the drivers or TSR programs that was commented out. Reinstate the removed lines one by one until the problem reappears, thus showing which line was loading the TSR program or driver causing to the error. Minimum MS-DOS configuration for Windows versions 3.0 and 3.1: CONFIG.SYS AUTOEXEC.BAT -------------------------------------------------------------------- files=50 path c:\;c:\dos;c:\windows buffers=30 prompt $p$g device=c:\[path]\himem.sys set temp=c:\ stacks=9,256 (Windows 3.1 only) NOTE: Before modifying these files, make sure you don't comment out lines pertaining to other hardware-specific device drivers, such as Stacker, extended memory boards, third-party disk partitioning programs, and so on. If you do not know the purpose of a line in your CONFIG.SYS or AUTOEXEC.BAT file, leave that line as is. 3. Try different machine switches for the HIMEM.SYS device driver in your CONFIG.SYS file. HIMEM.SYS is used to access the high memory area (HMA), which is the first 64K of extended memory (1024K-1088K). HIMEM.SYS is also the default device driver Windows uses to access extended memory in standard and 386 enhanced modes. HIMEM.SYS accesses the HMA through the A20 line of memory, and uses what are known as A20 "handlers" to do this. The method used to access the HMA depends on the system, so the A20 handler needed for this access varies as well. HIMEM.SYS follows a certain routine at load time to determine which A20 handler is appropriate for your machine. Unfortunately, some nonstandard machines do not respond to the tests that HIMEM.SYS administers during its routine, which can result in the wrong A20 handler being selected. Using the incorrect A20 handler can result in everything from the machine stopping when HIMEM.SYS loads to erratic Windows performance. The /MACHINE switch is used to gain control of the A20 line by forcing HIMEM.SYS to use a particular handler. The handler numbers range from 1-16, and 18. For most 100- percent-compatible machines, one of the compatible /M:1, /M:11, /M:12, and /M:13 A20 handler switches will work. Although other switches are intended for use with certain hardware, one of these other switches may be required for proper operation on certain machines if the standard switches do not work. It is recommended that you check your most current MS-DOS or Windows manual for more information about using the /MACHINE switch with HIMEM.SYS. An example of this statement in the CONFIG.SYS file is as follows: device=c:[\path]\himem.sys /machine:1 -or- device=c:[\path]\himem.sys /m:1 NOTE: When you are testing to see which A20 handler is appropriate, make sure you have a system (startup) MS-DOS disk with an ASCII text editor (such as MS-DOS Edit or Edlin), because some A20 handlers will cause your machine to stop. 4. Check to see if an incorrect machine and/or network was selected while installing Windows. Some machines and networks require you to override the default detection made by Windows Setup and make a specific selection. If the correct selection is not made, Windows will not operate correctly, or a GP fault may occur. Machines that must be specifically selected in Windows Setup include the following: Windows Machine 3.0 3.1 --------------------------------------------------- AST: all 80386- and 80486-based machines X X AT&T PC X AT&T NSX 20: Safari Notebook X Everex Step 386/25 (or compatible) X X Hewlett-Packard: all machines X X IBM PS/2 Model 70P X IBM PS/2 Model L40sx X Intel 386SL-based system with APM X MS-DOS system with APM X NCR: all 80386- and 80486-based machines X NCR PC386sx X X NCR PC 925 X NEC PowerMate SX Plus X X NEC ProSpeed 386 X X Toshiba 1200XE X Toshiba 1600 X X Toshiba 5200 X X Zenith: all 80386-based machines X X Networks that must be specifically selected in Windows Setup include the following: Windows Network 3.0 3.1 -------------------------------------------------------------- 3Com 3+Open LAN Manager (XNS only) X 3Com 3+Open X 3Com 3+Share X X Artisoft LANtastic X Banyan VINES 4.0 X X DEC Pathworks X IBM OS/2 Lan Server X IBM PC LAN Program X X LAN Manager versions 1.x (or 100-percent compatible) X X LAN Manager 2.0 (or 100-percent compatible) X X LAN Manager 2.1 (or 100-percent compatible) X Novell NetWare X TCS 10NET X If you did not choose your machine or network specifically during Setup, you should exit Windows and run the MS-DOS version of Setup from the WINDOWS directory. This will allow you to make the proper selection without having to completely reinstall Windows. 5. A third-party Windows device driver may not be functioning properly. Run the MS-DOS version of the Windows Setup program and select the lowest level configuration of drivers for the listed hardware devices. A good troubleshooting technique is to configure Windows through Setup for the minimum necessary hardware devices. When troubleshooting GP faults, only standard Windows device drivers are recommended. For example: Display: EGA or VGA, depending on video type (systems with VGA cards/monitors can usually use EGA) Mouse: No mouse or other pointing device Network: No network installed 6. Check for unsupported third-party drivers in the Windows SYSTEM.INI or WIN.INI files. Temporarily comment out all lines relating to suspect third-party drivers to bring Windows to a minimum configuration for testing purposes. (To comment out a line, use a text editor such as Notepad, open the SYSTEM.INI or WIN.INI file, and type "rem" (without the quotation marks) at the beginning of the line.) If this eliminates the problem, then the problem was most likely caused by one of the drivers that was removed. Replace the removed lines one by one until the problem reappears, thus showing which line was causing the problem. The installation of certain applications may modify these two files to enhance the overall functionality of Windows or provide additional features to the Windows environment. The statements below are the most commonly altered by third-party software manufacturers. As a result, verify the minimum default Windows configuration. Check the following statements to verify the default Windows configuration of the most commonly altered statements: SYSTEM.INI WIN.INI --------------------------------------------------- [boot] [windows] shell=progman.exe load= system.drv=system.drv run= keyboard.drv=keyboard.drv mouse.drv=mouse.drv display.drv=vga.drv 7. Your system may have a page-mapping conflict in 386 enhanced mode. Page-mapping conflicts occur only in 386 enhanced mode Windows, most frequently in Windows 3.0. Windows 3.0 often will not see the page frame or upper memory block mapping performed by 386 expanded memory managers (EMMs) and will map over those memory locations. Windows 3.1 inherits the upper memory area (UMA) mapping information from the EMM, so it will not map over memory locations used by the EMM. However, both Windows 3.0 and 3.1 can experience page-mapping conflicts with other devices or applications that use the UMA. Test the problem under standard mode by running Windows with the /s switch from the command prompt (type "win /s" [without the quotation marks]). If the problem does not occur in standard mode, it may be a page- mapping conflict in the adapter segment area of memory (between 640K and 1 MB). Edit the SYSTEM.INI file with Notepad or SysEdit and insert the following line in the [386Enh] section: EMMExclude=A000-EFFF (This line is not case sensitive.) NOTE: Because Windows 3.1 inherits its mapping information from any EMM loaded before Windows, it is important to either disable the EMM or exclude the same memory range (as shown above) with the EMM itself. Mapping information inherited from the EMM will override any entries in the SYSTEM.INI file. Performing the step described above will exclude the entire adapter segment from mapping. If making this change solves the problem, you may want to determine the position of all hardware adapters in the adapter segment and exclude them specifically, rather than excluding the entire region. Multiple EMMExclude lines can be used if necessary. If you are using a Micro Channel Architecture (MCA) bus machine such as an IBM PS/2, you can determine the adapter location by restarting with the machine's reference disk. If you are using an Industry Standard Architecture (ISA) bus machine, consult your adapter documentation and/or your manufacturer's technical support service for information on the memory locations the bus machine uses. You will not want to leave the entire range excluded, because Windows will not be able to use any of the memory addresses in that range to set up such things as expanded memory for MS-DOS applications. WINDOWS 3.1 ONLY: Use the command "win /3 /d:x" (without the quotation marks) to load Windows from the command prompt. The /d:x switch excludes the memory range A000-EFFF from mapping, similar to the statement EMMExclude=A000-EFFF in the [386Enh] section of the SYSTEM.INI file. However, as with the EMMExclude= statement, this switch will be overridden by any settings inherited from an external EMM. It is best to disable such EMMs if possible. 8. Check the MS-DOS version you are running. A machine should have the proper MS-DOS version for its hardware type. Original equipment manufacturer (OEM) versions of MS-DOS such as COMPAQ MS-DOS or IBM PC-DOS should be used only on their respective OEM hardware platforms (that is, COMPAQ MS-DOS only on Compaq machines, IBM PC-DOS only on IBM machines). 9. If you have a permanent swap file set up in Windows, it may be corrupted. The integrity of a permanent swap file is important if these errors continue. If the location of the swap file contains bad sectors, an error can occur. Windows will assume the data area of the swap file is valid. However, if code is swapped to a corrupt area, the data will also be corrupted. Change the swap file to a temporary swap file and restart the machine after first turning the computer completely off. It may also be necessary to run a disk optimization/defragmentation utility to improve the performance of the Windows swap file. 10. Reinstall the software causing the GP fault. If the GP fault can be tracked to a specific application, you may need to reinstall that software. The files on disk may have become corrupted or damaged or the application may not be properly installed. You may also have to reinstall Windows. If the SYSTEM.INI or WIN.INI file has been modified with poor results, a new installation of Windows will ensure a clean, unaltered Windows configuration. If all the above troubleshooting techniques have been exhausted and the GP faults or UAEs still occur, you may have to contact your hardware/software supplier for more information.