Int 3 causes System Interrupt process to 95% CPU usage

amirkhansinga 6 Reputation points
2021-06-23T17:18:29.233+00:00

I developed a Visual C++ using Toolset 2019 (v142) program which uses an _asm { int 3 } block to detect if it is running under a debugger context.

bool CheckDebug()
{
    bool hayDebug = false;

    __try
    {
        _asm
        {
            int 3
        }

        hayDebug = true;
    }
    __except (GetExceptionCode() == EXCEPTION_BREAKPOINT ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
    {
        hayDebug = false;
    }

    return hayDebug;
}

In hundreds of computers running services Windows 10, 8.1 and 7 it works well, but in several computers that instruction causes the System Interrupt process to get 95% to 100% of CPU usage, and the program stops running without kill his own process. I checked thast using Process Explorer. If I remove that instruction, the program runs well in all computers. Can you tell me why this occurs?

Note: The issue has been resolved.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,655 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,548 questions
{count} votes