Analysing a complex crash

This tutorial demonstrates launching the sample application, crashing the application and using Bug Validator to identify the location and cause of the crash.

The tutorial is performed without MFC code instrumentation so that MFC message processing and pointer validation calls are not part of the application trace.

  1. Open the settings dialog by clicking the tools icon on the toolbar.
    Bug Validator Toolbar Settings
  2. The Settings Dialog is displayed. Select the Hook Insertion tab.
    Bug Validator Settings Hook Insertion Exclude MFC, CRT, STL
  3. Select the Use general DLL hook settings checkbox in the section marked DLL Hook Insertion, then deselect the checkboxes underneath it. The image shows that the MFC, CRT, STL and system DLLs have been marked to be ignored (deselected).
  4. Click OK to accept the settings.
  5. Launch the sample application. Click on the launch icon on the toolbar.
    Bug Validator Toolbar Launch
  6. The Launch application wizard is displayed.
    Bug Validator Launch Wizard, Page 1
  7. Select the sample application nativeExample.exe using the Browse… button.
  8. Click the Next button to move to the 2nd page of the wizard.
    Bug Validator Launch Wizard, Page 2
  9. Leave the settings as the default settings.
  10. Click the Next button to move to the 3rd page of the wizard.
    Bug Validator Launch Wizard, Page 3
  11. Click the Start Application button to launch the application.
  12. The nativeExample.exe application is started.
    Bug Validator native example application
  13. Wait for the instrumentation of the application to complete.
  14. On the nativeExample Crashes menu, choose Crash Data Corruption (incorrect type cast).
    • A dialog is displayed with instructions to double-click in the edit field to cause a crash.
    • Double-click in the edit field. This will execute code that uses a pointer to a class of an incorrect type, resulting in data corruption that causes a crash during message processing.
    • The application crashes, displaying an exception dialog box.
  15. The exception will cause the following dialog box to be displayed by the operating system:
    Windows NT, Windows 2000
    Exception on Windows NT, 2000
    Windows XP
    Exception Windows XP
    Do not click any of the buttons on the exception dialog.
  16. On the Bug Validator Execution History tab, click the Refresh button. The display will refresh. You can now click the buttons on the exception dialog as you desire (to dismiss the application or enter the debugger etc).
  17. Scroll to the bottom of the display.
    The image will look similar to the image shown below. The exception caused by the crash is shown.
    Bug Validator Complex Crash location
  18. Scroll upwards in the list looking for the start of the message processing that caused the crash.
    The image below shows the call that started the message processing. This is in the CCrashEditBox::OnLButtonDblClick() method.
    Bug Validator Complex Crash cause location

Conclusion

This tutorial demonstrated a more complex crash than the simple crash.

As you can see, interpreting the trace data is not always trivial, some detective work is required to correctly identify the cause of the problem.

Fully functional, free for 30 days