<div dir="ltr">Yes, I think there are several bits strange in the process/thread startup on the Linux side.  I'm hoping to clean much of that up in the NativeProcessLinux code.  I think it might be cruft related to the two-step startup that Linux uses for threads, where the thread itself announces that it is created to the superior, and the main process thread also notifies the superior, with no guarantee of the order of arrival, and both must finish arriving before the existing code can run without getting confused.  (This is a guess based on my diving into the code for NativeProcessLinux). I think a little state machine there might allow that bit to be cleaned up without the dancing it currently does.<div>
<br></div><div>This is really a temporary work-around just to get tests out of the hung state on Linux.</div><div><br></div><div>I expect some combination of Ed on FreeBSD or Luke at Codeplay (not sure what platform) to address with one of their patches in the works, or something I can adapt to Linux.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 18, 2014 at 10:17 AM,  <span dir="ltr"><<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is okay as a workaround, but I am not sure why Linux threads are being created in the state eStateSuspended.  That state is for what the user directs the thread to do (SBThread::Suspend() and SBThread::Resume() for instance.)  It seems weird that this should be starting out as suspended.<br>

<span class="HOEnZb"><font color="#888888"><br>
Jim<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Apr 18, 2014, at 10:01 AM, Todd Fiala <<a href="mailto:tfiala@google.com">tfiala@google.com</a>> wrote:<br>
<br>
> Author: tfiala<br>
> Date: Fri Apr 18 12:01:01 2014<br>
> New Revision: 206618<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=206618&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=206618&view=rev</a><br>
> Log:<br>
> Address hung tests in Linux.<br>
><br>
> Follow-up patch coming to address test failures exposed by this change.<br>
><br>
><br>
> Modified:<br>
>    lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp<br>
><br>
> Modified: lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp?rev=206618&r1=206617&r2=206618&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp?rev=206618&r1=206617&r2=206618&view=diff</a><br>

> ==============================================================================<br>
> --- lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp (original)<br>
> +++ lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp Fri Apr 18 12:01:01 2014<br>
> @@ -110,7 +110,7 @@ POSIXThread::RefreshStateAfterStop()<br>
>         GetRegisterContext()->InvalidateIfNeeded (force);<br>
>     }<br>
>     // FIXME: This should probably happen somewhere else.<br>
> -    SetResumeState(eStateRunning);<br>
> +    SetResumeState(eStateRunning, true);<br>
>     Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD));<br>
>     if (log)<br>
>         log->Printf ("POSIXThread::%s (tid = %" PRIi64 ") setting thread resume state to running", __FUNCTION__, GetID());<br>
><br>
><br>
> _______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>