Microsoft KB Archive/128896

From BetaArchive Wiki
Knowledge Base


Exceptions in a service causes the Just-In-Time (JIT) debugger not to appear, and the computer stops responding

Article ID: 128896

Article Last Modified on 9/30/2005



APPLIES TO

  • The Integrated Debugger, when used with:
    • Microsoft Visual C++ 2.0 Professional Edition
    • Microsoft Visual C++ 2.1
    • Microsoft Visual C++ 4.0 Standard Edition
    • Microsoft Visual C++ 5.0 Enterprise Edition
    • Microsoft Visual C++ 6.0 Enterprise Edition
    • Microsoft Visual C++ 5.0 Professional Edition
    • Microsoft Visual C++ 6.0 Professional Edition
    • Microsoft Visual C++ 6.0 Standard Edition



This article was previously published under Q128896

SYMPTOMS

When Just-In-Time (JIT) debugging is enabled in Microsoft Visual C++, applications that cause exceptions (debuggees) display a dialog box that will allow you to start the debugger.

If a process that is running in a different context, such as a service, causes an access violation or another exception in Microsoft Windows NT 3.5, the dialog box appears. However, the debugger never appears, and the process causes the computer to stop responding (hang).

CAUSE

When Windows NT starts the debugger after a fault, it runs in the same context as the application that faulted. Many services run in the LocalSystem account, which does not have access to the user desktop by default. Because the process cannot interact with the desktop, the debugger also cannot interact with the debugger.

RESOLUTION

Beginning with version 3.5 of Windows NT, you can allow a service to interact with the desktop. To do this, use one of the following methods:

  • Use the SERVICE_INTERACTIVE_PROCESS flag when you call CreateService().
  • Follow these steps:
    1. In Control Panel, open Services.
    2. Select the service, click Startup, and then click to select Allow Service to Interact with Desktop.


STATUS

This behavior is by design in Windows NT 3.1 and 3.5. This problem does not occur in Windows NT 3.51.


Additional query words: hung WorkBench

Keywords: kbtshoot kbbug kbide kbdebug kbprb KB128896