Skip to content

Commit 3cc0a56

Browse files
emrekultursaytstellar
authored andcommitted
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
1 parent 5db6c9d commit 3cc0a56

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lldb/source/Host/posix/MainLoopPosix.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ Status MainLoopPosix::RunImpl::Poll() {
156156
size_t sigset_len;
157157
} extra_data = {&kernel_sigset, sizeof(kernel_sigset)};
158158
if (syscall(__NR_pselect6, nfds, &read_fd_set, nullptr, nullptr, nullptr,
159-
&extra_data) == -1 &&
160-
errno != EINTR)
161-
return Status(errno, eErrorTypePOSIX);
159+
&extra_data) == -1) {
160+
if (errno != EINTR)
161+
return Status(errno, eErrorTypePOSIX);
162+
else
163+
FD_ZERO(&read_fd_set);
164+
}
162165

163166
return Status();
164167
}

0 commit comments

Comments
 (0)