depuración de sistemas en producción
DESCRIPTION
Depuración de Sistemas en Producción. Rene Pally Microsoft Corp. Office Server Team European Development Centre. Why Analyze a Crash?. When Windows Error Reporting has no solution or when it blames “a device driver”. Why Does Windows Crash. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/1.jpg)
DEPURACIÓN DE SISTEMASEN PRODUCCIÓN
Rene PallyMicrosoft Corp.Office Server TeamEuropean Development Centre
![Page 2: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/2.jpg)
WHY ANALYZE A CRASH?• When Windows Error Reporting has no solution or when it blames “a
device driver”
![Page 3: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/3.jpg)
WHY DOES WINDOWS CRASH• A device driver or part of the operating system incurs an
unhandled exception• A device driver or part of the operating system explicitly crashes the
system due to an unrecoverable condition• A page fault occurs at an interrupt request level of dispatch or higher• A hardware condition such as a nonmaskable interrupt or faulty memory,
disk, etc.
![Page 4: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/4.jpg)
CAUSES OF WINDOWS CRASHES
Third-party device drivers
70%
Microsoft code13%
Crash too corrupt for
analysis11%
Hardware errors6%
Percentage of Top 500 Crashes for Windows Vista with Service Pack 11
1.Microsoft Corporation. 2008. Online Crash Analysis research performed inSeptember of 2008.
![Page 5: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/5.jpg)
WHAT HAPPENS DURING A CRASH
• When a condition is detected that requires a crash, the kernel API KeBugCheckEx is called
• KeBugCheckEx accepts a bugcheck code that indicates the reason for the crash and four parameters that supply additional information
KeBugCheckEx( IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4 );
![Page 6: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/6.jpg)
INSIDE OF KEBUGCHECKEX• KeBugCheckEx performs several functions
• Disables interrupts• Notifies other CPUs to halt execution• Notifies registered drivers• Writes crash dump information to disk*
• Restarts the system*
* Only if the system is configured to do so
![Page 7: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/7.jpg)
THE WINDOWS STOP SCREEN1
2
3
4
5
![Page 8: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/8.jpg)
MEMORY DUMP TYPES• Small memory dump
• Records the smallest set of useful information• Kernel memory dump*
• Records only kernel memory, which speeds up the process of writing a crash dump
• Complete memory dump*
• Records the entire contents of system memory
* If either a Kernel or Complete memory dump is selected, the system will also create a minidump and store it in the %SystemRoot%\minidump directory
![Page 9: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/9.jpg)
CRASH REPORTING USER INTERFACE
![Page 10: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/10.jpg)
SEND REPORTING USER INTERFACE
![Page 11: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/11.jpg)
HAVE RESPONSE USER INTERFACE• Responses are URLs• Point to fixes, workarounds, troubleshooters, surveys,
and so on.• Example:
https://oca.microsoft.com/en/Response.asp?SID=32
![Page 12: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/12.jpg)
WER Data FlowWatson/OCA
Back End
Portal Siteshttp://dbgportalhttp://watson
http://winqual.microsoft.com
Hotfix
Repo
rt
Fix
Investigate
Categorize
Known
Issue
![Page 13: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/13.jpg)
WER DATA SHARING PROGRAM
![Page 14: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/14.jpg)
PROBLEMAS EN SISTEMAS DE PRODUCCION
![Page 15: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/15.jpg)
INTRODUCCIÓNProblemas en Producción:
-No existe acceso a Interfaces de Desarrollo.
Los clientes prefieren mantener sus ambientes de producción libres de software innecesario.
![Page 16: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/16.jpg)
INTRODUCCIÓNProblemas en Producción:
-Tiempos de Down System Cortos.
No podemos tomarnos el tiempo de dejar nuestro sistema inoperable para poder analizar los problemas que presenta.
![Page 17: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/17.jpg)
INTRODUCCIÓNProblemas en Producción:
-Problemas irreproducibles en Desarrollo / Test
![Page 18: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/18.jpg)
INTRODUCCIÓNDebugging tools for Windows
-Herramientas por excelencia de los ambientes en Producción.
Ventajas
![Page 19: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/19.jpg)
INTRODUCCIÓNDebugging tools for Windows
-Debug Sistemas en Producción y/o Ambientes de Test :
-Acceso a Breakpoints y Manejo Binario de Minidumps
![Page 20: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/20.jpg)
INTRODUCCIÓNDebugging tools for Windows
-Debug Sistemas en Producción y/o Ambientes de Test :
Permite Acceso completo a características internas de un proceso
![Page 21: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/21.jpg)
INTRODUCCIÓNDebugging tools for Windows
-Debug Sistemas en Producción y/o Ambientes de Test :
-Aplicaciones Manejadas y no Manejadas
![Page 22: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/22.jpg)
INTRODUCCIÓNDebugging tools for Windows
-Debug Sistemas en Producción y/o Ambientes de Test :
-Procesos en Runtime.
![Page 23: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/23.jpg)
INTRODUCCIÓNDebugging tools for Windows
-Debug Sistemas en Producción y/o Ambientes de Test :
-Aplicacion Free.
![Page 24: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/24.jpg)
INTRODUCCIÓNAnálisis de Procesos
-Analisis Online (Runtime)
-Analisis Offline (Memory Dump)
![Page 25: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/25.jpg)
INTRODUCCIÓNAnálisis de Procesos
Memory dump es la imagen de la memoria grabada en disco en determinado momento. Puede ser de un sistema completo o de un proceso.
![Page 26: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/26.jpg)
INTRODUCCIÓNProcedimiento para tomar Dumps de Memoria
ADPLUS.VBS incluido con Windows Debugging Tools
![Page 27: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/27.jpg)
INTRODUCCIÓNProcedimiento para tomar Dumps de Memoria
windows Debugging Tools .dump /mfht
![Page 28: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/28.jpg)
INTRODUCCIÓNProcedimiento para tomar Dumps de Memoria
Su propia aplicación puede crear su propio dump en caso de problemas
![Page 29: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/29.jpg)
INTRODUCCIÓNCrear Memory Dumps Programaticamente
-DbgHelp.dll que es una libreria redistribuible.
![Page 30: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/30.jpg)
INTRODUCCIÓNCrear Memory Dumps Programaticamente
[DllImport("DbgHelp.dll", SetLastError=true)] private static extern bool MiniDumpWriteDump( IntPtr hProcess, int processId, IntPtr fileHandle, int dumpType, IntPtr excepInfo, IntPtr userInfo, IntPtr extInfo); public static void CreateMiniDump(int pid, string outputFileName) { using (FileStream stream = new FileStream(outputFileName, FileMode.Create, FileAccess.ReadWrite)) { using (Process proc = Process.GetProcessById(pid)) { int dumpType = (int)0x00000306; MiniDumpWriteDump(proc.Handle, proc.Id, stream.Handle, dumpType, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); } } }
![Page 31: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/31.jpg)
INTRODUCCIÓNImportancia de Crear Mecanismos de Creacion de Memory Dumps
-Los problemas en producción pueden llegar a ser complejos de detectar
![Page 32: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/32.jpg)
INTRODUCCIÓNImportancia de Crear Mecanismos de Creacion de Memory Dumps
- Información sobre Problemas graves de procesos puede llegar a perderse
![Page 33: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/33.jpg)
INTRODUCCIÓNImportancia de Crear Mecanismos de Creacion de Memory Dumps
- Memory Dumps guardan información de las estructuras de datos y clases en el momento del bug.
![Page 34: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/34.jpg)
INTRODUCCIÓNImportancia de Crear Mecanismos de Creacion de Memory Dumps
-Event Log y los propios de la aplicacion llegan a ser insuficientes
![Page 35: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/35.jpg)
INTRODUCCIÓNArchivos de Simbolos (PDB)
-Portable Database
![Page 36: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/36.jpg)
PREGUNTAS
![Page 37: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/37.jpg)
DEBUGGING EN VIVO DE UNA APLICACIÓN
![Page 38: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/38.jpg)
INTRODUCCIÓNUtilidades Incluidas en Windows Debugger
-Incluye SDK para Windows Debugger Extensibility
![Page 39: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/39.jpg)
INTRODUCCIÓNUtilidades Incluidas en Windows Debugger
-DBGENG.DLL para la creacion programatica de Memory Dumps
![Page 40: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/40.jpg)
INTRODUCCIÓNUtilidades Incluidas en Windows Debugger
-gflags
![Page 41: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/41.jpg)
INTRODUCCIÓNWindows Debugging Labo 1
- Familiarizandose con Windows Debugger
![Page 42: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/42.jpg)
INTRODUCCIÓNWindows Debugging Labo 1
- Ejecución de Procesos con Windows Debugger Notepad
![Page 43: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/43.jpg)
INTRODUCCIÓNBreakpoints en Windows Debugging
- BP Breakpoint - BM
- BA- BU
![Page 44: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/44.jpg)
INTRODUCCIÓNWindows debugging Labo 2
- Explorando las funciones que exporta el proceso CMD
x cmd!*
![Page 45: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/45.jpg)
INTRODUCCIÓNWindows debugging Labo 2
- Trazado de procesos wt
![Page 46: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/46.jpg)
INTRODUCCIÓNWindows debugging Labo 2
- Que realmente se ejecuta internamente cuando ejecutamos un simple DIR?
breakpoint en BP cmd!dir
![Page 47: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/47.jpg)
INTRODUCCIÓNProcesos Hijo
-.childdbg 1-SXE CPR
-Navegación entre procesos hijo
![Page 48: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/48.jpg)
INTRODUCCIÓNProcesos Hijo
-cmd open notepad / Open calc
-!peb
-~ threads
![Page 49: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/49.jpg)
CARRERAS EN MICROSOFT• Software Developers.• Software Developers in Test• Escalation Engineers.• Muchas posibilidades si el candidato posee skills en: Algoritmia, Out-of-
the-box thinking.• Excelentes habilidades de conocer el software internamente.
![Page 50: Depuración de Sistemas en Producción](https://reader035.vdocuments.us/reader035/viewer/2022062316/568166e9550346895ddb2fda/html5/thumbnails/50.jpg)
SOFTWARE TESTING BOLIVIA• Comunidad creada en Facebook para compartir conocimiento.• Buscar por : Software testing Bolivia.• Objetivo: compartir conocimiento y mas adelante dar a conocer
oportunidades de trabajo nacionales e internacionales.• Solo solicitar ingreso a la comunidad.