[Lldb-commits] [PATCH] D135516: [lldb] [MainLoopPosix] Fix crash upon adding lots of pending callbacks

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 10 09:09:08 PDT 2022


mgorny added a comment.

In D135516#3846182 <https://reviews.llvm.org/D135516#3846182>, @labath wrote:

> I never expected we would have so many callbacks that we'd have to worry about this, but yes, this is one way to fix the problem. Another (slightly simpler, but also less performant) would be to make the write pipe nonblocking, and do not treat EAGAIN as an error.

Well, I've only hit this in a pathological case (sending a lot of small packets without checking whether the loop in the communication thread didn't exit) but I've figured out we want some protection anyway.

The pipe logic uses select helper anyway, so it does return a timeout error if the buffer is full. However, I've figured that it'd be better to avoid polluting the buffer with tons of "interrupts" if only one is really meaningful.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135516/new/

https://reviews.llvm.org/D135516



More information about the lldb-commits mailing list