<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Yeah, I had done that, thanks. <div>Just wanted to find out if it’s just us with the issue as didn’t see anything mentioned on the list.<div><br><div><div>On 7 Aug 2014, at 22:26, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Ahh, I see.  Can you just put an #ifdef _WIN32 that doesn't add the pipe_fd to the fd_set for Windows?  It's broken either way, but at least this way it's less broken.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Aug 7, 2014 at 2:25 PM, Deepak Panickal <span dir="ltr"><<a href="mailto:deepak@codeplay.com" target="_blank">deepak@codeplay.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>Yes, we have a regression in behaviour.</div><div><br></div><div>Before _pipe() was added, pipes were ignored on Windows. They were not added to the read_fds list for select(). So, the BytesAvailable() did not error.</div>
<div><br></div><div>However, now since pipes are created, it is added to the read_fds list and then select() fails like you said, because it is not a socket. It fails with a WSAENOTSOCK error. Due to this, the BytesAvailable() errors out and no data is read from the remote socket connection. </div>
<div><br></div><div>I only found this after the merge, as we were not able to read data from our remote debug stub.</div><div><div class="h5"><br><div><div>On 7 Aug 2014, at 22:15, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr">Yes, that's correct.  It's just that on Windows, select() won't accept a pipe, it will just return an error.  Which we also don't handle correctly, it turns out, since we assume that the error it's returning is an errno, which on Windows it's not.  <div>

<br></div><div>That said, I'm pretty sure ConnectionFileDescriptor has never worked on Windows.  Are you seeing a regression in behavior?  i.e. something worked before you merged, but now it doesn't?</div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Thu, Aug 7, 2014 at 2:06 PM, Deepak Panickal <span dir="ltr"><<a href="mailto:deepak@codeplay.com" target="_blank">deepak@codeplay.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">Ah, so it is a known issue. Thanks, got it now.<div>We recently did a merge which brought in the new changes from upstream.</div><div><br></div><div>Isn’t the ::select used in ConnectionFileDescriptor to wait till input is available? </div>

<div>Not just from the command pipe, but also from the sockets.</div><div><div><br></div><div><div>On 7 Aug 2014, at 21:38, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div>

<br><blockquote type="cite"><div dir="ltr">Sorry, hit enter too soon.  I have been thinking about next steps for fixing this in the longer term.  I think the way to go is that on Windows, ConnectionFileDescriptor shouldn't even use select at all, nor should it use the command pipe.  The purpose of the command pipe seems to be so that various interrupt commands can be sent to interrupt the select, and then terminate the connection or something else so that it doesn't block forever.<div>


<br></div><div>On Windows, the closest equivalent to select is WaitForMultipleObjects.  So I think on Windows we need to switch to using WFMO instead of select().  The command pipe will be replaced by various event objects, which the user will set according to which interruption command they want to send.  WFMO doesn't accept sockets though, so we need to call WSAEventSelect() to get an event handle corresponding to read/write operations on the socket.</div>


<div><br></div><div>There's numerous other portability issues with this class currently, most notably that select() on windows doesn't set errno</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">


On Thu, Aug 7, 2014 at 1:34 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr">This is a known issue.  But I don't think this is a regression.  It's just always been this way.  Basically on Windows, select() only deals with sockets.  It doesn't work with pipes, files, or anything else.  In other words, ConnectionFileDescriptor is just fundamentally broken on Windows.  I recently pushed a large refactor to the socket logic in ConnectionFileDescriptor which is aimed at addressing this.  But it's only one step of what I think will be a long process to get ConnectionFileDescriptor working on Windows.</div>


<div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 7, 2014 at 1:01 PM, Deepak Panickal <span dir="ltr"><<a href="mailto:deepak@codeplay.com" target="_blank">deepak@codeplay.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
I have been seeing an issue with the refactored pipe support changes on Windows using _pipe().<br>
<br>
This is specifically at the ::select function in ConnectionFileDescriptor::BytesAvailable().<br>
On Windows, the ::select fails if the pipe file descriptor is also included and so the connection fails.<br>
<br>
<a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionFileDescriptor.cpp?view=markup" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionFileDescriptor.cpp?view=markup</a><br>




<br>
Wanted to ask if anybody else on Windows is seeing any such issue?<br>
<br>
Thanks,<br>
Deepak<br>
<br>
<br>
_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
</blockquote></div><br></div>
</div></blockquote></div><br></div>
</blockquote></div><br></div></div></blockquote></div><br></div>
</blockquote></div><br></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div></div></body></html>