Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
prog:windbg [2020/01/30 15:36] – mhtml -> html root | prog:windbg [2021/05/24 15:36] (Version actuelle) – [Activer les dump Windows pour les programmes] : ajout de "DumpFolder" root |
---|
====Comment lire les minidump==== | Le logiciel permet de lire les dump de mémoire Windows (.dmp). Visual Studio n'arrive pas à lire ce format. |
| |
| ====Installation==== |
| |
| Cela se faire depuis [[https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk|Windows SDK]] et sélectionner ''Debugging Tools for Windows''. [[https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/|Debugging Tools for Windows (WinDbg, KD, CDB, NTSD)]] {{ :prog:windbg:debugging_tools_for_windows_windbg_kd_cdb_ntsd_-_windows_drivers_microsoft_docs_2020-04-28_11_19_32_pm_.html |Archive du 22/02/2017 le 28/04/2020}} |
| |
| {{:windows:dump:windows_software_development_kit_windows_10.0.18362.1.png|}} |
| |
| Si un dossier de symbole est à déclarer, la syntaxe est la suivante : |
| |
| srv*c:\SymbolsSrvCache*https://msdl.microsoft.com/download/symbols |
| srv*c:\SymbolsSrvCache*https://referencesource.microsoft.com/symbols |
| |
| [[https://lecrabeinfo.net/guide-ultime-pour-resoudre-erreurs-probleme-ecran-bleu-bsod-sur-windows.html|Le guide ULTIME pour résoudre les erreurs d’écran bleu (BSOD) sur Windows]] {{ :prog:windbg:le_guide_ultime_pour_resoudre_les_erreurs_d_ecran_bleu_bsod_sur_windows_le_crabe_info_2020-01-30_3_19_56_pm_.html |Archive du 06/03/2019 le 30/01/2020}} |
| |
| ====Activer les dump Windows pour les BSOD==== |
Il faut déjà commencer par activer les dumps mémoires. Aller dans ''Paramètres système avancés'' puis ''Démarrage et récupération'' et choisir ''Image mémoire complète''. | Il faut déjà commencer par activer les dumps mémoires. Aller dans ''Paramètres système avancés'' puis ''Démarrage et récupération'' et choisir ''Image mémoire complète''. |
| |
Pour lire le minidump : [[https://support.microsoft.com/en-us/help/315263/how-to-read-the-small-memory-dump-file-that-is-created-by-windows-if-a|How to read the small memory dump file that is created by Windows if a crash occurs]], {{ :prog:windbg:how_to_read_the_small_memory_dump_file_that_is_created_by_windows_if_a_crash_occurs.mhtml |Archive du 18/12/2019 le 30/01/2020}} | {{:prog:windbg:activedumpbsod1.png|}} |
| |
| {{:prog:windbg:activedumpbsod2.png|}} |
| |
| {{:prog:windbg:activedumpbsod3.png|}} |
| |
| ====Activer les dump Windows pour les programmes==== |
| |
| Tout se fait dans la base de registre. |
| |
| Créer la clé ''HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps'' |
| |
| Ajouter les champs ci-dessous pour faire un dump de tous les process : |
| |
| ^Nom^Type^ |
| |''DumpCount''|''DWORD''| |
| |''DumpType''|2 (Full dump)| |
| |''DumpFolder'' |''Folder''. Par défaut ''%LOCALAPPDATA%\CrashDumps''| |
| |
| Pour n'activer les dump que pour un process précis, ajouter les mêmes champs dans ''HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\PROCESS.EXE'' |
| |
| [[https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps|Collecting User-Mode Dumps]] {{ :windows:dump:collecting_user-mode_dumps_-_windows_applications_microsoft_docs_2019-10-16_11_36_13_.html |Archive du 31/05/2018 le 16/10/2019}} |
| |
| ====Comment lire les minidump==== |
| |
Installer WinDbg : Cela se faire depuis [[https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk|Windows SDK]] et sélectionner ''Debugging Tools for Windows''. [[https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/|Debugging Tools for Windows (WinDbg, KD, CDB, NTSD)]] {{ :prog:windbg:debugging_tools_for_windows_windbg_kd_cdb_ntsd_-_windows_drivers_microsoft_docs.mhtml |Archive du 22/02/2017 le 30/01/2020}} | Pour lire le minidump : [[https://support.microsoft.com/en-us/help/315263/how-to-read-the-small-memory-dump-file-that-is-created-by-windows-if-a|How to read the small memory dump file that is created by Windows if a crash occurs]] {{ :prog:windbg:how_to_read_the_small_memory_dump_file_that_is_created_by_windows_if_a_crash_occurs_2020-04-28_11_19_39_pm_.html |Archive du 18/12/2019 le 28/04/2020}} |
| |
Exécuter WinDgb : | Exécuter WinDgb : |
ffffef04`64fc79c0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : nt!KeSynchronizeExecution+0x5ad0 | ffffef04`64fc79c0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : nt!KeSynchronizeExecution+0x5ad0 |
</code> | </code> |
| |
| ====Cas du <Unloaded_xxxxxxxx.dll>+0x12345==== |
| |
| Ouvrir WinDbg. Cliquer sur ''!analyze -v''. |
| |
| Lancer la commande ''lm''. |
| |
| Unloaded modules: |
| 00007ffb`33920000 00007ffb`33943000 VCOMP120.DLL |
| |
| Si dans la pile, on constate d'une dll est dans la zone ''Unloaded modules:'', il faut forcer son chargement. |
| |
| Taper les commandes : |
| |
| ? 00007ffb`33943000 - 00007ffb`33920000 |
| Evaluate expression: 143360 = 00000000`00023000 |
| |
| .reload vcomp120.dll=00007ffb`33920000,00000000`00023000 |
| |
| Ainsi, les symboles arrivent à se charger : |
| |
| VCOMP120 + 0x411e |
| |
| devient : |
| vcomp120!_vcomp::PartialBarrierN::Block + 0x3a |
| |
| |
| [[https://blogs.msdn.microsoft.com/jankrivanek/2012/12/11/crash-in-unloaded_mydll-dll-how-to-find-out-who-called-unloaded-dll/|Crash in Unloaded_mydll.dll – how to find out who called unloaded dll]] {{ :windows:dump:crash_in_unloaded_mydll.dll_how_to_find_out_who_called_unloaded_dll._jan_krivanek_2019-10-16_11_39_08_.html |Archive du 11/12/2012 le 16/10/2019}} |