Windows kernel exception handling

Structured Exception Handling

An exception is an event that occurs during the execution of a program, and requires the execution of code outside the normal flow of control. There are two kinds of exceptions: hardware exceptions and software exceptions. Hardware exceptions are initiated by the CPU. They can result from the execution of certain instruction sequences, such as division by zero or an attempt to access an invalid memory address. Software exceptions are initiated explicitly by applications or the operating system. For example, the system can detect when an invalid parameter value is specified.

Structured exception handling is a mechanism for handling both hardware and software exceptions. Therefore, your code will handle hardware and software exceptions identically. Structured exception handling enables you to have complete control over the handling of exceptions, provides support for debuggers, and is usable across all programming languages and machines. Vectored exception handling is an extension to structured exception handling.

The system also supports termination handling, which enables you to ensure that whenever a guarded body of code is executed, a specified block of termination code is also executed. The termination code is executed regardless of how the flow of control leaves the guarded body. For example, a termination handler can guarantee that clean-up tasks are performed even if an exception or some other error occurs while the guarded body of code is being executed.

Handling Exceptions

The operating system uses structured exception handling to signal certain kinds of errors. A routine called by a driver can raise an exception that the driver must handle.

The system traps the following general kinds of exceptions:

Hardware-defined faults or traps, such as,

  • Access violations (see below)
  • Data-type misalignments (such as a 16-bit entity aligned on an odd-byte boundary)
  • Illegal and privileged instructions
  • Invalid lock sequences (attempting to execute an invalid sequence of instructions within an interlocked section of code)
  • Integer divides by zero and overflows
  • Floating-point divides by zero, overflows, underflows, and reserved operands
  • Breakpoints and single step execution (to support debuggers)

System software-defined exceptions, such as,

  • Guard-page violations (attempting to load or store data from or to a location within a guard page)
  • Page-read errors (attempting to read a page into memory and encountering a concurrent I/O error)

An access violation is an attempt to perform an operation on a page that is not permitted under the current page protection settings. Access violations occur in the following situations:

An invalid read or write operation, such as writing to a read-only page.

To access memory beyond the limit of the current program’s address space (known as a length violation).

To access a page that is currently resident but dedicated to the use of a system component. For example, user-mode code is not allowed access a page that the kernel is using.

If an operation might cause an exception, the driver should enclose the operation in a try/except block. Accesses of locations in user-mode are typical causes of exceptions. For example, the ProbeForWrite routine checks that the driver can actually write to a user-mode buffer. If it cannot, the routine raises a STATUS_ACCESS_VIOLATION exception. In the following code example, the driver calls ProbeForWrite in a try/except so that it can handle the resulting exception, if one should occur.

Читайте также:  Как открыть системный трей windows 10

Drivers must handle any raised exceptions. An exception that is not handled causes the system to bug check. The driver that causes the exception to be raised must handle it: a lower-level driver cannot rely on a higher-level driver to handle the exception.

Drivers can directly raise an exception, by using the ExRaiseAccessViolation, ExRaiseDatatypeMisalignment, or ExRaiseStatus routines. The driver must handle any exceptions that these routines raise.

The following is a partial list of routines that, at least in certain situations, can raise an exception:

Memory accesses to user-mode buffers can also cause access violations. For more information, see Errors in Referencing User-Space Addresses.

Note that structured exception handling is distinct from C++ exceptions. The kernel does not support C++ exceptions.

For more information about structured exception handling, see the Microsoft Windows SDK, and the Visual Studio documentation.

Windows ошибка kernel

Современные приложения и игры отличаются большим размером и детальной прорисовкой графики. Соответственно, работа с ними требует от ПК особой мощности. Часто пользователи сталкиваются, что во время работы и игрового процесса возникает Windows ошибка kernel – критический сбой в процессе работы. Некоторые компьютеры показывают BlueScreen – синий экран смерти, в некоторых случаях устройство перестает откликаться на любое действие.

Ошибка kernel. Общие сведения о неполадке

Ошибка Kernel-Power имеет кодировку 43. Возникновение такой проблемы означает, что у компьютера выявлено нарушение мощности ядра системы. Она относится к 63й категории, что означает невозможность Windows обрабатывать одновременно большое количество запросов и выполнять сложные операции. Именно это объясняет процесс торможения и подвисания современных компьютерных аркад.
На самом деле, выяснить точные проблемы возникновения Kernel-Power достаточно сложно, даже официальный сайт Майкрософт не предоставляет конкретных данных.

Существует ли лечение?

В случае, когда ПК зависает, отказываясь реагировать на любую команду мыши или клавиатуры, помогает только режим перезагрузки, попасть в который можно только с помощью длительного нажатия и удерживания кнопки питания. Но это не гарантирует дальнейшую бесперебойную работу. Вероятнее всего, что первые несколько минут/часов система проработает без нареканий, а затем повторно появится проблема.
Опытным путем стало понятно, что полная переустановка системы тоже не помогает. Отсюда напрашивается вывод, что проблема находится на уровне взаимодействия системы, ПО, ОЗУ, ПЗУ и жесткого диска. Действительно, прочитав рекомендуемые требования на упаковке диска с игрой, можно обнаружить что требования, предъявляемые к «железу», для того чтобы игра установилась, запустилась и шла ровно и плавно достаточно высокие. Кроме этого, рекомендуется проверить все ли шлейфы подключены к разъемам нет ли заломов, а также стабильность работы блока питания.

Windows ошибка kernel. Настройка Биоса

Одной из причин, вызывающих Kernel-Power является критический перегрев процессора. Это может случиться по двум причинам:

  • Его слишком сильно разогнали
  • Он не предназначен для сильных нагрузок
  • Высохла термопаста
  • Плохая система отвода тепла

Первое действие, которое нужно выполнить в таком случае, это проверить исходные данные ЦП и снизить все завышенные показатели, непосредственно связанные с разгоном. Так как для большинства обычных пользователей такие манипуляции выполнить достаточно трудно, в этом случае рекомендуется просто сделать откат до базовых заводских настроек.
Если вы используете не ноутбук, а простой компьютер, то можно достать материнскую плату и на некоторое непродолжительное время вынуть батарейку. Можно попробовать перевести Clear CMOS из положения «1-2» в положение «2-3» меньше чем на минуту, а затем вернуть его в исходное положение. Это тоже приведет к полному сбросу. Правда, этот способ тоже не гарантирует решения проблемы.

Тестирование центрального процессора

При повторном обнаружении Kernel-Power стоит провести тестирование центрального процессора ПК. Для этого скачивается и распаковывается специальная программа Everest. С ее помощью можно выяснить какие компоненты дали сбой. Правда, сделать восстановление через утилиту невозможно. Оптимально провести тестирование при помощи Prime95. Выбираете Just Stress Testing в опциях раздела Torture Test.

Читайте также:  Gopro quick desktop для windows 10

Windows ошибка kernel — Оперативная память

Сбой работы Kernel-Power может быть связан с ошибками в работе оперативной памяти. Проверить память можно несколькими способами. Первый – при помощи стандартной системной программы, введя в командную строку «mdsched»,и запустив перезагрузку системы с ее тестированием. Выполнить это можно только при условии, что вы зашли через учетную запись Администратора.
В случае, если проверка не выявила никаких неполадок можно прибегнуть к физическому способу – поочередно извлекать из своих слотов планки оперативной памяти каждый раз выполняя перезагрузку ПК. Если после определенного извлечения компьютер работает нестабильно, значит проблема кроется в ней, и стоить заменить ее на идентичную.

Проблема с жестким диском

Еще одна распространенная проблема заключается в том, что многие жесткие диски плохо стыкуются в 64-х битной операционной системой. Чаще всего этим страдают винчестеры бренда Seagate, установленные в большинстве современных бюджетных ноутбуков.
Для проверки необходимо скачать и установить HDD Life или HDD Health, запустить соответствующую проверку. В редких случаях может потребоваться обновление прошивки жесткого диска до последней версии. Если неполадки заключаются в винчестере, решения может быть два – замена жесткого диска или ремонт в соответствующих сервисных центрах. Правда, он не дает гарантий, что через некоторое время вам не потребуется приобретать новый жесткий диск.
Можно попробовать самостоятельно восстановить битые кластеры жесткого диска при помощи пакета утилит HDD Regenerator, но и она не гарантирует восстановление жесткого диска в его первоначальное состояние.

Проблема звуковых и видеокарт

Такая проблема зачастую возникает в случае, если на ПК были установлены две звуковые или видеокарты. Установленные программы пытаются работать с обеими, что приводит к сильнейшим сбоям на программном уровне. Для решения данной проблемы следует удалить один из чипов или правильно настроить параллельную работу двух карт.

Драйвера сетевой карты

Появление ошибки Kernel-Power может быть спровоцировано не обновлёнными вовремя драйверами сетевой карты или неправильная их распаковка и установка. В этом случае можно попробовать сделать следующее:

Зайти на официальный сайт разработчика и скачать последнюю версию, после чего провести установку,
Если версия относится к последним, полностью удалить драйвера, после чего переустановить их и перезапустить ПК.

Обновление системы

Для того, чтобы постараться избежать появления многих системных ошибок, рекомендуется разрешить Windows обновлять элементы самостоятельно в автоматическом режиме. Проблемы, связанные с «железом», это не решит, а вот системных избежать удастся.
Зайдите в Центр обновления Windows, поставьте галочку напротив нужного режима. В этом случае, предпочтение стоит отдать полной автоматизации, чтобы избежать ручных действий.

Kernel-Power представляет собой серьезную и непростую ошибку, конкретные причины которой установить пока не удалось. Если ни один из вышеперечисленных методов не дал положительного результата, или проблема пропала на короткий промежуток времени, а затем появилась снова, рекомендуется обратиться в сервисную службу.

Bug Check 0x8E: KERNEL_MODE_EXCEPTION_NOT_HANDLED

The KERNEL_MODE_EXCEPTION_NOT_HANDLED bug check has a value of 0x0000008E. This bug check indicates that a kernel-mode application generated an exception that the error handler did not catch.

This topic is for programmers. If you are a customer who has received a blue screen error code while using your computer, see Troubleshoot blue screen errors.

KERNEL_MODE_EXCEPTION_NOT_HANDLED Parameters

The exception code that was not handled

The address where the exception occurred

Cause

The KERNEL_MODE_EXCEPTION_NOT_HANDLED bug check is a very common bug check. To interpret it, you must identify which exception was generated.

Common exception codes include the following:

0x80000002: STATUS_DATATYPE_MISALIGNMENT indicates that an unaligned data reference was encountered.

0x80000003: STATUS_BREAKPOINT indicates that a breakpoint or ASSERT was encountered when no kernel debugger was attached to the system.

0xC0000005: STATUS_ACCESS_VIOLATION indicates that a memory access violation occurred.

Читайте также:  Linux bash case example

For a complete list of exception codes, see the Ntstatus.h file that is located in the inc directory of the Microsoft Windows Driver Kit (WDK).

Resolution

The !analyze debug extension displays information about the bug check and can be helpful in determining the root cause. If you are not equipped to debug this problem, you should use some basic troubleshooting techniques:

Make sure you have enough disk space.

If a driver is identified in the bug check message, disable the driver or check with the manufacturer for driver updates.

Try changing video adapters.

Check with your hardware vendor for any BIOS updates.

Disable BIOS memory options such as caching or shadowing.

If you plan to debug this problem, you might find it difficult to obtain a stack trace. Parameter 2 (the exception address) should identify the driver or function that caused this problem.

If exception code 0x80000003 occurs, a hard-coded breakpoint or assertion was hit, but the computer was started with the /NODEBUG switch. This problem should rarely occur. If it occurs repeatedly, make sure that a kernel debugger is connected and that the computer is started with the /DEBUG switch.

If exception code 0x80000002 occurs, the trap frame supplies additional information.

If you do not know the specific cause of the exception, consider the following items:

Hardware incompatibility. Make sure that any new hardware that is installed is compatible with the installed version of Windows.

Faulty device driver or system service. A faulty device driver or system service might be responsible for this error. Hardware issues, such as BIOS incompatibilities, memory conflicts, and IRQ conflicts can also generate this error.

If the bug check message lists a driver by name , disable or remove that driver. Also, disable or remove any drivers or services that were recently added. If the error occurs during the startup sequence and the system partition is formatted with NTFS file system, you might be able to use Safe Mode to rename or delete the faulty driver. If the driver is used as part of the system startup process in Safe Mode, you have to start the computer by using the Recovery Console to access the file.

If the problem is associated with Win32k.sys, the source of the error might be a third-party remote control program. If such software is installed, you can remove the service by starting the system by using the Recovery Console and then deleting the offending system service file.

Check the System Log in Event Viewer for additional error messages that might help identify the device or driver that is causing bug check 0x8E. You can disable memory caching of the BIOS to try to resolve the error. You should also run hardware diagnostics, especially the memory scanner, that the system manufacturer supplies. For more information about these procedures, see the owner’s manual for your computer.

The error that generates this message can occur after the first restart during Windows Setup, or after Setup is finished. A possible cause of the error is lack of disk space for installation and system BIOS incompatibilities. For problems during Windows installation that are associated with lack of disk space, reduce the number of files on the target hard disk drive. Check for and delete any temporary files that you do not have to have, Internet cache files, application backup files, and .chk files that contain saved file fragments from disk scans. You can also use another hard disk drive with more free space for the installation.

Оцените статью