Debugging Tools for Windows

MTS or COM+ Server Application Ends Unexpectedly

Custom Component Object Model (COM) components that run inside an MTS or COM+ server application actually run inside a surrogate process (Mtx.exe or Dllhost.exe). These surrogate processes have properties and settings that you can configure through the Component Services Microsoft Management Console (MMC) snap-in.

By default, MTS or COM+ server applications are configured to shut down after 3 minutes of idle time. To make sure that these processes remain running while the debugger is attached and monitoring for exceptions, you must configure them to "Leave running when idle".

In addition, MTS and COM+ implement a failfast. This safeguard is designed to fail (or shut down) MTS or COM+ processes that generate unhandled access violations.

By default, failfast is enabled in MTS or COM+ applications that raise unhandled access violation exceptions. Therefore, a failing MTS/COM+ server application can never raise a second-chance access violation exception. (That is, this application is shut down after the first-chance access violation.) By default, ADPlus is configured to produce a minidump file only on first-chance exceptions.

To debug an MTS or COM+ server application, do the following:

  1. Configure the MTS or COM+ server application to "Leave running when idle."
  2. Set ADPlus to create a full dump on a first-chance exception. For more information about this configuration, see ADPlus Command-Line Options and ADPlus Configuration Files.
  3. Run ADPlus in crash mode and wait for the application to fail.

Because MTS and COM+ shut down a server application, and because the process cannot raise a second-chance exception because of the failfast policy, you can obtain only a first-chance access violation memory dump.

Build machine: CAPEBUILD