Что такое windows error reporting

Служба Windows Error Reporting (WER) служит для сбора и отправки отладочной информации о падении системных и сторонних приложений в Windows на сервера Microsoft. По задумке Microsoft, эта информация должна анализироваться и при наличии решения, вариант исправления проблемы должен отправляется пользователю через Windows Error Reporting Response. Но по факту мало кто пользуется этим функционалом, хотя Microsoft настойчиво оставляет службу сбора ошибок WER включенной по умолчанию во всех последних версиях Windows. В большинстве случае о службе WER вспоминают, когда каталог C:\ProgramData\Microsoft\Windows\WER\ReportQueue\ начинает занимать много места на системном диске (вплоть до нескольких десятков Гб), даже не смотря на то что на этом каталоге по умолчанию включена NTFS компрессия.

Содержание:

  • Служба Windows Error Reporting
  • Очистка папки WER\ReportQueue в Windows
  • Отключение Window Error Reporting в Windows Server
  • Отключаем сбор и отправки отчетов об ошибках в Windows 10
  • Отключение Windows Error Reporting через GPO

C:\ProgramData\Microsoft\Windows\WER\ReportQueue\

Служба Windows Error Reporting

Служба Windows Error Reporting при появлении ошибки показывает диалоговое окно, предлагающее отправить отчет об ошибке в корпорацию Microsoft. Когда в Windows вы видите сообщение об ошибке
YourApp has stop working
, в это время в служба Windows Error Reporting запускает утилиту WerFault.exe для сбора отладочных данных (могут включать в себя дамп памяти).

Данные пользователя сохраняются в профиль пользователя:

%USERPROFILE%\AppData\Local\Microsoft\Windows\wer

Системные данные – в системный каталог:

%ALLUSERSPROFILE%\Microsoft\Windows\WER\

Служба Windows Error Reporting представляет собой отдельный сервис Windows. Вы можете проверить состояние службы командой PowerShell:

Get-Service WerSvc

Внутри каталога WER\ReportQueue\ содержится множество каталогов, с именами в формате:

  • Critical_6.3.9600.18384_{ID}_00000000_cab_3222bf78
  • Critical_powershell.exe_{ID}_cab_271e13c0
  • Critical_sqlservr.exe__{ID}_cab_b3a19651
  • NonCritical_7.9.9600.18235__{ID}_0bfcb07a
  • AppCrash_cmd.exe_{ID}_bda769bf_37d3b403

Как вы видите, имя каталога содержит степень критичности события и имя конкретного exe файла, который завершился аварийно. Во всех каталогах обязательно имеется файл Report.wer, который содержит описание ошибок и несколько файлов с дополнительной информацией.

Очистка папки WER\ReportQueue в Windows

Как правило, размер каждой папки в WER незначителен, но в некоторых случаях для проблемного процесса генерируется дамп памяти, который занимает довольно много места. На скриншоте ниже видно, что размер файла дампа memory.hdmp составляет около 610 Мб. Парочка таким дампов – и на диске исчезло несколько свободных гигибайт.

файлы Report.wer и memory.hdmp

Чтобы очистить все эти ошибки и журналы штатными средствами, откройте панель управления и перейдите в раздел ControlPanel -> System and Security -> Security and Maintenance -> Maintenance -> View reliability history -> View all problem reports (Control Panel\System and Security\Security and Maintenance\Problem Reports) и нажмите на кнопку Clear all problem reports.

очистка ошибок windows error reporing в windows

Для быстрого освобождения места на диске от файлов отладки, сгенерированных службой WER, содержимое следующих каталогов можно безболезненно очистить вручную.

  • C:\ProgramData\Microsoft\Windows\WER\ReportArchive\
  • C:\ProgramData\Microsoft\Windows\WER\ReportQueue\

Следующие команды PowerShell удалят из каталога каталогов WER все файлы, старше 15 дней:

Get-ChildItem -Path  'C:\ProgramData\Microsoft\Windows\WER\ReportArchive' -Recurse | Where-Object CreationTime -lt (Get-Date).AddDays(-15) | Remove-Item -force -Recurse
Get-ChildItem -Path  'C:\ProgramData\Microsoft\Windows\WER\ReportQueue' -Recurse | Where-Object CreationTime -lt (Get-Date).AddDays(-15) | Remove-Item -force –Recurse

Для очистки каталогов WER в пользовательских профилях используйте такой скрипт:

$users = Get-ChildItem c:\users|where{$_.name -notmatch 'Public|default'}
foreach ($user in $users){
Get-ChildItem "C:\Users\$User\AppData\Local\Microsoft\Windows\WER\ " –Recurse -ErrorAction SilentlyContinue | Remove-Item –force –Recurse
}

Отключение Window Error Reporting в Windows Server

В Windows Server 2019/2016/2012R2 вы можете управлять состоянием WER с помощью PowerShell. Вы можете отключить службу Windows Error Reporting:

Get-Service WerSvc| stop-service –passthru -force
Set-Service WerSvc –startuptype manual –passthru

Но есть более корректные способы отключения WER в Windows. В версии PowerShell 4.0 добавлен отдельный модуль WindowsErrorReporting из трех командлетов:

Get-Command -Module WindowsErrorReporting

PowerShell модуль WindowsErrorReporting

Проверить состояние службы Windows Error Reporting можно командой:

Get-WindowsErrorReporting

Для отключения WER, выполните:

Disable-WindowsErrorReporting

Disable-WindowsErrorReporting -отключитьWER с помощью PowerShell

В Windows Server 2012 R2 можно отключить запись информации об ошибках Windows Error Reporting через панель управления (Control Panel -> System and Security -> Action Center -> раздел Maintenance -> Settings -> выберите опцию I don’t want to participate, and don’t ask me again

Отключение сбора ошибок службой WER в Windows Server 2012 / R2

Отключаем сбор и отправки отчетов об ошибках в Windows 10

В Windows 10 нельзя отключить Error Reporting через панель управления. В графическогм интерфейсе можно только проверить ее статус (Система и безопасность ->Центр безопасности и обслуживания -> секция Обслуживание). Как вы видите, по умолчанию параметр Поиск решения для указанных в отчетах проблем включен (Control Panel -> System and Security -> Security and Maintenance -> Maintenance -> Report problems = On).

windows10 сбор ошибок WER

HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting нужно создать новый параметр типа DWORD (32 бита) с именем Disabled и значением 1.

Можно отключить сбор ошибок WER для конкретных пользователей:

reg add "HKCU\Software\Microsoft\Windows\Windows Error Reporting" /v "Disabled" /t REG_DWORD /d "1" /f

Или отключить WER для всех:
reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting" /v "Disabled" /t REG_DWORD /d "1" /f

отключить windows error reporting через системный реестр

Измените параметр реестра и проверьте статус параметра Поиск решения для указанных в отчетах проблем в панели управления. Его статус должен изменится на Отключено.

в windows отключен сбор ошибок и отправка в microsoft

Отключение Windows Error Reporting через GPO

Также вы можете управлять настройками службы Windows Error Reporting через групповые политики.

Запустите редактор локальной (
gpedit.msc
) или доменной GPO (
gpmc.msc
) и перейдите в ветку реестра Computer Configuration -> Administrative Templates -> Windows Components -> Windows Error Reporting (Компоненты Windows -> Отчеты об ошибках Windows). Для отключения сбора и отправки ошибок через WER включите политику Disable Windows Error Reporting (Отключить отчеты об ошибках Windows).

Аналогичная политика есть в пользовательском разделе политик (User Configuration).

gpo отключить windows error reporting

Обновите GPO (перезагрузка не потребуется).

В результате в Windows перестанут формироваться сообщения об ошибках Windows и отправляться в Microsoft.

From Wikipedia, the free encyclopedia

Windows Error Reporting displaying problem details from an issue with Windows Explorer

Windows Error Reporting (WER) (codenamed Watson) is a crash reporting technology introduced by Microsoft with Windows XP[1] and included in later Windows versions and Windows Mobile 5.0 and 6.0. Not to be confused with the Dr. Watson debugging tool which left the memory dump on the user’s local machine, Windows Error Reporting collects and offers to send post-error debug information (a memory dump) using the Internet to Microsoft when an application crashes or stops responding on a user’s desktop. No data is sent without the user’s consent.[2] When a crash dump (or other error signature information) reaches the Microsoft server, it is analyzed, and information about a solution is sent back to the user if available. Solutions are served using Windows Error Reporting Responses. Windows Error Reporting runs as a Windows service.
[3]
Kinshuman Kinshumann is the original architect of WER. WER was also included in the Association for Computing Machinery (ACM) hall of fame for its impact on the computing industry.
[4]
[5]

Microsoft first introduced Windows Error Reporting with Windows XP.[1] It was added during early Beta 1 development in build 2250 as Exception Reporting, and was renamed to Error Reporting in build 2267.

Windows Error Reporting was improved significantly in Windows Vista, when public APIs were introduced for reporting failures other than application crashes and hangs.[6] Using the new APIs, as documented on MSDN, developers can create custom reports and customize the reporting user interface. Windows Error Reporting was also revamped with a focus on reliability and user experience. For example, WER can now report errors even from processes in bad states such as stack exhaustions, PEB/TEB corruptions, and heap corruptions, conditions which in releases prior to Windows Vista would have resulted in silent program termination with no error report. A new Control Panel applet, «Problem Reports and Solutions» was also introduced, keeping a record of system and application errors and issues, as well as presenting probable solutions to problems.

The Problem Reports and Solutions Control Panel applet was replaced by the Maintenance section of the Action Center on Windows 7 and Server 2008 R2.

A new app, Problem Steps Recorder (PSR.exe), is available on all builds of Windows 7 and enables the collection of the actions performed by a user while encountering a crash so that testers and developers can reproduce the situation for analysis and debugging.[7]

WER is a distributed system. Client-side software detects an error condition, generates an error report, labels the bucket, and reports the error to the WER service. The WER
service records the error occurrence and then, depending on information known about the particular error, might request additional data from the client, or direct the client to a
solution. Programmers access the WER service to retrieve data for specific error reports and for statistics-based debugging.

Errors collected by WER clients are sent to the WER service. The WER service employs approximately 60 servers connected to a 65TB storage area network that stores the error report database and a 120TB storage area network that stores up to 6 months of raw CAB files. The service is provisioned to receive and process well over 100 million error reports per day, which is sufficient to survive correlated global events such as Internet worms.[8]

It can also provide the service where it considered the object by the directory server. Information is also stored to collect and associated with the object and resource. Sometimes the directory service the user do not have to remember the physical address of a network resources by providing name and locate the resources.

In the Microsoft Windows Error Reporting (WER) system, crash reports are organized according to «buckets». Buckets classify issues by:[9]

  • Application Name,
  • Application Version,
  • Application Build Date,
  • Module Name,
  • Module Version,
  • Module Build Date,
  • OS Exception Code[10][11]/System Error Code,[12][13]
  • and Module Code Offset.

Ideally, each bucket contains crash reports that are caused by one and only one root cause. However, there are instances where this ideal one-to-one mapping is not the case. First, the heuristics that group failures can result in a single failure’s being attributed to multiple buckets; for instance, each time an application with a failure is recompiled, the application will have a new Module Build Date, and resulting failures will then map to multiple buckets. Second, because only certain information about the failure state is factored into the bucketing algorithm, multiple distinct bugs can be mapped to a single bucket; for instance, if an application calls a single function like strlen with strings corrupted in different ways by different underlying code defects, the failures could map to the same bucket because they appear to be crashes in the same function from the same application, etc. This occurs because the bucket is generated on the Windows OS client without performing any symbol analysis on the memory dump: The module that is picked by the Windows Error Reporting client is the module at the top of the stack. Investigations of many reports result in a faulting module that is different from the original bucket determination.[14]

Third-party software

[edit]

Software & hardware manufacturers may access their error reports using Microsoft’s Windows Dev Center Hardware and Desktop Dashboard (formerly Winqual) program.[15] In order to ensure that error reporting data only goes to the engineers responsible for the product, Microsoft requires that interested vendors obtain a VeriSign Class 3 Digital ID or DigiCert certificate.[16] Digital certificates provided by cheaper providers (such as Thawte, Comodo, GlobalSign, GeoTrust, Cybertrust, Entrust, GoDaddy, QuoVadis, Trustwave, SecureTrust, Wells Fargo) are not accepted.[17][18][19][20][21]

Software and hardware manufacturers can also close the loop with their customers by linking error signatures to Windows Error Reporting Responses. This allows distributing solutions as well as collecting extra information from customers (such as reproducing the steps they took before the crash) and providing them with support links.

Impact on future software

[edit]

Microsoft has reported that data collected from Windows Error Reporting has made a huge difference in the way software is developed internally. For instance, in 2002, Steve Ballmer noted that error reports enabled the Windows team to fix 29% of all Windows XP errors with Windows XP SP1. Over half of all Microsoft Office XP errors were fixed with Office XP SP2.[22] Success is based in part on the 80/20 rule. Error reporting data reveals that there is a small set of bugs that is responsible for the vast majority of the problems users see. Fixing 20% of code defects can eliminate 80% or more of the problems users encounter. An article in the New York Times confirmed that error reporting data had been instrumental in fixing problems seen in the beta releases of Windows Vista and Microsoft Office 2007.[23]

Privacy concerns and use by the NSA

[edit]

Although Microsoft
has made privacy assurances, they acknowledge that personally identifiable information could be contained in the memory and application data compiled in the 100-200 KB «minidumps» that Windows Error Reporting compiles and sends back to Microsoft. They insist that in case personal data is sent to Microsoft, it won’t be used to identify users, according to Microsoft’s privacy policy.[24][25] But in reporting issues to Microsoft, users need to trust Microsoft’s partners as well. About 450 partners have been granted access to the error reporting database to see records related to their device drivers and apps.[26]

Older versions of WER send data without encryption; only WER from Windows 8 uses TLS encryption.[27] In March 2014, Microsoft released an update (KB2929733) for Windows Vista, 7 and Server 2008 that encrypts the first stage of WER.[28]

In December 2013, an independent lab found that WER automatically sends information to Microsoft when a new USB device is plugged to the PC.[27]

According to Der Spiegel, the Microsoft crash reporter has been exploited by NSA’s TAO unit to hack into the computers of Mexico’s Secretariat of Public Security. According to the same source, Microsoft crash reports are automatically harvested in NSA’s XKeyscore database, in order to facilitate such operations.[29]

  • Winqual
  • Dr. Watson (debugger)
  1. ^ a b What are WER Services?
  2. ^ An overview of WER consent settings and corresponding UI behavior
  3. ^ 0x0 0x0 Solution
  4. ^ Debugging in the (Very) Large: Ten Years of Implementation and Experience
  5. ^ WER CACM Award Kinshuman
  6. ^ WER APIs
  7. ^ Windows Error Reporting Problem Steps Recorder
  8. ^ Debugging in the (Very) Large: Ten Years of Implementation and Experience
  9. ^ How WER collects and classifies error reports
  10. ^ «NTSTATUS values». Microsoft. Retrieved 2015-06-08.
  11. ^ «Bug Check Code Reference». Microsoft. Retrieved 2015-06-08.
  12. ^ «System Error Codes (Windows)». Microsoft. Retrieved 2015-06-08.
  13. ^ «HRESULT Values». Microsoft. Retrieved 2015-06-08.
  14. ^ MSDN Blogs > WER Services > The only thing constant is change – Part 1
  15. ^ «SysDev (was Winqual) website». Archived from the original on 2018-08-03. Retrieved 2012-11-07.
  16. ^ Update a code signing certificate
  17. ^ Introducing Windows Error Reporting
  18. ^ WinQual Registration Head Aches
  19. ^ Microsoft Support Forum: WER with Thawte authenticode signed app
  20. ^ The Old New Thing: How can a company get access to Windows Error Reporting data?
  21. ^ The great digital certificate ripoff?
  22. ^ Steve Ballmer’s letter: Connecting to customers
  23. ^ Markoff, John (9 October 2006). «A Challenge for Exterminators (Published 2006)». The New York Times.
  24. ^ «Microsoft Privacy Statement for Error Reporting». Archived from the original on 2012-10-10. Retrieved 2007-10-07.
  25. ^ Description of the end user privacy policy in application error reporting when you are using Office
  26. ^ Bekker, Scott (3 October 2002). «Microsoft Error Reporting Drives Bug Fixing Efforts». Redmond Partner Channel. 1105 Redmond Media Group.
  27. ^ a b «Are Your Windows Error Reports Leaking Data?». Websense Security Labs. 29 Dec 2013. Retrieved 4 January 2014.
  28. ^ «The first stage of the WER protocol is not SSL encrypted in Windows». Microsoft. 11 March 2014. Retrieved 10 January 2015.
  29. ^ Inside TAO: Documents Reveal Top NSA Hacking Unit

***

Что такое Windows Error Reporting 

Когда в возникают проблемы с оборудованием или программами (например, аппаратное или программное перестаёт работать или работает некорректно), Windows создает отчёт о проблеме, который предназначен для отправки в Microsoft (чтобы отыскать решение проблемы).

Начиная с операционной системы , на смену «инструменту анализа сбоев или аварий» Dr. Watson пришла Windows Error Reporting (WER) – Служба регистрации ошибок Windows (другие названия – Отчеты о проблемах и их решениях, Отчеты о проблемах и решения).

Служба регистрации ошибок Windows представлена следующими файлами (все расположены в каталоге \Windows\System32\):

wer.dll (Библиотека сообщений об ошибках Windows);

wercon.exe (Отчеты о проблемах и их решениях);

wercplsupport.dll (Отчеты о проблемах и их решениях);

werdiagcontroller.dll (WER Diagnostic Controller);

WerFault.exe (Отчет об ошибках Windows);

WerFaultSecure.exe (Отчеты об ошибках Windows);

wermgr.exe (Windows Problem Reporting);

wersvc.dll (Служба регистрации ошибок Windows);

wertargets.wtl.

Когда происходит сбой какого-либо процесса (программы), служба Windows Error Reporting запускает – в сеансе ошибочного процесса – свою (WerFault.exe),

передавая идентификатор (PID) процесса в командную строку WerFault:

При этом отображается окно Microsoft Windows с сообщением об ошибке – «Прекращена работа <Название_программы>. При следующем подключении к Интернету Windows может провести поиск способа устранения этой ошибки»:

При нажатии на кнопку Показать подробности проблемы можно ознакомиться с сигнатурой проблемы:

Сигнатуры проблем сохраняются в отчётах об ошибках, которые хранятся в каталоге \Users\Master\AppData\Local\Microsoft\Windows\WER\ReportArchive\, каждый отчет – в отдельной папке Report******** (например, Report0a003e48), в файле Report.wer.

Примерное содержимое файла Report.wer:

Version=1

EventType=APPCRASH

EventTime=129234418886148269

ReportType=2

Consent=1

Response.type=4

Sig[0].Name=Имя приложения

Sig[0].Value=iexplore.exe

Sig[1].Name=Версия приложения

Sig[1].Value=8.0.6001.18928

Sig[2].Name=Штамп времени приложения

Sig[2].Value=4bdfa327

Sig[3].Name=Имя модуля с ошибкой

Sig[3].Value=mshtml.dll

Sig[4].Name=Версия модуля с ошибкой

Sig[4].Value=8.0.6001.18928

Sig[5].Name=Штамп времени модуля с ошибкой

Sig[5].Value=4bdfb76d

Sig[6].Name=Код исключения

Sig[6].Value=c0000005

Sig[7].Name=Смещение исключения

Sig[7].Value=000da33f

DynamicSig[1].Name=Версия ОС

DynamicSig[1].Value=6.0.6002.2.2.0.768.3

DynamicSig[2].Name=Код языка

DynamicSig[2].Value=1049

DynamicSig[22].Name=Дополнительные сведения 1

DynamicSig[22].Value=fd00

DynamicSig[23].Name=Дополнительные сведения 2

DynamicSig[23].Value=ea6f5fe8924aaa756324d57f87834160

DynamicSig[24].Name=Дополнительные сведения 3

DynamicSig[24].Value=fd00

DynamicSig[25].Name=Дополнительные сведения 4

DynamicSig[25].Value=ea6f5fe8924aaa756324d57f87834160

UI[2]=C:\Program Files\Internet Explorer\iexplore.exe

UI[3]=Прекращена работа Internet Explorer

UI[4]=Windows может провести поиск способа устранения этой ошибки в Интернете.

UI[5]=Искать решение проблемы в Интернете и закрыть программу

UI[6]=Проверить наличие способа исправления ошибки в Интернете позднее и закрыть программу

UI[7]=Закрыть программу

FriendlyEventName=Остановка работы

ConsentKey=APPCRASH

AppName=Internet Explorer

AppPath=C:\Program Files\Internet Explorer\iexplore.exe

***

Как запустить службу Отчеты о проблемах и их решениях

Нажмите Пуск –> Панель управления –> Отчеты о проблемах и их решениях;

– в окне Отчеты о проблемах и их решениях в меню Задачи доступны следующие опции:

   · Искать новые решения (необходимо открытое соединение с Интернетом);

   · Показать проверяемые проблемы (прокручиваемый список проблем, для которых требуется найти решение);

   · Показать журнал проблем (проблемы, обнаруженные Windows);

   · Изменить параметры (выбор способа проверки на наличие решений в случае неполадок Автоматически выполнять поиск решений или Запрашивать проверку на возможные проблемы);

   · Очистить журнал проблем и их решений (очистка журнала проблем для освобождения дискового пространства).

***

Честно говоря, автору статьи ни разу не удалось решить проблемы Windows с помощью Службы регистрации ошибок (да и статус вдохновляет на самостоятельный поиск решений таких проблем!). Значимость этой службы мне видится в том, что она помогает самостоятельно.

Сидоров

***

What are Windows error reporting files? Why do you need to delete them periodically on your computer? In this post from MiniTool System Booster, we will offer 4 different ways to delete Windows error reporting files and give you a brief introduction to them.

Introduced in Windows Vista, the Windows Error Reporting feature is designed to collect the debug information about system and third-party app failures, as well as send error reports to Microsoft servers. When an app failure occurs, Windows Error Reporting will display the prompt below that asks you to submit an error report to Microsoft.

Your AppName has stopped working, Windows is collecting more information about the problem.

After that, the server might ask you for more information to provide a proper solution or report it to an official developer for further investigation. Then, your system will generate some files that contain the error reports about the problematic software or hardware will be generated by your system. These files stored in the WEB folder (C:\ProgramData\Microsoft\Windows\WER) are Windows error reporting filesand they might occupy lots of disk space over time.

Therefore, some of you might wonder if it is safe to delete them. The answer is yes. Although there is some crucial information in Windows error reporting files, it’s safe to delete them regularly to spare more available disk space. In this guide, we will introduce you 4 ways to delete Windows error reporting files with detailed instructions.

How to Delete Windows Error Reporting Files on Windows 10/11?

Way 1: via File Explorer

Since here we know the accurate path of Windows error reporting files, the direct way is to remove them manually in File Explorer. Follow these steps:

Step 1. Press Win + E to open File Explorer.

Step 2. Click on View from the menu bar and check Hidden items to make all the hidden files visible.

check Hidden items to show all the hidden files

Step 3. In the navigation bar, copy and paste the following path and hit Enter to locate the WER folder.

C:\ProgramData\Microsoft\Windows\WER

Step 4. Double-click on it and you will see 3 folders. Open each of them and delete all the content inside these folders.

Windows error reporting files on your computer

Step 5. Open Recycle Bin to delete Windows error reporting files permanently.

Way 2: via Disk Cleanup

As its name suggests, Disk Cleanup focuses on removing temporary and unnecessary files including downloaded program files, temporary internet files, files in Recycle Bin, Windows Update log files, and more, so you can also delete Windows error reporting files via this utility. Here’s how to do it:

Step 1. Type disk cleanup in the search bar and hit Enter.

Step 2. Select the drive you want to clean up and hit OK. Since Windows error reporting files are located in your C drive, select C drive in this step.

Step 3. Click on Clean up system files and select your system drive to continue.

Step 4. Tick the box inside System created Windows Error Reporting files and hit OK.

Step 5. Confirm the deletion and wait for its completion.

Way 3: via Storage Sense

Storage Sense is another Windows inbuilt utility can free up disk space on your computer. With it, you can remove unnecessary items like temporary files, apps & features, OneDrive files, and other types of files. Here’s how to delete Windows error reporting files via it:

Step 1. Press Win + I to open Windows Settings and go to System.

Step 2. In the Storage section, scroll down to find Temporary files and hit it.

Step 3. After scanning, it will list all the temporary files for you. Select System created Windows Error Reporting Files and hit Remove files.

delete Windows error reporting files via Storage Sense

Way 4: via MiniTool System Booster

As mentioned in the beginning part, cleaning Windows error reporting files can help release more available disk space so as to enhance the performance of your computer. Here, we recommend another handy tool called MiniTool System Booster for you. Not only can this PC tune-up software delete system queued Windows error reporting files, it can also help to detect and remove other junk files in your system.

Then Windows Cleanup task will sweep up junk files in your system including log files, temporary files, memory dump files, items copied to Clipboard, files in Recycle Bin and so on. Now, get this 15-day free trial to speed up your computer:

MiniTool System Booster TrialClick to Download100%Clean & Safe

Step 1. Launch MiniTool System Booster Trial to enter the main interface.

Step 2. In the right pane, click on Performance Home and select Deepclean from the drop-down menu.

select Deepclean from the drop-down menu in MiniTool System Booster

Step 3. Tap on START CLEAN to start scanning your computer for unnecessary clutters. During the process, 7 cleanup tasks will run one by one. Tick the box beside Windows error reporting files and hit CLEAN SELECTED to delete them.

check the box beside Windows error reporting files

Final Words

How to delete Windows error reporting files? If they take up too much disk space, you can remove them via File Explorer, Disk Cleanup, Storage Sense, or MiniTool System Booster. Personally speaking, I prefer the last method because this tool can deeply clean up your PC, find and repair system files and more to make your computer run faster.

MiniTool System Booster TrialClick to Download100%Clean & Safe

Do you have any suggestions or problems while using our product? Please feel free to contact us via [email protected]. Our support team will reply to you as soon as possible.

Часть 4. Механизм Windows Error Reporting

Механизм Windows Error Reporting

Использование механизма Windows Error Reporting

Заключение

В предыдущей статье данного цикла, посвященной механизму Application Restart and Recovery, мы упомянули механизм Windows Error Reporting (WER). О нем и пойдет речь в настоящей статье данного цикла

В предыдущей статье данного цикла, посвященной механизму Application Restart and Recovery, мы упомянули механизм Windows Error Reporting (WER). О нем и пойдет речь в настоящей статье данного цикла.

Механизм Windows Error Reporting

С помощью механизма Windows Error Reporting (WER) можно собирать данные об ошибках, происходящих в приложениях, и либо отсылать эту информацию на специальный сайт Microsoft (сайт http://winqal.microsoft.com), либо сохранять ее локально. Сбор детальной информации об ошибках и сбоях помогает в устранении недостатков приложений, коррекции ошибок, упрощает выпуск пакетов обновлений и новых версий приложений, обеспечивает общую стабильность и надежность как самих приложений, так и операционной системы.

Отметим, что компания Microsoft сама активно использует механизм Windows Error Reporting как в процессе разработки, так и после выпуска продуктов на рынок. Так, продуктовая группа Microsoft Office исправила 50% ошибок в Office Service Pacl 2, продуктовая группа Visual Studio — 74% ошибок в Beta 1 Visual Studio 2005, 29% ошибок в Windows XP было исправлено в Windows XP Service Pack 1. В настоящее время более 2 тыс. компаний применяют сервисы Windows Error Reporting для улучшения качества своих приложений.

Механизм Windows Error Reporting впервые появился в Windows XP, был существенно расширен в Windows Vista и получил дальнейшее развитие в Windows Server 2008, Vista Service Pack 1 и Windows 7 и Windows Server 2008 R2. Так, на уровне Windows Vista у разработчиков появилась возможность не только получать информацию о сбоях, произошедших в приложениях, но и данные о производительности. Теперь можно более гибко создавать, настраивать и отсылать отчеты о проблемах, улучшились средства онлайнового анализа данных и упростился механизм коммуникаций с пользователями — через механизм Problem Reports and Solutions (в Windows Vista — Start —> Control Panel —> System and Maintenance —> Problem Reports and Solutions —> View Problem History) и Action Center (в Windows 7). Затем в Windows Server 2008 и Vista Service Pack 1 появилась возможность создания локальных дампов, а в Windows 7 и Windows Server 2008 R2 добавлена возможность генерации исключений, которые не будут обрабатываться традиционными обработчиками и будут приводить к немедленному завершению приложения и автоматическому запуску механизма Windows Error Reporting, а также возможность задания внешнего процесса — обработчика исключений, который будет вызываться для получения названия события, параметров отчета об ошибке и опционального запуска отладчика.

Использование механизма Windows Error Reporting

Давайте кратко рассмотрим, как разработчики могут применять механизм Windows Error Reporting для получения информации о сбоях и других проблемах со своими приложениями. Начиная с Windows Vista Windows по умолчанию предоставляет отчет о сбоях, зависаниях и ошибках уровня ядра операционной системы (kernel faults) для всех приложений — внесения изменений в код приложений не требуется. При необходимости отчет включает мини-дамп памяти и дамп «кучи» приложения, приложениям требуется использование программных интерфейсов в тех случаях, когда необходима отсылка какой­то специфической для приложения дополнительной информации. Поскольку ядро Windows автоматически собирает в отчет информацию о необработанных исключениях, приложениям не нужно обрабатывать исключения, приводящие к фатальным ошибкам.

В случае возникновения сбоев, зависаний или ошибок уровня ядра операционной системы механизм Windows Error Reporting выполняет следующую последовательность действий:

  1. Возникновение проблемы.
  2. Ядро операционной системы вызывает WER.
  3. WER собирает данные, создает отчет и, при необходимости, запрашивает от пользователя подтверждение на отсылку отчета.
  4. При получении подтверждения WER отсылает отчет в Microsoft (так называемый Watson Server).
  5. Если серверу требуются дополнительные данные, WER собирает их и, при необходимости, запрашивает от пользователя подтверждение на отсылку.
  6. Если приложение зарегистрировано для перезапуска (эту тему мы обсуждали ранее), то WER выполняет соответствующую косвенно вызываемую функцию приложения.
  7. Если существует решение проблемы, приведшей к сбою, пользователь получает уведомление с помощью соответствующих средств операционной системы.

В зависимости от ситуации в CAB-файле могут присутствовать различные типы дампов, которые можно различать по расширению имени файла (табл. 1).

В приложении могут использоваться перечисленные ниже функции для настройки содержимого отчета, посылаемого в Microsoft, — регистрационная функция указывает Web на необходимость включения в создаваемый отчет указанных файлов и блоков памяти.

Для включения в состав отчета файла применяется функция WerRegisterFile(), которой в качестве параметров передаются: полное имя файла, его тип (одно из значений WER_REGISTER_FILE_TYPE) и два флага: WER_DELETE_FILE_WHEN_DONE, указывающий на то, что файл должен быть удален после отсылки отчета, и WER_ANONYMOUS_ DATA, указывающий на то, что в файле не содержатся приватные данные. Возможные значения параметра WER_REGISTER_FILE_ TYPE приведены в табл. 2.

Отметим, что задача генерации дампа памяти возлагается на разработчика приложения — для ее решения можно применять, например, отладочные механизмы, описанные в Windows SDK (см. функцию MiniDumpWriteDump()).

Для исключения файла из отчета следует использовать функцию WerUnRegisterFile(), указав ей в качестве параметра имя исключаемого файла.

В большинстве сценариев отсылка дополнительных файлов происходит только при получении от сервера соответствующего запроса. В случае отсылки дополнительных файлов необходимо применять флаг WER_ADD_ REGISTERED_DATA при вызове функции WerReportSubmit() — о ней мы расскажем далее.

Для включения в состав отчета копии области памяти применяется функция WerRegisterMemoryBlock(), в качестве параметров которой передаются адрес начала включаемого блока памяти и размер этого блока в байтах (максимальный размер блока памяти — WER_MAX_MEM_BLOCK_SIZE). Для отмены включения копии области памяти в отчет следует применять функцию WerUnRegisterMemoryBlock(). В случае отсылки данных из памяти необходимо использовать флаг WER_ADD_REGISTERED_DATA при вызове функции WerReportSubmit().

Функции WerSetFlags() и WerGetFlags() могут применяться соответственно для управления состоянием процесса в момент генерации отчета об ошибках и получения информации о настройках.

Процесс генерации и отсылки отчета состоит из нескольких шагов. Инициализация отчета выполняется вызовом функции WerReportCreate(), с помощью которой указывается тип события, для которого создается отчет, тип отчета (WerReportNonCritical — для сбоев с возможностью восстановления и WerReportCritical — для сбоев, повлекших аварийное завершение приложения), ссылка на информацию, включаемую в отчет (см. структуру WER_REPORT_INFORMATION), и переменная, которая будет содержать ссылку на созданный отчет, — ReportHandle.

После того как отчет успешно инициализирован, необходимо добавить в него парамет­ры первой и второй групп. Параметры первой группы задаются с помощью функции WerReport-Set-Parameter(), которой передается ссылка на созданный отчет (результат успешного выполнения функции WerReportCreate), набор флагов, имя параметра и его значение (16-битная строка в Unicode, заканчивающаяся нулем).

Для включения в состав отчета дополнительных параметров применяется функция WerReportAddSecondaryParameter(), которой передается ссылка на отчет, имя параметра и его значение.

Помимо возможности включения в состав отчетов файлов и снимков областей памяти, предусмотрена передача в составе отчета и дампов памяти — для этого можно использовать функцию WerReportAddDump(), в качестве параметров которой указываются ссылка на отчет, ссылки на процесс и поток, для которых был создан дамп, тип дампа (одно из значений WER_DUMP_TYPE), информация об исключении (указатель на структуру типа WER_EXCEPTION_INFORMATION), дополнительные опции (тип данных WER_DUMP_CUSTOM_OPTIONS) и флаги. Отметим, что процесс, для которого создается дамп, должен иметь права доступа STANDARD_RIGHTS_READ и PROCESS_QUERY_INFORMATION.

Для включения в состав отчета файлов мы применяем функцию WerReportAddFile(), которой передаем ссылку на отчет, полное имя файла, тип файла (WER_FILE_ TYPE) и дополнительные флаги.

Помимо этого разработчикам предоставляется возможность настройки пользовательского интерфейса — выбора информации, отображаемой в системной диалоговой панели. Для этих целей служит функция WerReportSetUI Option(), которой передается ссылка на отчет, тип интерфейса отчета (WER_REPORT_UI) и значение отображаемой строки. Приложение может модифицировать любое из полей интерфейсного элемента, заданного параметром WER_REPORT_UI; каждый вызов функции позволяет модифицировать только одно поле. Функция WerReportSetUIOption() может вызываться в любой момент работы приложения до непосредственной отсылки отчета.

После того как отчет сформирован и настроен, мы используем функцию WerReportSubmit() для отсылки отчета. В качестве параметров этой функции передаются ссылка на отчет, тип пользовательского интерфейса (наличие прав администратора, подтверждение отсылки и т.п.) и набор флагов. После того как отчет послан, следует закрыть ссылку на него, используя функцию WerReportCloseHandle().

Для отключения приложения от механизма Windows Error Reporting следует использовать функцию WerAddExcludedApplication(), а для повторного подключения — функцию WerRemoveExcludedApplication().

Настройки Windows Error Reporting располагаются в двух ветвях реестра:

  • HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting;
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting.

Наиболее полезные настройки показаны в табл. 3.

Заключение

В данном цикле статей мы обсудили различные вопросы улучшения стабильности работы приложений. Мы рассмотрели технику, позволяющую избежать утечки памяти, предотвратить зависание приложений, обсудили использование механизма Application Restart and Recovery, позволяющего перезапускать приложения, которые либо заблокировали какие­то ресурсы, либо перестали реагировать на сообщения системы, и механизма Windows Error Reporting, который дает возможность собирать данные о сбоях, происходящих в приложениях.

В следующих статьях, посвященных операционной системе Windows 7 для разработчиков, мы рассмотрим ряд изменений на уровне ядра операционной системы, которые могут представлять интерес для разработчиков приложений.

КомпьютерПресс 4’2010

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows operating system compatibility
  • Windows 10 долгий запуск программ
  • Как обновиться до windows 11 с windows 10 в россии
  • Tp link tl wr841nd windows 10
  • Windows startup and shutdown sounds angry