<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - lldb::SBDebugger::Terminate() results in Deadlock"
href="https://llvm.org/bugs/show_bug.cgi?id=24958">24958</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lldb::SBDebugger::Terminate() results in Deadlock
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kratochwil@teco.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=14945" name="attach_14945" title="Complete debug log, backtrace is at the end. The questionable mutex is 0x7ffff7dc2fc0.">attachment 14945</a> <a href="attachment.cgi?id=14945&action=edit" title="Complete debug log, backtrace is at the end. The questionable mutex is 0x7ffff7dc2fc0.">[details]</a></span>
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...</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>