labath wrote:

> BTW, I have figured out a side effect. MainLoopWindows uses events created by 
> WSACreateEvent(). WSACreateEvent() creates the `manual-reset` event. But 
> WSAResetEvent() is used only for m_trigger_event. All other events (READ, 
> ACCEPT, CLOSE) are never reset. I have no idea how it worked before. But I 
> got thousands of error messages using this patch with lldb-server after first 
> connection:
> 
> ```
> AcceptSocket(): A non-blocking socket operation could not be completed 
> immediately
> ```
> 
> I have added `WSAResetEvent(KV.second.event);` before 
> `ProcessReadObject(KV.first);` in MainLoopWindows.cpp to fix it. It seems 
> this issue must be fixed before or with this patch, otherwise it will break 
> the Windows build.


Oops. Thanks for catching that. I think have a pretty good idea of how this 
worked before. For accepts, we were always creating a fresh MainLoop instance 
(and a WSAEvent to go along with it), so this wasn't an issue. And for reads, 
we probably were just spinning in a busy loop after the first read event.

I've created #107061 to fix that.

https://github.com/llvm/llvm-project/pull/106955
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to