[all-commits] [llvm/llvm-project] 953ddd: [lldb] Handle malformed qfThreadInfo reply

tedwoodward via All-commits all-commits at lists.llvm.org
Thu Sep 23 15:04:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 953ddded1aa2b459a939e0f1649691c9086ba416
      https://github.com/llvm/llvm-project/commit/953ddded1aa2b459a939e0f1649691c9086ba416
  Author: Ted Woodward <tedwood at quicinc.com>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    A lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py

  Log Message:
  -----------
  [lldb] Handle malformed qfThreadInfo reply

If the remote gdbserver's qfThreadInfo reply has a trailing comma,
GDBRemoteCommunicationClient::GetCurrentProcessAndThreadIDs will return
an empty vector of thread ids. This will cause lldb to recurse through
three functions trying to get the list of threads, until it blows its
stack and crashes.

A trailing comma is a malformed response, but it shouldn't cause lldb to
crash. This patch will return the tids received before the malformed
response.

Reviewed By: clayborg, labath

Differential Revision: https://reviews.llvm.org/D109937




More information about the All-commits mailing list