- Исправить ошибку SYSTEM_SERVICE_EXCEPTION в Windows 10
- Как исправить ошибку SYSTEM SERVICE EXCEPTION
- 1. Обновите Windows 10
- 2. Обновление системных драйверов
- 3. Запустите CHKDSK и SFC-DISM
- 5. Установите официальное исправление для Windows от Microsoft
- 6. Сброс Windows в исходное состояние
- Structured Exception Handling
- Handling Exceptions
- /EH (Exception handling model)
- Syntax
- Arguments
- Remarks
- Default exception handling behavior
- Standard C++ exception handling
- Structured and standard C++ exception handling
- Exception handling under /clr
- Runtime exception checks
- Set the option in Visual Studio or programmatically
- To set this compiler option in the Visual Studio development environment
Исправить ошибку SYSTEM_SERVICE_EXCEPTION в Windows 10
Синий экран смерти (BSOD) не так редко появляется, но это происходит. Одно огромное улучшение заключается в том, что BSOD теперь отображает полезную информацию о сбое системы. Ошибка SYSTEM_SERVICE_EXCEPTION происходит по нескольким причинам: ошибки графического интерфейса пользователя, поврежденные системные файлы и проблемы с устаревшими или поврежденными драйверами. Основное направление наших действий — обновление драйверов и проверка файловой системы Windows 10 на наличие ошибок. В этой статье давайте рассмотрим, как исправить ошибку SYSTEM_SERVICE_EXCEPTION в Windows 10 с кодом остановки 0x0000003B. Следуйте по порядку ниже пунктам, пока ошибка не исчезнет.
Как исправить ошибку SYSTEM SERVICE EXCEPTION
1. Обновите Windows 10
Первое, что нужно сделать, это проверить, что Windows 10 полностью обновлена. Устаревшие системные файлы могут вызывать непредвиденные ошибки. Проверка обновления — это быстрый и простой способ выяснить, является ли это причиной.
- Нажмите сочетание кнопок Win+I, чтобы открыть панель «Параметры».
- Перейдите к разделу «Обновление и безопасность«.
- Затем в разделе «Центр обновления Windows» проверьте все ожидающие обновления.
2. Обновление системных драйверов
Центр обновления Windows обновляет системные драйверы. Обычно при проверки обновлений, система Windows, автоматически загружает последние версии драйверов для ваших устройств.
- Нажмите Win+R и введите в диалоговое окно devmgmt.msc, чтобы попасть в «Диспетчер устройств».
- В списке, если есть желтый восклицательный знак, то Вам требуется обновить этот драйвер устройства нажав на нем правой кнопкой мыши, и выбрав «Обновить драйвер».
Примечание: В противном случае Вы можете поискать в Интернете программу для обновления всех драйверов сразу. Думаю Driver Booster справится с этим решением.
3. Запустите CHKDSK и SFC-DISM
Воспользуемся двумя инструментами: CHKDSK для проверки и восстановления жесткого диска, и SFC для восстановления системных файлов. Делайте приведенные ниже пункты по порядку. Первое, что Вам нужно сделать — это запустить командную строку от имени администратора и ввести ниже команды по порядку.
- Введите команду chkdsk /r. Это запустит инструмент CHKDSK и проверит ваш жестки диск на ошибки.
- Затем введите DISM /ONLINE /CLEANUP-IMAGE /RESTOREHEALTH. Проверяет целостность файловой системы методом сравнения файлов с базой microsoft.
- Введите sfc /scannow. Проверяет и пытается восстановить системные файлы.
Примечание: Более детально вы можете ознакомиться с этими инструментами на сайте. Читайте, как восстановить жестки диск CHKDSK и проверить системные файлы SFC .
5. Установите официальное исправление для Windows от Microsoft
Существует официальное исправление Windows для ошибки SYSTEM_SERVICE_EXCEPTION. Однако исправление относится к коду остановки 0x0000003B.
- Перейдите на сайт Microsoft и нажмите на «Пакет исправлений доступен для скачивания» (Hotfix Download Available).
6. Сброс Windows в исходное состояние
Если ничего не работает, вы можете использовать функцию сброса Windows 10 для обновления системных файлов. Сброс Windows 10 заменяет ваши системные файлы совершенно новым набором файлов и теоретически решает проблему, связанную с вашей ошибкой SYSTEM_SERVICE_EXCEPTION.
- Откройте «Параметры» > «Обновление и безопасность» > «Восстановление» и в графе «Вернуть комп в исходное состояние», выберите Начать.
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.
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.
/EH (Exception handling model)
Specifies the exception handling model support generated by the compiler. Arguments specify whether to apply catch(. ) syntax to both structured and standard C++ exceptions, whether extern «C» code is assumed to throw exceptions, and whether to optimize away certain noexcept checks.
Syntax
/EHa [ — ]
/EHs [ — ]
/EHc [ — ]
/EHr [ — ]
Arguments
a
Enables standard C++ stack unwinding. Catches both structured (asynchronous) and standard C++ (synchronous) exceptions when you use catch(. ) syntax. /EHa overrides both /EHs and /EHc arguments.
s
Enables standard C++ stack unwinding. Catches only standard C++ exceptions when you use catch(. ) syntax. Unless /EHc is also specified, the compiler assumes that functions declared as extern «C» may throw a C++ exception.
c
When used with /EHs , the compiler assumes that functions declared as extern «C» never throw a C++ exception. It has no effect when used with /EHa (that is, /EHca is equivalent to /EHa ). /EHc is ignored if /EHs or /EHa aren’t specified.
r
Tells the compiler to always generate runtime termination checks for all noexcept functions. By default, runtime checks for noexcept may be optimized away if the compiler determines the function calls only non-throwing functions. This option gives strict C++ conformance at the cost of some extra code. /EHr is ignored if /EHs or /EHa aren’t specified.
—
Clears the previous option argument. For example, /EHsc- is interpreted as /EHs /EHc- , and is equivalent to /EHs .
/EH arguments may be specified separately or combined, in any order. If more than one instance of the same argument is specified, the last one overrides any earlier ones. For example, /EHr- /EHc /EHs is the same as /EHscr- , and /EHscr- /EHr has the same effect as /EHscr .
Remarks
Default exception handling behavior
The compiler always generates code that supports asynchronous structured exception handling (SEH). By default (that is, if no /EHsc , /EHs , or /EHa option is specified), the compiler supports SEH handlers in the native C++ catch(. ) clause. However, it also generates code that only partially supports C++ exceptions. The default exception unwinding code doesn’t destroy automatic C++ objects outside of try blocks that go out of scope because of an exception. Resource leaks and undefined behavior may result when a C++ exception is thrown.
Standard C++ exception handling
Full compiler support for the Standard C++ exception handling model that safely unwinds stack objects requires /EHsc (recommended), /EHs , or /EHa .
If you use /EHs or /EHsc , then your catch(. ) clauses don’t catch asynchronous structured exceptions. Any access violations and managed System.Exception exceptions go uncaught. And, objects in scope when an asynchronous exception occurs aren’t destroyed, even if the code handles the asynchronous exception. This behavior is an argument for leaving structured exceptions unhandled. Instead, consider these exceptions fatal.
When you use /EHs or /EHsc , the compiler assumes that exceptions can only occur at a throw statement or at a function call. This assumption allows the compiler to eliminate code for tracking the lifetime of many unwindable objects, which can significantly reduce code size. If you use /EHa , your executable image may be larger and slower, because the compiler doesn’t optimize try blocks as aggressively. It also leaves in exception filters that automatically clean up local objects, even if the compiler doesn’t see any code that can throw a C++ exception.
Structured and standard C++ exception handling
The /EHa compiler option enables safe stack unwinding for both asynchronous exceptions and C++ exceptions. It supports handling of both standard C++ and structured exceptions by using the native C++ catch(. ) clause. To implement SEH without specifying /EHa , you may use the __try , __except , and __finally syntax. For more information, see Structured exception handling.
Specifying /EHa and trying to handle all exceptions by using catch(. ) can be dangerous. In most cases, asynchronous exceptions are unrecoverable and should be considered fatal. Catching them and proceeding can cause process corruption and lead to bugs that are hard to find and fix.
Even though Windows and Visual C++ support SEH, we strongly recommend that you use ISO-standard C++ exception handling ( /EHsc or /EHs ). It makes your code more portable and flexible. There may still be times you have to use SEH in legacy code or for particular kinds of programs. It’s required in code compiled to support the common language runtime ( /clr ), for example. For more information, see Structured exception handling.
We recommend that you never link object files compiled using /EHa to ones compiled using /EHs or /EHsc in the same executable module. If you have to handle an asynchronous exception by using /EHa anywhere in your module, use /EHa to compile all the code in the module. You can use structured exception handling syntax in the same module as code that’s compiled by using /EHs . However, you can’t mix the SEH syntax with C++ try , throw , and catch in the same function.
Use /EHa if you want to catch an exception that’s raised by something other than a throw . This example generates and catches a structured exception:
Exception handling under /clr
The /clr option implies /EHa (that is, /clr /EHa is redundant). The compiler generates an error if /EHs or /EHsc is used after /clr . Optimizations don’t affect this behavior. When an exception is caught, the compiler invokes the class destructors for any objects that are in the same scope as the exception. If an exception isn’t caught, those destructors aren’t run.
For information about exception handling restrictions under /clr , see _set_se_translator.
Runtime exception checks
The /EHr option forces runtime termination checks in all functions that have a noexcept attribute. By default, runtime checks may be optimized away if the compiler back-end determines that a function only calls non-throwing functions. Non-throwing functions are any functions that have an attribute that specifies no exceptions may be thrown. They include functions marked noexcept , throw() , __declspec(nothrow) , and, when /EHc is specified, extern «C» functions. Non-throwing functions also include any that the compiler has determined are non-throwing by inspection. You can explicitly set the default behavior by using /EHr- .
A non-throwing attribute isn’t a guarantee that exceptions can’t be thrown by a function. Unlike the behavior of a noexcept function, the MSVC compiler considers an exception thrown by a function declared using throw() , __declspec(nothrow) , or extern «C» as undefined behavior. Functions that use these three declaration attributes don’t enforce runtime termination checks for exceptions. You can use the /EHr option to help you identify this undefined behavior, by forcing the compiler to generate runtime checks for unhandled exceptions that escape a noexcept function.
Set the option in Visual Studio or programmatically
To set this compiler option in the Visual Studio development environment
Open the project’s Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
Select Configuration Properties > C/C++ > Code Generation.
Modify the Enable C++ Exceptions property.
Or, set Enable C++ Exceptions to No, and then on the Command Line property page, in the Additional Options box, add the compiler option.