Analysing a complex crash

This tutorial demonstrates launching the sample application, crashing the application and using C++ Bug Validator to identify the location and cause of the crash. The tutorial is performed without MFC code instrumented, so that MFC message processing and pointer validation calls are not part of the application trace.

    • Open the settings dialog by clicking the tools icon on the toolbar.
      Bug Validator settings icon
    • The Settings Dialog is displayed. Select the Hook Insertion tab.
      Bug Validator Hook Insertion
    • Select the check boxes in the section marked DLL Hook Insertion. The image shows that the MFC, CRT, STL and system DLLs have been marked to be ignored (deselected). Click OK to accept the settings.
    • Launch the sample application. Click on the launch icon on the toolbar.
      Bug Validator launch icon
    • The Launch application wizard is displayed.
      Bug Validator launch wizard
    • Select the sample application bvExample.exe using the Browse… button.
    • Click the Next button to move to the 2nd page of the wizard.
      Bug Validator launch wizard
    • Leave the settings as the default settings.
    • Click the Next button to move to the 3rd page of the wizard.
      Bug Validator launch wizard
    • Leave the settings as the default settings.
    • Click the Next button to move to the 4th page of the wizard.
      Bug Validator launch wizard
    • Click the Start Application button to launch the application.
    • The bvExample.exe application is started.
      Bug Validator native example application
    • Wait for the instrumentation of the application to complete.
    • On the File menu, choose Crash 2. 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.
    • 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 dialog.
    • On the C++ 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).

Scroll to the bottom of the display. The image will look similar to the image shown below.

Crash (2) without MFC (1)
The exception caused by the crash is caught in the unhandled exception filter (shown above). 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.
Crash (2) without MFC (2)

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.

Future versions of C++ Bug Validator will provide:

  • Method parameter values and method return values, “this” pointer tracking.
  • Exception tracking.
  • SetLastError() value tracking.
  • Filtering to remove unwanted functions from the display to aid navigation when looking for the cause of an exception
  • Query facilities to provide searches on function names and parameter/this/return values.
  • Improved instrumentation capabilities to allow fine tuning of data collection.
  • Beta test suggestions.

Fully functional, free for 30 days