1 / 51

Depuración de Sistemas en Producción

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.

corby
Download Presentation

Depuración de Sistemas en Producción

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Depuración de Sistemasen Producción Rene Pally Microsoft Corp. Office Server Team EuropeanDevelopment Centre

  2. Why Analyze a Crash? • When Windows Error Reporting has no solution or when it blames “a device driver”

  3. Why Does Windows Crash • A device driver or part of the operating system incurs anunhandled 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.

  4. Causes of Windows Crashes Microsoft Corporation. 2008. Online Crash Analysis research performed inSeptember of 2008.

  5. 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    );

  6. 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

  7. The Windows Stop Screen 1 2 3 4 5

  8. 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

  9. Crash Reporting User Interface

  10. Send Reporting User Interface

  11. 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

  12. WER Data Flow

  13. WER Data Sharing Program

  14. Problemas en sistemas de produccion

  15. Introducción Problemas en Producción: -No existe acceso a Interfaces de Desarrollo. Los clientes prefieren mantener sus ambientes de producción libres de software innecesario.

  16. Introducción Problemas 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.

  17. Introducción Problemas en Producción: • -Problemas irreproducibles en Desarrollo / Test

  18. Introducción • Debuggingtoolsfor Windows • -Herramientas por excelencia de los ambientes en Producción. • Ventajas

  19. Introducción • Debuggingtoolsfor Windows • -Debug Sistemas en Producción y/o Ambientes de Test : • -Acceso a Breakpoints y Manejo Binario de Minidumps

  20. Introducción • Debuggingtoolsfor Windows • -Debug Sistemas en Producción y/o Ambientes de Test : • Permite Acceso completo a características internas de un proceso

  21. Introducción • Debuggingtoolsfor Windows • -Debug Sistemas en Producción y/o Ambientes de Test : • -Aplicaciones Manejadas y no Manejadas

  22. Introducción • Debuggingtoolsfor Windows • -Debug Sistemas en Producción y/o Ambientes de Test : • -Procesos en Runtime.

  23. Introducción • Debuggingtoolsfor Windows • -Debug Sistemas en Producción y/o Ambientes de Test : • -Aplicacion Free.

  24. Introducción • Análisis de Procesos • -AnalisisOnline (Runtime) • -Analisis Offline (MemoryDump)

  25. Introducción • Análisis de Procesos • Memorydump es la imagen de la memoria grabada en disco en determinado momento. Puede ser de un sistema completo o de un proceso.

  26. Introducción • Procedimiento para tomar Dumps de Memoria • ADPLUS.VBS incluido con Windows Debugging Tools

  27. Introducción • Procedimiento para tomar Dumps de Memoria • windows Debugging Tools .dump /mfht

  28. Introducción • Procedimiento para tomar Dumps de Memoria • Su propia aplicación puede crear su propio dump en caso de problemas

  29. Introducción • Crear MemoryDumpsProgramaticamente • -DbgHelp.dll queesunalibreriaredistribuible.

  30. Introducción • Crear MemoryDumpsProgramaticamente [DllImport("DbgHelp.dll", SetLastError=true)]privatestaticexternboolMiniDumpWriteDump(IntPtrhProcess, intprocessId, IntPtrfileHandle,intdumpType, IntPtrexcepInfo,IntPtruserInfo, IntPtrextInfo);publicstaticvoidCreateMiniDump(intpid, stringoutputFileName)    {using (FileStreamstream = new FileStream(outputFileName, FileMode.Create, FileAccess.ReadWrite))      {using (Processproc = Process.GetProcessById(pid))        {intdumpType = (int)0x00000306;MiniDumpWriteDump(proc.Handle, proc.Id, stream.Handle,dumpType, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);        }      }}

  31. Introducción • Importancia de Crear Mecanismos de Creacion de MemoryDumps • -Los problemas en producción pueden llegar a ser complejos de detectar

  32. Introducción • Importancia de Crear Mecanismos de Creacion de MemoryDumps • - Información sobre Problemas graves de procesos puede llegar a perderse

  33. Introducción • Importancia de Crear Mecanismos de Creacion de MemoryDumps • -MemoryDumps guardan información de las estructuras de datos y clases en el momento del bug.

  34. Introducción • Importancia de Crear Mecanismos de Creacion de MemoryDumps • -Event Log y los propios de la aplicacion llegan a ser insuficientes

  35. Introducción • Archivos de Simbolos (PDB) • -Portable Database

  36. Preguntas

  37. Debugging en Vivo de una Aplicación

  38. Introducción • Utilidades Incluidas en Windows Debugger • -Incluye SDK para Windows DebuggerExtensibility

  39. Introducción • Utilidades Incluidas en Windows Debugger • -DBGENG.DLL para la creacionprogramatica de MemoryDumps

  40. Introducción • Utilidades Incluidas en Windows Debugger • -gflags

  41. Introducción • Windows DebuggingLabo 1 • -Familiarizandose con Windows Debugger

  42. Introducción • Windows DebuggingLabo 1 • - Ejecución de Procesos con Windows DebuggerNotepad

  43. Introducción • Breakpoints en Windows Debugging • - BP Breakpoint • - BM • - BA • - BU

  44. Introducción • Windows debuggingLabo 2 • - Explorando las funciones que exporta el proceso CMD • x cmd!*

  45. Introducción • Windows debuggingLabo 2 • - Trazado de procesos wt

  46. Introducción • Windows debuggingLabo 2 •  - Que realmente se ejecuta internamente cuando ejecutamos un simple DIR? • breakpoint en BP cmd!dir

  47. Introducción • Procesos Hijo •  -.childdbg1 • -SXE CPR • -Navegación entre procesos hijo

  48. Introducción • Procesos Hijo • -cmd open notepad / Open calc • -!peb • -~ threads

  49. Carreras en microsoft • Software Developers. • Software Developers in Test • Escalation Engineers. • Muchasposibilidadessi el candidatoposee skills en: Algoritmia, Out-of-the-box thinking. • Excelenteshabilidades de conocer el software internamente.

  50. Software testing bolivia • Comunidadcreada en Facebook para compartirconocimiento. • Buscarpor : Software testing Bolivia. • Objetivo: compartirconocimiento y mas adelantedar a conoceroportunidades de trabajonacionales e internacionales. • Solo solicitaringreso a la comunidad.

More Related