diff options
author | Emre Kultursay <emrekultursay@google.com> | 2023-02-23 12:55:25 +0100 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2023-05-01 21:24:14 -0700 |
commit | 3cc0a562969b1183836ef17cce913644db76de9b (patch) | |
tree | 2ac51883d94b09584753399b5a748b6b981007f8 | |
parent | 5db6c9daf03306cc368da3a36a964e551c1d005d (diff) | |
download | llvm-3cc0a562969b1183836ef17cce913644db76de9b.zip llvm-3cc0a562969b1183836ef17cce913644db76de9b.tar.gz llvm-3cc0a562969b1183836ef17cce913644db76de9b.tar.bz2 |
Clear read_fd_set if EINTR received
Leaving bits uncleared set causes callbacks to be triggered even
though there are no events to process. Starting with D131160
we have a callback that makes blocking read calls over pipe which
was causing the lldb-server main loop to become unresponsive / blocked
on Android.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D144240
-rw-r--r-- | lldb/source/Host/posix/MainLoopPosix.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Host/posix/MainLoopPosix.cpp b/lldb/source/Host/posix/MainLoopPosix.cpp index b185c3d..5b50b45 100644 --- a/lldb/source/Host/posix/MainLoopPosix.cpp +++ b/lldb/source/Host/posix/MainLoopPosix.cpp @@ -156,9 +156,12 @@ Status MainLoopPosix::RunImpl::Poll() { size_t sigset_len; } extra_data = {&kernel_sigset, sizeof(kernel_sigset)}; if (syscall(__NR_pselect6, nfds, &read_fd_set, nullptr, nullptr, nullptr, - &extra_data) == -1 && - errno != EINTR) - return Status(errno, eErrorTypePOSIX); + &extra_data) == -1) { + if (errno != EINTR) + return Status(errno, eErrorTypePOSIX); + else + FD_ZERO(&read_fd_set); + } return Status(); } |