Skip to content

lldb-server's GDB port map (--min/max-gdbserver-port) has a race condition when killing the debugee on a slow remote system #97537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DavidSpickett opened this issue Jul 3, 2024 · 4 comments · Fixed by #104238
Labels

Comments

@DavidSpickett
Copy link
Collaborator

To reproduce, the remote needs to be something relatively slow. In my case QEMU.

Start an lldb-server on the remote in platform mode with some restricted ports:

$ ./lldb-server plaform --server --listen 0.0.0.0:54321 --min-gdbserver-port 49140 --max-gdbserver-port 49150

Then connect lldb and run a program:

$ ./bin/lldb
(lldb) platform select remote-linux
  Platform: remote-linux
 Connected: no
(lldb) platform connect connect://127.0.0.1:54321
  Platform: remote-linux
    Triple: aarch64-unknown-linux-gnu
OS Version: 6.10.0 (6.10.0-rc4-g14d7c92f8df9)
  Hostname: e125016
 Connected: yes
WorkingDir: /home/davspi01
    Kernel: #1 SMP PREEMPT Tue Jun 18 15:14:36 BST 2024
(lldb) target create /tmp/test.o
Current executable set to '/tmp/test.o' (aarch64).
(lldb) b main
Breakpoint 1: where = test.o`main at test.c:1:21, address = 0x0000000000400574
(lldb) run
Process 263 launched: '/tmp/test.o' (aarch64)
Process 263 stopped
* thread #1, name = 'test.o', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400574 test.o`main at test.c:1:21
-> 1   	int main() { return 0; }

At this point lldb-server has started a new process to handle this client's connection and given it a port map that has one open port, that it has used to start a gdb-server process.

From here, if you finish the program then run it again, everything is fine. The gdbserver is torn down and the port is freed, then reused for the new gdbserver.

However, if you run before the program finishes there is a race between the platform killing the gdbserver process and the platform handling the launch gdb server request packet:

$ ./bin/lldb
(lldb) platform select remote-linux
  Platform: remote-linux
 Connected: no
(lldb) platform connect connect://127.0.0.1:54321
  Platform: remote-linux
    Triple: aarch64-unknown-linux-gnu
OS Version: 6.10.0 (6.10.0-rc4-g14d7c92f8df9)
  Hostname: e125016
 Connected: yes
WorkingDir: /home/davspi01
    Kernel: #1 SMP PREEMPT Tue Jun 18 15:14:36 BST 2024
(lldb) target create /tmp/test.o
Current executable set to '/tmp/test.o' (aarch64).
(lldb) b main
Breakpoint 1: where = test.o`main at test.c:1:21, address = 0x0000000000400574
(lldb) run
Process 263 launched: '/tmp/test.o' (aarch64)
Process 263 stopped
* thread #1, name = 'test.o', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400574 test.o`main at test.c:1:21
-> 1   	int main() { return 0; }
(lldb) run
There is a running process, kill it and restart?: [Y/n] y
Process 263 exited with status = 9 (0x00000009) killed
error: unable to launch a GDB server on 'e125016'

We can see that the packets are sent in the right order:

lldb             <   5> send packet: $k#6b
lldb             <  19> read packet: $X09;process:115#cc
Process 277 exited with status = 9 (0x00000009) killed
<...>
lldb             <  34> send packet: $qLaunchGDBServer;host:e125016;#12
lldb             <   7> read packet: $E09#ae
error: unable to launch a GDB server on 'e125016'

On the server side it uses kill() to kill the process and it should then free the port here:

(introduced by #88845, which I think made the feature overall better, but in doing so exposed this issue)

If the remote is slow enough that the kill doesn't actually finish before we get back there, then it won't and it'll try to find a free port, find none, and fail to launch the gdb server. Some ad-hoc logging shows this on the server side:

265: port map begins --------------------   <<< 256 is the main process
first: 49140 second: 0
first: 49141 second: 0
first: 49142 second: 0
first: 49143 second: 0
first: 49144 second: 0
first: 49145 second: 0
first: 49146 second: 0
first: 49147 second: 0
first: 49148 second: 0
first: 49149 second: 0
265: port map ends--------------------
266: port map begins -------------------- <<< 266 is created to handle the connection to lldb
first: 49140 second: 0
266: port map ends--------------------   <<< the first gdbserver is launched on the only unallocated port, 49140
266: port map begins --------------------
first: 49140 second: 271
266: port map ends-------------------- <<< looks for a free port, but the 1 port is allocated to pid 271 still
266: No free port found in map!  <<< error returned to lldb
266: FreePortForProcess 271 49140 <<< it finally notices that kill() has happened

This does not happen debugging locally on real hardware.

I discovered this running some of the SVE tests again. They run the debugee once to discover the supported vector lengths and then again to run the actual test case. Adding a sleep(5) in the test cases between those 2 runs also "fixes" the issue.

The workaround is to not use a port map at all, but often giving full network access to a VM is difficult. So I'd like to find a way to make this work, or at least work around it in the tests most likely to be run this way.

@llvmbot
Copy link
Member

llvmbot commented Jul 3, 2024

@llvm/issue-subscribers-lldb

Author: David Spickett (DavidSpickett)

To reproduce, the remote needs to be something relatively slow. In my case QEMU.

Start an lldb-server on the remote in platform mode with some restricted ports:

$ ./lldb-server plaform --server --listen 0.0.0.0:54321 --min-gdbserver-port 49140 --max-gdbserver-port 49150

Then connect lldb and run a program:

$ ./bin/lldb
(lldb) platform select remote-linux
  Platform: remote-linux
 Connected: no
(lldb) platform connect connect://127.0.0.1:54321
  Platform: remote-linux
    Triple: aarch64-unknown-linux-gnu
OS Version: 6.10.0 (6.10.0-rc4-g14d7c92f8df9)
  Hostname: e125016
 Connected: yes
WorkingDir: /home/davspi01
    Kernel: #<!-- -->1 SMP PREEMPT Tue Jun 18 15:14:36 BST 2024
(lldb) target create /tmp/test.o
Current executable set to '/tmp/test.o' (aarch64).
(lldb) b main
Breakpoint 1: where = test.o`main at test.c:1:21, address = 0x0000000000400574
(lldb) run
Process 263 launched: '/tmp/test.o' (aarch64)
Process 263 stopped
* thread #<!-- -->1, name = 'test.o', stop reason = breakpoint 1.1
    frame #<!-- -->0: 0x0000000000400574 test.o`main at test.c:1:21
-&gt; 1   	int main() { return 0; }

At this point lldb-server has started a new process to handle this client's connection and given it a port map that has one open port, that it has used to start a gdb-server process.

From here, if you finish the program then run it again, everything is fine. The gdbserver is torn down and the port is freed, then reused for the new gdbserver.

However, if you run before the program finishes there is a race between the platform killing the gdbserver process and the platform handling the launch gdb server request packet:

$ ./bin/lldb
(lldb) platform select remote-linux
  Platform: remote-linux
 Connected: no
(lldb) platform connect connect://127.0.0.1:54321
  Platform: remote-linux
    Triple: aarch64-unknown-linux-gnu
OS Version: 6.10.0 (6.10.0-rc4-g14d7c92f8df9)
  Hostname: e125016
 Connected: yes
WorkingDir: /home/davspi01
    Kernel: #<!-- -->1 SMP PREEMPT Tue Jun 18 15:14:36 BST 2024
(lldb) target create /tmp/test.o
Current executable set to '/tmp/test.o' (aarch64).
(lldb) b main
Breakpoint 1: where = test.o`main at test.c:1:21, address = 0x0000000000400574
(lldb) run
Process 263 launched: '/tmp/test.o' (aarch64)
Process 263 stopped
* thread #<!-- -->1, name = 'test.o', stop reason = breakpoint 1.1
    frame #<!-- -->0: 0x0000000000400574 test.o`main at test.c:1:21
-&gt; 1   	int main() { return 0; }
(lldb) run
There is a running process, kill it and restart?: [Y/n] y
Process 263 exited with status = 9 (0x00000009) killed
error: unable to launch a GDB server on 'e125016'

We can see that the packets are sent in the right order:

lldb             &lt;   5&gt; send packet: $k#<!-- -->6b
lldb             &lt;  19&gt; read packet: $X09;process:115#cc
Process 277 exited with status = 9 (0x00000009) killed
&lt;...&gt;
lldb             &lt;  34&gt; send packet: $qLaunchGDBServer;host:e125016;#<!-- -->12
lldb             &lt;   7&gt; read packet: $E09#ae
error: unable to launch a GDB server on 'e125016'

On the server side it uses kill() to kill the process and it should then free the port here:

(introduced by #88845, which I think made the feature overall better, but in doing so exposed this issue)

If the remote is slow enough that the kill doesn't actually finish before we get back there, then it won't and it'll try to find a free port, find none, and fail to launch the gdb server. Some ad-hoc logging shows this on the server side:

265: port map begins --------------------   &lt;&lt;&lt; 256 is the main process
first: 49140 second: 0
first: 49141 second: 0
first: 49142 second: 0
first: 49143 second: 0
first: 49144 second: 0
first: 49145 second: 0
first: 49146 second: 0
first: 49147 second: 0
first: 49148 second: 0
first: 49149 second: 0
265: port map ends--------------------
266: port map begins -------------------- &lt;&lt;&lt; 266 is created to handle the connection to lldb
first: 49140 second: 0
266: port map ends--------------------   &lt;&lt;&lt; the first gdbserver is launched on the only unallocated port, 49140
266: port map begins --------------------
first: 49140 second: 271
266: port map ends-------------------- &lt;&lt;&lt; looks for a free port, but the 1 port is allocated to pid 271 still
266: No free port found in map!  &lt;&lt;&lt; error returned to lldb
266: FreePortForProcess 271 49140 &lt;&lt;&lt; it finally notices that kill() has happened

This does not happen debugging locally on real hardware.

I discovered this running some of the SVE tests again. They run the debugee once to discover the supported vector lengths and then again to run the actual test case. Adding a sleep(5) in the test cases between those 2 runs also "fixes" the issue.

The workaround is to not use a port map at all, but often giving full network access to a VM is difficult. So I'd like to find a way to make this work, or at least work around it in the tests most likely to be run this way.

@DavidSpickett DavidSpickett changed the title lldb-server's GDB port map has a race condition when killing the debugee on a slow remote system lldb-server's GDB port map (--min/max-gdbserver-port) has a race condition when killing the debugee on a slow remote system Jul 3, 2024
@slydiman
Copy link
Contributor

slydiman commented Jul 13, 2024

I have investigated this issue little bit.

The variable port is initialized with 0 and passed to LaunchGDBServer()

std::optional<uint16_t> port = 0;
std::string socket_name;
Status error = platform.LaunchGDBServer(inferior_arguments,
"", // hostname
pid, port, socket_name);

It seems the condition if (!port) is never met because std::optional<uint16_t> port has a value. It is a bug and must be fixed!
Status GDBRemoteCommunicationServerPlatform::LaunchGDBServer(
const lldb_private::Args &args, std::string hostname, lldb::pid_t &pid,
std::optional<uint16_t> &port, std::string &socket_name) {
if (!port) {
llvm::Expected<uint16_t> available_port = m_port_map.GetNextAvailablePort();
if (available_port)
port = *available_port;
else
return Status(available_port.takeError());
}

Then port = 0 is always passed to StartDebugserverProcess() called from GDBRemoteCommunicationServerPlatform::LaunchGDBServer().
But StartDebugserverProcess() does not use the passed port value anyway and updates the port with a new value (child_port).
if (*port == 0 || *port == child_port) {
*port = child_port;
LLDB_LOGF(log,
"GDBRemoteCommunication::%s() "
"debugserver listens %u port",
__FUNCTION__, *port);
} else {
LLDB_LOGF(log,
"GDBRemoteCommunication::%s() "
"debugserver listening on port "
"%d but requested port was %d",
__FUNCTION__, (uint32_t)child_port, (uint32_t)(*port));
}

Note m_port_map.AssociatePortWithProcess(*port, pid) will silently fail here because a new port value is missing in portmap_for_child.
Status error = StartDebugserverProcess(
url.str().c_str(), nullptr, debugserver_launch_info, port_ptr, &args, -1);
pid = debugserver_launch_info.GetProcessID();
if (pid != LLDB_INVALID_PROCESS_ID) {
std::lock_guard<std::recursive_mutex> guard(m_spawned_pids_mutex);
m_spawned_pids.insert(pid);
if (*port > 0)
m_port_map.AssociatePortWithProcess(*port, pid);
} else {
if (*port > 0)
m_port_map.FreePort(*port);
}

gdbserver_portmap is useless because it does not reflect the actual port used.
StartDebugserverProcess() will try to listen on 127.0.0.1:0 only if url is nullptr, but url is always defined if the protocol is tcp. Otherwise pipes are used (binding to port zero).
Here is the log of lldb-server processes (parent and child) on remote Linux

/home/ubuntu/lldb-server p --log-channels lldb all --listen *:1234 --server --min-gdbserver-port 1236 --max-gdbserver-port 1240
/home/ubuntu/lldb-server gdbserver tcp://[10.1.1.170]:0 --native-regs --pipe 6

Note the port 0 in the url tcp://[10.1.1.170]:0 is a bug now. but any port in this url will be ignored.

I don't see where --min-gdbserver-port, --max-gdbserver-port and --gdbserver-port values are really used. Do we still need them?
--port-offset is not used too.

Probably it is better to revert #88845 since the port mapping does not work as expected anyway. But #88845 caused test failures on cross builds.

slydiman added a commit to slydiman/llvm-project that referenced this issue Jul 14, 2024
TestPlatformLaunchGDBServer.py runs ldb-server w/o --min-gdbserver-port, --max-gdbserver-port or --gdbserver-port, so gdbserver_portmap is empty and gdbserver_portmap.GetNextAvailablePort() will return 0. Do not pass 0 to portmap_for_child in this case. Added few asserts in GDBRemoteCommunicationServerPlatform::PortMap to avoid this in the future.
This patch fixes llvm#97537.

It seems StartDebugserverProcess() ignores the port anyway and parameters --min-gdbserver-port, --max-gdbserver-port and --gdbserver-port are useless at all, but it is out of scope of this patch.
@DavidSpickett
Copy link
Collaborator Author

I don't see where --min-gdbserver-port, --max-gdbserver-port and --gdbserver-port values are really used. Do we still need them?
--port-offset is not used too.

Start from lldb/tools/lldb-server/lldb-platform.cpp instead. They should be doing something if the user provided them. They are supposed to be for situations where you don't have all the ports available between the host and VM.

They've always been a bit dodgy but they are useful for working on simulators.

@slydiman
Copy link
Contributor

Currently the port in url is always 0 because std::optional<uint16_t> port is initialized here and LaunchGDBServer() does not request port map at all

std::optional<uint16_t> port = 0;

Note usually it is better to configure simulators (qemu) to use a network bridge with own IP w/o any port limits and do not map ports manually to host's ports.

Note I'm working on a patch to fix this issue and all port mapping related issues. The idea is to use threads for platform mode and use a common port map for all connections instead of making a new portmap_for_child with 1 port.

DavidSpickett pushed a commit that referenced this issue Jul 18, 2024
…98833)

TestPlatformLaunchGDBServer.py runs `ldb-server` w/o parameters
`--min-gdbserver-port`, `--max-gdbserver-port` or `--gdbserver-port`. So
`gdbserver_portmap` is empty and
`gdbserver_portmap.GetNextAvailablePort()` will return 0. Do not call
`portmap_for_child.AllowPort(0)` in this case. Otherwise
`portmap_for_child.GetNextAvailablePort()` will allocate and never free
the port 0 and next call `portmap_for_child.GetNextAvailablePort()` will
fail.

Added few asserts in `GDBRemoteCommunicationServerPlatform::PortMap` to
avoid such issue in the future.

This patch fixes a bug added in #88845. The behaviour is very close to
#97537 w/o parameters `--min-gdbserver-port`, `--max-gdbserver-port` and
`--gdbserver-port`.
yuxuanchen1997 pushed a commit that referenced this issue Jul 25, 2024
…98833)

Summary:
TestPlatformLaunchGDBServer.py runs `ldb-server` w/o parameters
`--min-gdbserver-port`, `--max-gdbserver-port` or `--gdbserver-port`. So
`gdbserver_portmap` is empty and
`gdbserver_portmap.GetNextAvailablePort()` will return 0. Do not call
`portmap_for_child.AllowPort(0)` in this case. Otherwise
`portmap_for_child.GetNextAvailablePort()` will allocate and never free
the port 0 and next call `portmap_for_child.GetNextAvailablePort()` will
fail.

Added few asserts in `GDBRemoteCommunicationServerPlatform::PortMap` to
avoid such issue in the future.

This patch fixes a bug added in #88845. The behaviour is very close to
#97537 w/o parameters `--min-gdbserver-port`, `--max-gdbserver-port` and
`--gdbserver-port`.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60250877
slydiman added a commit to slydiman/llvm-project that referenced this issue Jul 25, 2024
…t mapping

Removed fork(). Used threads and the common thread-safe port map for all platform connections.

Updated lldb::FileSystem to use llvm::vfs::createPhysicalFileSystem() with an own virtual working directory per thread.

This patch depends on llvm#100659, llvm#100666.

This patch fixes llvm#97537, llvm#90923, llvm#56346.

lldb-server has been tested on Windows with 50 connections and 100 processes launched simultaneously. Tested also the cross build with Linux x86_64 host and Linux Aarch64 target.
slydiman added a commit to slydiman/llvm-project that referenced this issue Jul 31, 2024
…t on Windows

`lldb-server --server` works on Windows now w/o multithreading. The rest functionality remains unchanged.

Added also PipeWindows::WriteWithTimeout(), fixed PipeWindows::ReadWithTimeout() and missing initialization of  m_read_overlapped.hEvent in the constructor PipeWindows(lldb::pipe_t read, lldb::pipe_t write).

Fixes llvm#90923, fixes llvm#56346.

This is the part 1 of the replacement of llvm#100670.

In the part 2 I plan to switch `lldb-server gdbserver` to use --fd and listen a common gdb port for all gdbserver connections. Then we can remove gdb port mapping to fix llvm#97537.
slydiman added a commit to slydiman/llvm-project that referenced this issue Jul 31, 2024
…t on Windows

`lldb-server --server` works on Windows now w/o multithreading. The rest functionality remains unchanged.

Added also PipeWindows::WriteWithTimeout(), fixed PipeWindows::ReadWithTimeout() and missing initialization of  m_read_overlapped.hEvent in the constructor PipeWindows(lldb::pipe_t read, lldb::pipe_t write).

Fixes llvm#90923, fixes llvm#56346.

This is the part 1 of the replacement of llvm#100670.

In the part 2 I plan to switch `lldb-server gdbserver` to use --fd and listen a common gdb port for all gdbserver connections. Then we can remove gdb port mapping to fix llvm#97537.
slydiman added a commit to slydiman/llvm-project that referenced this issue Jul 31, 2024
…t on Windows

`lldb-server platform --server` works on Windows now w/o multithreading. The rest functionality remains unchanged.

Added also PipeWindows::WriteWithTimeout(), fixed PipeWindows::ReadWithTimeout() and missing initialization of  m_read_overlapped.hEvent in the constructor PipeWindows(lldb::pipe_t read, lldb::pipe_t write).

Fixes llvm#90923, fixes llvm#56346.

This is the part 1 of the replacement of llvm#100670.

In the part 2 I plan to switch `lldb-server gdbserver` to use `--fd` and listen a common gdb port for all gdbserver connections. Then we can remove gdb port mapping to fix llvm#97537.
slydiman added a commit to slydiman/llvm-project that referenced this issue Jul 31, 2024
…t on Windows

`lldb-server platform --server` works on Windows now w/o multithreading. The rest functionality remains unchanged.

Added also PipeWindows::WriteWithTimeout(), fixed PipeWindows::ReadWithTimeout() and missing initialization of  m_read_overlapped.hEvent in the constructor PipeWindows(lldb::pipe_t read, lldb::pipe_t write).

Fixes llvm#90923, fixes llvm#56346.

Depends on llvm#101326.

This is the part 1 of the replacement of llvm#100670.

In the part 2 I plan to switch `lldb-server gdbserver` to use `--fd` and listen a common gdb port for all gdbserver connections. Then we can remove gdb port mapping to fix llvm#97537.
slydiman added a commit to slydiman/llvm-project that referenced this issue Jul 31, 2024
…t on Windows

`lldb-server platform --server` works on Windows now w/o multithreading. The rest functionality remains unchanged.

Depends on llvm#101383.

Fixes llvm#90923, fixes llvm#56346.

This is the part 1 of the replacement of llvm#100670.

In the part 2 I plan to switch `lldb-server gdbserver` to use `--fd` and listen a common gdb port for all gdbserver connections. Then we can remove gdb port mapping to fix llvm#97537.
slydiman added a commit to slydiman/llvm-project that referenced this issue Aug 1, 2024
…t mapping

Removed fork(). Used threads and the common thread-safe port map for all platform connections.

Updated lldb::FileSystem to use llvm::vfs::createPhysicalFileSystem() with an own virtual working directory per thread.

This patch depends on llvm#100659, llvm#100666.

This patch fixes llvm#97537, llvm#90923, llvm#56346.

lldb-server has been tested on Windows with 50 connections and 100 processes launched simultaneously. Tested also the cross build with Linux x86_64 host and Linux Aarch64 target.
slydiman added a commit to slydiman/llvm-project that referenced this issue Aug 6, 2024
`lldb-server platform --server` works on Windows now w/o multithreading. The rest functionality remains unchanged.

Fixes llvm#90923, fixes llvm#56346.

This is the part 1 of the replacement of llvm#100670.

In the part 2 I plan to switch `lldb-server gdbserver` to use `--fd` and listen a common gdb port for all gdbserver connections. Then we can remove gdb port mapping to fix llvm#97537.
slydiman added a commit that referenced this issue Aug 12, 2024
#101283)

`lldb-server platform --server` works on Windows now w/o multithreading.
The rest functionality remains unchanged.

Fixes #90923, fixes #56346.

This is the part 1 of the replacement of #100670.

In the part 2 I plan to switch `lldb-server gdbserver` to use `--fd` and
listen a common gdb port for all gdbserver connections. Then we can
remove gdb port mapping to fiх #97537.
slydiman added a commit to slydiman/llvm-project that referenced this issue Aug 14, 2024
Listen to gdbserver-port, accept the connection and run `lldb-server gdbserver --fd` on all platforms.
Added acceptor_gdb and gdb_thread to lldb-platform.cpp
SharedSocket has been moved to ConnectionFileDescriptorPosix.

Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537.
slydiman added a commit to slydiman/llvm-project that referenced this issue Aug 14, 2024
Listen to gdbserver-port, accept the connection and run `lldb-server gdbserver --fd` on all platforms.
Added acceptor_gdb and gdb_thread to lldb-platform.cpp
SharedSocket has been moved to ConnectionFileDescriptorPosix.

Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537, fixes llvm#101475.
slydiman added a commit to slydiman/llvm-project that referenced this issue Aug 16, 2024
Listen to gdbserver-port, accept the connection and run `lldb-server gdbserver --fd` on all platforms.
Added acceptor_gdb and gdb_thread to lldb-platform.cpp
SharedSocket has been moved to ConnectionFileDescriptorPosix.

Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537, fixes llvm#101475.
slydiman added a commit to slydiman/llvm-project that referenced this issue Aug 26, 2024
Listen to gdbserver-port, accept the connection and run lldb-server gdbserver --fd on all platforms.
Refactored Acceptor to listen on 2 ports in the main thread.

Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537, fixes llvm#101475.
slydiman added a commit to slydiman/llvm-project that referenced this issue Aug 30, 2024
Listen to gdbserver-port, accept the connection and run lldb-server gdbserver --fd on all platforms.
Refactored Acceptor to listen on 2 ports in the main thread.

Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537, fixes llvm#101475.
slydiman added a commit to slydiman/llvm-project that referenced this issue Aug 30, 2024
Listen to gdbserver-port, accept the connection and run lldb-server gdbserver --fd on all platforms.
Refactored Acceptor to listen on 2 ports in the main thread.

Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537, fixes llvm#101475.
slydiman added a commit to slydiman/llvm-project that referenced this issue Sep 3, 2024
Listen to gdbserver-port, accept the connection and run lldb-server gdbserver --fd on all platforms.
Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283. Depends on llvm#106955.

Fixes llvm#97537, fixes llvm#101475.
slydiman added a commit to slydiman/llvm-project that referenced this issue Sep 3, 2024
Listen to gdbserver-port, accept the connection and run lldb-server gdbserver --fd on all platforms.
Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537, fixes llvm#101475.
slydiman added a commit to slydiman/llvm-project that referenced this issue Sep 6, 2024
Listen to gdbserver-port, accept the connection and run lldb-server gdbserver --fd on all platforms.
Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537, fixes llvm#101475.
slydiman added a commit to slydiman/llvm-project that referenced this issue Sep 6, 2024
Listen to gdbserver-port, accept the connection and run lldb-server gdbserver --fd on all platforms.
Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537, fixes llvm#101475.
slydiman added a commit to slydiman/llvm-project that referenced this issue Sep 13, 2024
Listen to gdbserver-port, accept the connection and run lldb-server gdbserver --fd on all platforms.
Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of llvm#101283.

Fixes llvm#97537, fixes llvm#101475.
adrian-prantl pushed a commit to adrian-prantl/llvm-project that referenced this issue Oct 11, 2024
llvm#101283)

`lldb-server platform --server` works on Windows now w/o multithreading.
The rest functionality remains unchanged.

Fixes llvm#90923, fixes llvm#56346.

This is the part 1 of the replacement of llvm#100670.

In the part 2 I plan to switch `lldb-server gdbserver` to use `--fd` and
listen a common gdb port for all gdbserver connections. Then we can
remove gdb port mapping to fiх llvm#97537.

(cherry picked from commit 82ee31f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants