[lldb-dev] lldb crash while single-stepping remote target

Beverly Trahan via lldb-dev lldb-dev at lists.llvm.org
Thu Apr 20 09:35:42 PDT 2017


Hi, been seeing an issue very frequently while single-stepping a remote multithreaded iOS target.  Host is OS X. The crash is in ProcessGDBRemote::WillPublicStop, close to NULL.  I downloaded the latest source from git and compiled a debug version.  Same scenario crashed in assertion in GetItemAtIndex, idx < GetSize().  The issue appears to be a race between (ProcessGDBRemote.cpp):

here>      const size_t n = thread_infos->GetSize();
      for (size_t i = 0; i < n; ++i) {
here>        StructuredData::Dictionary *thread_dict =
            thread_infos->GetItemAtIndex(i)->GetAsDictionary();


For testing, I added:
std::lock_guard<std::recursive_mutex> guard(m_thread_list_real.GetMutex());

To first line of ProcessGDBRemote::WillPublicStop.  Seemed to resolve my issue, but have not tested extensively.

Best regards,

Braden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170420/a5ed904b/attachment-0001.html>


More information about the lldb-dev mailing list