[Lldb-commits] [lldb] Revert "[LLDB][Windows]: Don't pass duplicate HANDLEs to CreateProcess" (PR #165717)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 30 06:35:16 PDT 2025
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/165717
Reverts llvm/llvm-project#165281
Because our Windows on Arm buildbot is red all over: https://lab.llvm.org/buildbot/#/builders/141/builds/12624
>From 35b291f02c106a8580c75c2b794525ba55904069 Mon Sep 17 00:00:00 2001
From: David Spickett <spickettdavid at googlemail.com>
Date: Thu, 30 Oct 2025 13:34:43 +0000
Subject: [PATCH] Revert "[LLDB][Windows]: Don't pass duplicate HANDLEs to
CreateProcess (#165281)"
This reverts commit 5430d7a9e60b0feb899862d287351e14aeeab6bd.
---
.../Host/windows/ProcessLauncherWindows.cpp | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/lldb/source/Host/windows/ProcessLauncherWindows.cpp b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
index e1b4b7e48c5a6..f5adadaf061bf 100644
--- a/lldb/source/Host/windows/ProcessLauncherWindows.cpp
+++ b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
@@ -16,7 +16,6 @@
#include "llvm/Support/Program.h"
#include <string>
-#include <unordered_set>
#include <vector>
using namespace lldb;
@@ -92,13 +91,13 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info,
startupinfo.hStdOutput =
stdout_handle ? stdout_handle : ::GetStdHandle(STD_OUTPUT_HANDLE);
- std::unordered_set<HANDLE> inherited_handles;
+ std::vector<HANDLE> inherited_handles;
if (startupinfo.hStdError)
- inherited_handles.insert(startupinfo.hStdError);
+ inherited_handles.push_back(startupinfo.hStdError);
if (startupinfo.hStdInput)
- inherited_handles.insert(startupinfo.hStdInput);
+ inherited_handles.push_back(startupinfo.hStdInput);
if (startupinfo.hStdOutput)
- inherited_handles.insert(startupinfo.hStdOutput);
+ inherited_handles.push_back(startupinfo.hStdOutput);
SIZE_T attributelist_size = 0;
InitializeProcThreadAttributeList(/*lpAttributeList=*/nullptr,
@@ -121,15 +120,13 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info,
const FileAction *act = launch_info.GetFileActionAtIndex(i);
if (act->GetAction() == FileAction::eFileActionDuplicate &&
act->GetFD() == act->GetActionArgument())
- inherited_handles.insert(reinterpret_cast<HANDLE>(act->GetFD()));
+ inherited_handles.push_back(reinterpret_cast<HANDLE>(act->GetFD()));
}
if (!inherited_handles.empty()) {
- std::vector<HANDLE> handles(inherited_handles.begin(),
- inherited_handles.end());
if (!UpdateProcThreadAttribute(
startupinfoex.lpAttributeList, /*dwFlags=*/0,
- PROC_THREAD_ATTRIBUTE_HANDLE_LIST, handles.data(),
- handles.size() * sizeof(HANDLE),
+ PROC_THREAD_ATTRIBUTE_HANDLE_LIST, inherited_handles.data(),
+ inherited_handles.size() * sizeof(HANDLE),
/*lpPreviousValue=*/nullptr, /*lpReturnSize=*/nullptr)) {
error = Status(::GetLastError(), eErrorTypeWin32);
return HostProcess();
More information about the lldb-commits
mailing list