<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/125471>125471</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLDB cannot interrupt process on Windows Subsystem for Linux 1 (WSL1)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          DavidSpickett
      </td>
    </tr>
</table>

<pre>
    Originally reported here - https://discourse.llvm.org/t/process-launched-but-nothing-is-displayed-and-it-never-stop/84334

And confirmed here - https://discourse.llvm.org/t/process-launched-but-nothing-is-displayed-and-it-never-stop/84334/9

On Ubuntu Noble running on WSL1, LLDB can place breakpoints but never hits them and cannot interrupt the process.

```
# lldb main.o
(lldb) target create "main.o"
Current executable set to '/mnt/c/Users/tcwg/main.o' (aarch64).
(lldb) b main
Breakpoint 1: where = main.o`main at main.c:1:21, address = 0x0000000000000714
(lldb) run
Process 71 launched: '/mnt/c/Users/tcwg/main.o' (aarch64)
sdfsdfsdfsdfsdfdf
errwerwerewr
wer
werwProcess 71 exited with status = -1 (0xffffffff) lost connection
```
The breakpoint is placed (the logs are from lldb-server not lldb):
```
(lldb) b main
<...>
1738348179.135508537 NativeProcessProtocol.cpp:SetSoftwareBreakpoint              addr = 0x8000714, size_hint = 4
1738348179.231178999 NativeProcessProtocol.cpp:EnableSoftwareBreakpoint           Overwriting bytes at 0x8000714: 0x0, 0x0, 0x80, 0x52
1738348179.298000574 NativeProcessProtocol.cpp:EnableSoftwareBreakpoint           addr = 0x8000714: SUCCESS
1738348179.356645584 Communication.cpp:Write 0x00007FFFC9497EA0 Communication::Write (src = 0x00007FFFC9497A20, src_len = 6) connection = 0x00007FFFC0F4F190
1738348179.421146154 ConnectionFileDescriptorPosix.cpp:Write                      0x7fffc0f4f190 ConnectionFileDescriptor::Write (src = 0x7fffc9497a20, src_len = 6)
1738348179.498412848 Socket.cpp:Write 0x7fffc0f4ee00 Socket::Write() (socket = 13, src = 0x7fffc9497a20, src_len = 6, flags = 0) => 6 (error = (null))
Breakpoint 1: where = main.o`main at main.c:1:21, address = 0x00000000080007141738348179.545132637 ConnectionFileDescriptorPosix.cpp:Write                      0x7fffc0f4f190 ConnectionFileDescriptor::Write(fd = 13, src = 0x7fffc9497a20, src_len = 6) => 6 (error = (null))
```
But it is never hit:
```
(lldb) process interrupt
1738348372.668609142 Communication.cpp:Read this = 0x00007FFFDD884DB0, dst = 0x00007FFFDD8829E0, dst_len = 8192, timeout = 0 us, connection = 0x00007FFFD5FBC190
1738348372.716999054 ConnectionFileDescriptorPosix.cpp:BytesAvailable             this = 0x00007FFFD5FBC190, timeout = 0 us
1738348372.780571938 Socket.cpp:Read 0x7fffd5fbbe00 Socket::Read() (socket = 13, src = 0x7fffdd8829e0, src_len = 1, flags = 0) => 1 (error = (null))
1738348372.826256752 ConnectionFileDescriptorPosix.cpp:Read 0x7fffd5fbc190 ConnectionFileDescriptor::Read()  fd = 13, dst = 0x7fffdd8829e0, dst_len = 8192) => 1, error = (null)
1738348372.882876873 NativeThreadLinux.cpp:RequestStop NativeThreadLinux::RequestStop requesting thread stop(pid: 257, tid: 257)
1738348372.934549093 GDBRemoteCommunicationServerLLGS.cpp:Handle_interrupt        stopped process 257
1738348372.968108654 Communication.cpp:Read this = 0x00007FFFDD884DB0, dst = 0x00007FFFDD8829E0, dst_len = 8192, timeout = 0 us, connection = 0x00007FFFD5FBC190
1738348373.011626482 ConnectionFileDescriptorPosix.cpp:BytesAvailable             this = 0x00007FFFD5FBC190, timeout = 0 us
error: Failed to halt process: Halt timed out. State = running1738348392.690753222 Communication.cpp:Read this = 0x00007FFFDD884DB0, dst = 0x00007FFFDD8829E0, dst_len = 8192, timeout = 0 us, connection = 0x00007FFFD5FBC190

1738348392.759705782 ConnectionFileDescriptorPosix.cpp:BytesAvailable             this = 0x00007FFFD5FBC190, timeout = 0 us
(1738348392.858328104 Socket.cpp:Read 0x7fffd5fbbe00 Socket::Read() (socket = 13, src = 0x7fffdd8829e0, src_len = 0, flags = 0) => 0 (error = (null))
l1738348393.011292458 ConnectionFileDescriptorPosix.cpp:Read 0x7fffd5fbc190 ConnectionFileDescriptor::Read()  fd = 13, dst = 0x7fffdd8829e0, dst_len = 8192) => 0, error = (null)
l1738348393.153278828 Communication.cpp:Disconnect 0x00007FFFDD884DB0 Communication::Disconnect ()
d1738348393.293807507 ConnectionFileDescriptorPosix.cpp:Disconnect                 0x7fffd5fbc190 ConnectionFileDescriptor::Disconnect ()
b1738348393.403239965 Socket.cpp:Close                                             0x7fffd5fbbe00 Socket::Close (fd = 13)
)
lldb-server exiting...
```
Some versions of GDB do work but it's unknown why.

**Switching to WSL2 resolves the issue.**

It seems like Microsoft still supports WSL1, but the solution to some issues is "use WSL2". So this is unlikely to be fixed in LLDB, but here it is for future reference and anyone coming in from Google.

If anyone wants to investigate this, I would use a combination of adding a bunch of printfs into lldb-server, and tracing gdbserver to understand whether it actually copes with this problem, or just avoids it accidentally.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUWNtyIjkS_Rr5RQGhkur6wAMG09MR3umOYTr6sUOUskDThcRKKrD36zdSVZhLY69j9tI7FYQxpUuek3lSSkl6r9cGYEKye5LN72QXNtZN5nKv1XKn6-8Qwt3KqufJJ6fX2si2faYOdtYFUHQDDuiIbkLYeSKmhC8IXyjta9s5D-O23W_H1q0JXwTCFztna_B-1MrO1BtQo1UXRsaGjTbrkfYjpf2ulc-gRtKokQ4jA3twIx_sjvBFmQqREjYlbDo1itbWNNptfwoIvqh6IJ8M_bLqTOjor3bVAnWdMdqsqTX06_IxIXxGHx_n97SWhu5aWQNdOZDfd1ab4OmqCzTOTjc6eBo2sKUSqUljbKDaBHCu2wVsoQPucW-Y5Gz4sCnhgratWtGt1GZs45sSXxBe0SDdGgKtHcgAlHA-dOKcsOmscw5MoPAEdRckMvAQaLCU8ILwxdagx2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