Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. CDB process terminated exceptionally
Qt 6.11 is out! See what's new in the release blog

CDB process terminated exceptionally

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tancen
    wrote on last edited by
    #1

    Kits:
    fe073228-f94e-408c-8f9e-218689bd2734-image.png

    The CDB crashed after line 60
    32bf6989-a863-430f-928b-c3e2b56b3439-image.png
    666062d7-950c-4379-b00a-441ba3f2bc14-image.png

    But, In the WinDbg, Everything is all right.
    b6cfdd0e-c35b-4575-b682-768b283acb7e-image.png

    How to fix it? Thanks.

    Codes:

    #include <Windows.h>
    #include <conio.h>
    #include <memory>
    #include <thread>
    #include <string>
    #include <functional>
    
    #define __PRETTY_FUNCTION__  __FUNCSIG__
    
    void test3()
    {
        bool fSuccess;
        HANDLE outPipeOurSide = 0, inPipeOurSide = 0;
        HANDLE outPipePseudoConsoleSide = 0, inPipePseudoConsoleSide = 0;
    
        PROCESS_INFORMATION pi;
        memset(&pi, 0, sizeof(pi));
    
        STARTUPINFOEXW  si;
        memset(&si, 0, sizeof(si));
        si.StartupInfo.cb = sizeof(STARTUPINFOEXW);
    
        do
        {
            CreatePipe(&inPipePseudoConsoleSide, &inPipeOurSide, NULL, 0);
            CreatePipe(&outPipeOurSide, &outPipePseudoConsoleSide, NULL, 0);
            HPCON hPC = 0;
            if (CreatePseudoConsole(COORD{ 800, 600 }, inPipePseudoConsoleSide, outPipePseudoConsoleSide, 0, &hPC) != S_OK)
            {
                printf("%s:%d - CreatePseudoConsole failed[%ld]", __PRETTY_FUNCTION__, __LINE__, GetLastError());
                break;
            }
    
            SIZE_T size;
            InitializeProcThreadAttributeList(NULL, 1, 0, &size);
            si.lpAttributeList = reinterpret_cast<PPROC_THREAD_ATTRIBUTE_LIST>(new char[size]);
            fSuccess = InitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &size);
            if (!fSuccess)
            {
                printf("%s:%d - InitializeProcThreadAttributeList failed[%ld]", __PRETTY_FUNCTION__, __LINE__, GetLastError());
                break;
            }
    
            fSuccess = UpdateProcThreadAttribute(
                si.lpAttributeList,
                0,
                PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE,
                hPC,
                sizeof(HPCON),
                NULL,
                NULL);
            if (!fSuccess)
            {
                printf("%s:%d - UpdateProcThreadAttribute failed[%ld]", __PRETTY_FUNCTION__, __LINE__, GetLastError());
                break;
            }
    
    
            std::wstring commandline = L"cmd.exe";
            fSuccess = CreateProcess(
                nullptr,
                (wchar_t*)commandline.data(),
                nullptr,
                nullptr,
                TRUE,
                EXTENDED_STARTUPINFO_PRESENT,
                nullptr,
                nullptr,
                &si.StartupInfo,
                &pi);
    
    
            if (!fSuccess)
            {
                printf("!CreateProcessA failed[%ld]", GetLastError());
                break;
            }
            DeleteProcThreadAttributeList(si.lpAttributeList);
            printf("done, pid %ld", pi.dwProcessId);
        } while (0);
    
        CloseHandle(inPipeOurSide);
        CloseHandle(outPipeOurSide);
        CloseHandle(inPipePseudoConsoleSide);
        CloseHandle(outPipePseudoConsoleSide);
        TerminateProcess(pi.hProcess, 0);
        WaitForSingleObject(pi.hProcess, -1);
        CloseHandle(pi.hProcess);
    }
    
    
    int main(int argc, char* argv[])
    {
        test3();
        return 0;
    }
    
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by
      #2

      Since it doesn't seem that you are using Qt at all in your code, what happens if you compile and debug it outside of QtCreator?

      T 1 Reply Last reply
      1
      • M mchinand

        Since it doesn't seem that you are using Qt at all in your code, what happens if you compile and debug it outside of QtCreator?

        T Offline
        T Offline
        Tancen
        wrote on last edited by
        #3

        @mchinand I tried compiling the source codes in Visual Studio 2019, And running it with debug mode, Step over around line 60, Every thing is OK.

        1 Reply Last reply
        0
        • cristian-adamC Offline
          cristian-adamC Offline
          cristian-adam
          wrote on last edited by
          #4

          Please open a bug report at https://bugreports.qt.io/ with the information provided here.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved