Skip to content

Conversation

@DavidSpickett
Copy link
Collaborator

Reverts #165281

Because our Windows on Arm buildbot is red all over: https://lab.llvm.org/buildbot/#/builders/141/builds/12624

@llvmbot llvmbot added the lldb label Oct 30, 2025
@DavidSpickett DavidSpickett merged commit 9423d59 into main Oct 30, 2025
6 of 10 checks passed
@DavidSpickett DavidSpickett deleted the revert-165281-lldb-remove-duplicated-handles branch October 30, 2025 13:35
@llvmbot
Copy link
Member

llvmbot commented Oct 30, 2025

@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)

Changes

Reverts llvm/llvm-project#165281

Because our Windows on Arm buildbot is red all over: https://lab.llvm.org/buildbot/#/builders/141/builds/12624


Full diff: https://github.com/llvm/llvm-project/pull/165717.diff

1 Files Affected:

  • (modified) lldb/source/Host/windows/ProcessLauncherWindows.cpp (+7-10)
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();

aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
luciechoi pushed a commit to luciechoi/llvm-project that referenced this pull request Nov 1, 2025
DEBADRIBASAK pushed a commit to DEBADRIBASAK/llvm-project that referenced this pull request Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants