CDB process terminated exceptionally
Unsolved
General and Desktop
-
Kits:
The CDB crashed after line 60
But, In the WinDbg, Everything is all right.
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; }
-
Please open a bug report at https://bugreports.qt.io/ with the information provided here.