Microsoft DebugDiag - Quick Guide for MicroStation crash issues


 Product:MicroStation
 Version:All
 Environment:Windows
 Area:Exception
 Subarea:N/A

A quick guide for using Microsoft Debugdiag to capture MicroStation crashes

Background

In many circumstances MicroStation's issues can be caused by other applications or Windows components that interfere with MicroStation's optimal functioning. In some cases MicroStation's exception logs and minidump file cannot be generated or are not sufficient for understanding the root cause of the issue. In these cases Windows debugging tools are required for a thorough investigation.

Steps to debug in case of a crash

1. Set a user environment variable named MS_TRAP
Control Panel->System->Advanced->Environment Variables->User variables->New...

 

2. Download and install (with default options) latest 32-bit or 64-bit DebugDiag (depending on your Operating System) from the Microsoft site:

Debug Diagnostic Tool v2 Update 3

Debug Diagnostic Tool v2 Update 2

 

3.Start DebugDiag: Start->All Programs->Debug Diagnostics Tool 1.2->DebugDiag 1.2

4. Select Rule Type->Crash->Next

5. Select Target Type->A specific process->Next

6. Select Target"->Selected Process->ustation.exe->Next
[note that ustation.exe will not appear in the task list if it is not already running, as for startup crashes, but the “ustation.exe” can and should be typed into the “Selected Process” field.]

For MicroStation Connect, set the process name to MicroStation.exe

7. Advanced Configuration (Optional)->Action type for unconfigured first chance exceptions->Log Stack Trace->Action limit->200

8. Advanced Configuration (Optional)->Advanced Settings->Breakpoints...

9. Configure Breakpoint->Breakpoint->Ntdll!ZwTerminateProcess->Action->Action Type->Full Userdump->Action Limit->5->OK (Note: If you have much available disk space, you can set the Action Limit to 10)

10. Configure Breakpoints->Save & Close

11. Advanced Configuration (Optional)->Advanced Settings->PageHeap Flags...

12. Configure PageHeap Flags->Enable Full PageHeap->OK

13. Debug Diagnostic Tool->Yes

14. In the Advanced Configuration (Optional)->Next

15. Select Dump Location And Rule Name (Optional – and note location where dump files will be written, and optionally change it)  ->Next

16. Rule Completed->Activate the rule now->Finish

17. Debug Diagnostic Tools->Yes

18. Debug Diagnostic Tool - Connected to DbgSvc

19. (should observe that the "Crash Rule" status is "Active")

20. File->Exit

 

Debug Diagnostic Tool will now report MicroStation issue(s), and up to 25 or so memory dumps will be collected.

Navigate in Windows Explorer to location defaulted or specified in steps 15/16 above after issue has been reproduced, and right-click send to compressed folder the "Crash rule for all instances of ustation.exe" folder and upload to Bentley via ftp or sharedfiles.

Also add all .log files from "C:\Program Files\DebugDiag\Logs" to the above .zip archive before uploading; in fact, it may be easier (if the location for dump files has not been customized) to just recursively send the whole "C:\Program Files\DebugDiag\Logs" folder tree to a compressed folder.

Note! When all finished collecting dumps (may be minutes or days later), be sure to remove the Crash Rule using these steps:

1. Start DebugDiag: Start->All Programs->Debug Diagnostics Tool 1.2->DebugDiag 1.2

2. Select "Crash rule for all instances of ustation.exe"

3. "Remove Rule"

4. File->Exit

5. Unset the user environment variable named MS_TRAP

It is important to remove the rule, otherwise Debug Diag will keep on logging MicroStation and log files can fill up your memory space.

 

 

Video

See Also

Microsoft DebugDiag - Create Hang Dump

Other language sources

 Original Author:Marco Salino