[all-commits] [llvm/llvm-project] 9aa6a4: [lldb] Fix crash when launching in terminal

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Thu Apr 28 14:39:56 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9aa6a479738c7bf21128f9c45ea4ffcf82d80cbf
      https://github.com/llvm/llvm-project/commit/9aa6a479738c7bf21128f9c45ea4ffcf82d80cbf
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
    M lldb/unittests/Host/ConnectionFileDescriptorTest.cpp

  Log Message:
  -----------
  [lldb] Fix crash when launching in terminal

This patch fixes a crash when using process launch -t to launch the
inferior from a TTY. The issue is that on Darwin, Host.mm is calling
ConnectionFileDescriptor::Connect without a socket_id_callback_type. The
overload passes nullptr as the function ref, which gets called
unconditionally as the socket_id_callback.

One potential way to fix this is to change all the lambdas to include a
null check, but instead I went with an empty lambda.

Differential revision: https://reviews.llvm.org/D124535




More information about the All-commits mailing list