[all-commits] [llvm/llvm-project] 460556: [ORC] Shutdown the socket FD before closing it in ...

Min-Yih Hsu via All-commits all-commits at lists.llvm.org
Tue May 26 10:29:03 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 460556ae66e45b203f49c1c43878b4e0ef6d0f49
      https://github.com/llvm/llvm-project/commit/460556ae66e45b203f49c1c43878b4e0ef6d0f49
  Author: Min-Yih Hsu <min.hsu at sifive.com>
  Date:   2026-05-26 (Tue, 26 May 2026)

  Changed paths:
    M llvm/lib/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.cpp

  Log Message:
  -----------
  [ORC] Shutdown the socket FD before closing it in FDSimpleRemoteEPCTransport (#196835)

It is totally possible that when
`FDSimpleRemoteEPCTransport::disconnect` is called,
`FDSimpleRemoteEPCTransport::listenLoop` is still reading on the socket
FD the former is closing. On Linux, closing a socket FD when it is being
read by another thread is an undefined behavior I believe. And on modern
kernels, the reading thread will not be waken up, so `listenLoop` will
be blocked forever and preventing the process from exiting.

This patch fixes this issue by calling `shutdown(2)` on the socket FDs
before closing them.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list