[lldb-dev] [Bug 24958] New: lldb::SBDebugger::Terminate() results in Deadlock

via lldb-dev lldb-dev at lists.llvm.org
Mon Sep 28 02:51:13 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24958

            Bug ID: 24958
           Summary: lldb::SBDebugger::Terminate() results in Deadlock
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: kratochwil at teco.edu
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 14945
  --> https://llvm.org/bugs/attachment.cgi?id=14945&action=edit
Complete debug log, backtrace is at the end. The questionable mutex is
0x7ffff7dc2fc0.

While using the C++ API (Scripting Bridge) of lldb (svn revision 247535), the
following (abbreviated) call sequence results in a Deadlock:

  lldb_debugger = lldb::SBDebugger::Create()
  lldb_debugger.SetAsync(true)
  lldb_target = lldb_debugger.CreateTarget()
  lldb_process = lldb_target.AttachToProcessWithID()
  ... (doing stuff with modules)
  lldb::SBDebugger::Terminate()

I compiled Mutex.cpp with both debug macros DEBUG_LOG and
ENABLE_MUTEX_ERROR_CHECKING enabled - the latter results in my program
receiving a SIGABRT instead of a deadlock, due to the mutex error checking
code.

I noticed that the call to lldb_private::Debugger::Terminate() ends up in
lldb_private::Mutex::Lock(). Here a mutex is being locked which was already
locked / unlocked a few times earlier (see attachment: the mutex has the ID
0x7ffff7dc2fc0).

I know that my code worked with svn revision 229496 (tested it a few hours
ago).

The debug log is quite lengthy - sorry for that. At the bottom you'll find a
complete gdb backtrace.

I'll recompile lldb without the error checking macros to see if there is more
than one thread running when the deadlock occurs. I'll be back in a minute...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150928/a4b78eb9/attachment.html>


More information about the lldb-dev mailing list