[all-commits] [llvm/llvm-project] d1bf19: Send an explicit interrupt to cancel an attach wai...

jimingham via All-commits all-commits at lists.llvm.org
Thu Nov 30 09:48:20 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1bf1947e4e4f3ef75f2ba3ac9aa77dc38214de1
      https://github.com/llvm/llvm-project/commit/d1bf1947e4e4f3ef75f2ba3ac9aa77dc38214de1
  Author: jimingham <jingham at apple.com>
  Date:   2023-11-30 (Thu, 30 Nov 2023)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    M lldb/source/Target/Process.cpp
    A lldb/test/API/python_api/process/cancel_attach/TestCancelAttach.py
    M lldb/tools/debugserver/source/DNB.cpp

  Log Message:
  -----------
  Send an explicit interrupt to cancel an attach waitfor. (#72565)

Currently when you interrupt a:

(lldb) process attach -w -n some_process

lldb just closes the connection to the stub and kills the
lldb_private::Process it made for the attach. The stub at the other end
notices the connection go down and exits because of that. But when
communication to a device is handled through some kind of proxy server
which isn't as well behaved as one would wish, that signal might not be
reliable, causing debugserver to persist on the machine, waiting to
steal the next instance of that process.

We can work around those failures by sending an explicit interrupt
before closing down the connection. The stub will also have to be
waiting for the interrupt for this to make any difference. I changed
debugserver to do that.

I didn't make the equivalent change in lldb-server. So long as you
aren't faced with a flakey connection, this should not be necessary.




More information about the All-commits mailing list