llvm-project/lldb/source/Host
Michał Górny e8ee0f121d [lldb] [MainLoopPosix] Fix crash upon adding lots of pending callbacks
If lots of pending callbacks are added while the main loop has exited
already, the trigger pipe buffer fills in, causing the write to fail
and the related assertion to fail.  To avoid this, add a boolean member
indicating whether the callbacks have been triggered already.
If the trigger was done, avoid writing to the pipe until loops proceeds
to run them and resets the variable.

Besides fixing the issue, this also avoids writing to the pipe multiple
times if callbacks are added faster than the loop is able to process
them.  Previously, this would lead to the loop performing multiple read
iterations from pipe unnecessarily.

Sponsored by: The FreeBSD Foundation

Differential Revision: https://reviews.llvm.org/D135516
2022-10-17 17:48:44 +02:00
..
android [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
common [LLDB] Change RegisterValue::SetFromMemoryData to const RegisterInfo& 2022-10-12 08:10:24 +00:00
freebsd Modernize and simplify HostInfo::GetOSKernelDescription 2021-10-26 11:17:02 +02:00
linux [clang][lldb][cmake] Use new `*_INSTALL_LIBDIR_BASENAME` CPP macro 2022-08-20 12:52:21 -04:00
macosx Change the meaning of a UUID with all zeros for data. 2022-08-30 10:17:58 -07:00
netbsd [lldb] Remove remaining calls to DataBufferLLVM::GetChars 2022-04-01 17:43:05 -07:00
openbsd Modernize and simplify HostInfo::GetOSKernelDescription 2021-10-26 11:17:02 +02:00
posix [lldb] [MainLoopPosix] Fix crash upon adding lots of pending callbacks 2022-10-17 17:48:44 +02:00
windows [lldb] Fix warnings about unused variables when building without asserts. NFC. 2022-10-01 14:27:48 +03:00
CMakeLists.txt [lldb] Use WSAEventSelect for MainLoop polling on windows 2022-08-19 13:25:25 +02:00