[Lldb-commits] [lldb] r206618 - Address hung tests in Linux.

Todd Fiala tfiala at google.com
Fri Apr 18 10:26:10 PDT 2014


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.

This is really a temporary work-around just to get tests out of the hung
state on Linux.

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.


On Fri, Apr 18, 2014 at 10:17 AM, <jingham at apple.com> wrote:

> 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.
>
> Jim
>
> On Apr 18, 2014, at 10:01 AM, Todd Fiala <tfiala at google.com> wrote:
>
> > Author: tfiala
> > Date: Fri Apr 18 12:01:01 2014
> > New Revision: 206618
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=206618&view=rev
> > Log:
> > Address hung tests in Linux.
> >
> > Follow-up patch coming to address test failures exposed by this change.
> >
> >
> > Modified:
> >    lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp
> >
> > Modified: lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp?rev=206618&r1=206617&r2=206618&view=diff
> >
> ==============================================================================
> > --- lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp (original)
> > +++ lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp Fri Apr 18
> 12:01:01 2014
> > @@ -110,7 +110,7 @@ POSIXThread::RefreshStateAfterStop()
> >         GetRegisterContext()->InvalidateIfNeeded (force);
> >     }
> >     // FIXME: This should probably happen somewhere else.
> > -    SetResumeState(eStateRunning);
> > +    SetResumeState(eStateRunning, true);
> >     Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet
> (POSIX_LOG_THREAD));
> >     if (log)
> >         log->Printf ("POSIXThread::%s (tid = %" PRIi64 ") setting thread
> resume state to running", __FUNCTION__, GetID());
> >
> >
> > _______________________________________________
> > lldb-commits mailing list
> > lldb-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>
>


-- 
Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140418/4d01c1f8/attachment.html>


More information about the lldb-commits mailing list