[release/6.0][EventPipe] Fix reverse connection socket leaking to child processes...
authorJuan Hoyos <juan.s.hoyos@outlook.com>
Tue, 8 Mar 2022 21:50:04 +0000 (13:50 -0800)
committerGitHub <noreply@github.com>
Tue, 8 Mar 2022 21:50:04 +0000 (13:50 -0800)
commit154cbb0788f5393bb262060403aef606acc28783
treee9cf798ef7603ebe2c459e60a60ac9ab00ee396c
parent21ec8d3d7c43ae33fe5051719cb73dfbeef14cd1
[release/6.0][EventPipe] Fix reverse connection socket leaking to child processes. (#65768)

* [release/6.0][EventPipe] Fix reverse connection socket leaking to child processes.

Sockets were getting leaked upon accepting connections. This meant that child processes could cause
fully terminated tracing sessions and other IPC connections alive, causing clients to wait for input
indefinitely. This sets the CLOEXEC bits on the socket atomically upon accepting if the OS provides
the capability, falling back to a best effort fcntl on systems like macOS and x866 Android emulators.

Port of dotnet/runtime#65365 to release/6.0.

* Include well know cmake paths
src/coreclr/CMakeLists.txt
src/coreclr/debug/debug-pal/CMakeLists.txt
src/coreclr/vm/eventing/eventpipe/CMakeLists.txt
src/mono/mono/eventpipe/CMakeLists.txt
src/native/eventpipe/configure.cmake [new file with mode: 0644]
src/native/eventpipe/ds-ipc-pal-socket.c
src/native/eventpipe/ep-rt-config.h
src/native/eventpipe/ep-shared-config.h.in [new file with mode: 0644]