[Lldb-commits] [PATCH] D144240: Clear read_fd_set if EINTR received
Emre Kultursay via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 16 23:09:18 PST 2023
emrekultursay created this revision.
Herald added a project: All.
emrekultursay requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Leaving bits uncleared set causes callbacks to be triggered even
though there are no events to process. Starting with D131160 <https://reviews.llvm.org/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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D144240
Files:
lldb/source/Host/posix/MainLoopPosix.cpp
Index: lldb/source/Host/posix/MainLoopPosix.cpp
===================================================================
--- lldb/source/Host/posix/MainLoopPosix.cpp
+++ lldb/source/Host/posix/MainLoopPosix.cpp
@@ -156,9 +156,12 @@
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();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144240.498256.patch
Type: text/x-patch
Size: 677 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230217/fd954b35/attachment.bin>
More information about the lldb-commits
mailing list