Skip to content

Commit ec7f87d

Browse files
DavidSpickettaokblast
authored andcommitted
Revert "[LLDB][Windows]: Don't pass duplicate HANDLEs to CreateProcess" (llvm#165717)
Reverts llvm#165281 Because our Windows on Arm buildbot is red all over: https://lab.llvm.org/buildbot/#/builders/141/builds/12624
1 parent 41017af commit ec7f87d

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lldb/source/Host/windows/ProcessLauncherWindows.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "llvm/Support/Program.h"
1717

1818
#include <string>
19-
#include <unordered_set>
2019
#include <vector>
2120

2221
using namespace lldb;
@@ -92,13 +91,13 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info,
9291
startupinfo.hStdOutput =
9392
stdout_handle ? stdout_handle : ::GetStdHandle(STD_OUTPUT_HANDLE);
9493

95-
std::unordered_set<HANDLE> inherited_handles;
94+
std::vector<HANDLE> inherited_handles;
9695
if (startupinfo.hStdError)
97-
inherited_handles.insert(startupinfo.hStdError);
96+
inherited_handles.push_back(startupinfo.hStdError);
9897
if (startupinfo.hStdInput)
99-
inherited_handles.insert(startupinfo.hStdInput);
98+
inherited_handles.push_back(startupinfo.hStdInput);
10099
if (startupinfo.hStdOutput)
101-
inherited_handles.insert(startupinfo.hStdOutput);
100+
inherited_handles.push_back(startupinfo.hStdOutput);
102101

103102
SIZE_T attributelist_size = 0;
104103
InitializeProcThreadAttributeList(/*lpAttributeList=*/nullptr,
@@ -121,15 +120,13 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info,
121120
const FileAction *act = launch_info.GetFileActionAtIndex(i);
122121
if (act->GetAction() == FileAction::eFileActionDuplicate &&
123122
act->GetFD() == act->GetActionArgument())
124-
inherited_handles.insert(reinterpret_cast<HANDLE>(act->GetFD()));
123+
inherited_handles.push_back(reinterpret_cast<HANDLE>(act->GetFD()));
125124
}
126125
if (!inherited_handles.empty()) {
127-
std::vector<HANDLE> handles(inherited_handles.begin(),
128-
inherited_handles.end());
129126
if (!UpdateProcThreadAttribute(
130127
startupinfoex.lpAttributeList, /*dwFlags=*/0,
131-
PROC_THREAD_ATTRIBUTE_HANDLE_LIST, handles.data(),
132-
handles.size() * sizeof(HANDLE),
128+
PROC_THREAD_ATTRIBUTE_HANDLE_LIST, inherited_handles.data(),
129+
inherited_handles.size() * sizeof(HANDLE),
133130
/*lpPreviousValue=*/nullptr, /*lpReturnSize=*/nullptr)) {
134131
error = Status(::GetLastError(), eErrorTypeWin32);
135132
return HostProcess();

0 commit comments

Comments
 (0)