Thread Errors

This tutorial demonstrates using Thread Validator to monitor an application and then query information about the application using the Analysis tab.

Note that for your executing nativeExample your critical section addresses, thread Ids and sequence numbers will all be different. We have used the values that we experienced to write this tutorial. Substitute your own values where appropriate.

 

  • Open the settings dialog by clicking on the tools icon on the toolbar.
    Thread Validator settings toolbar

    • In Novice mode, select the Out of order critical sections check box. Select the Potential deadlock check box. Select both the check boxes related to callstacks. Click OK.
      Thread Validator thread error detection settings (novice)
    • In Intermediate mode or Expert mode, select the Collect tab and select both the check boxes related to callstacks.
      Thread Validator thread error detection settings (expert 1)
    • Select the Detect tab and select the Out of order critical sections check box. Select the Potential deadlock check box.
      Thread Validator thread error detection settings (expert 2)
    • Click OK
  • Launch the sample application. Click on the re-launch icon on the toolbar.
    Thread Validator relaunch icon
  • The previously launched application is started.
  • From the Test menu, choose Leave critical sections in the wrong order.
  • From the Test menu, choose Leave non-entered critical section.
  • From the Test menu, choose Delete still active critical section.
  • Using Thread Validator, choose the Analysis tab.
  • Click the Misc Lock Errors button. The display lists all critical section objects with errors associated with them. In this example, the critical sections list are for leaving a non-entered critical section and deleting a still active critical section.
    Thread Validator thread errors
  • Click the Clear button. The display is cleared.
  • Click the Bad Lock Strategy button. The display lists all critical section objects with bad lock strategy associated with them. In this example, the critical sections list are for leaving a critical sections in the wrong order. The errors listed under Misc Errors are also listed as they can cause problems.
    Thread Validator bad lock strategy
  • Select the Auto Clear check box.
  • On the example application Test menu, choose Potential deadlock, 2 threads.
  • On the analysis tab, click the Potential Deadlocks button. The display is cleared (because the Auto Clear check box is selected) and any critical sections involved in potential deadlocks are listed.
    Thread Validator potential deadlock
  • On the example application Test menu, choose Start 3 thread deadlock.
  • On the analysis tab, click the Deadlocks button. The display is cleared (because the Auto Clear check box is selected) and any critical sections involved in deadlocks are listed.
    Thread Validator deadlocks
  • Right click on any of the deadlock entries. A context menu is displayed. Choose the Relations submenu, then choose Same location, all callstacks. All callstacks that have the same location as the locking callstack location are displayed in the lower window. This is a powerful feature that allows you to find related information to any data shown in the top window. Selected data in the lower window can be promoted to the top window for further analysis.

Fully functional, free for 30 days