<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 python API segfaults during debugger teardown"
   href="https://llvm.org/bugs/show_bug.cgi?id=27639">27639</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLDB python API segfaults during debugger teardown
          </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>All
          </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>progers7@gatech.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>I'm hitting a segfault with a very simple python script using the lldb api:

Python script:
---------8<---------
import lldb
if __name__ == "__main__":
    debugger = lldb.SBDebugger.Create()
    target = debugger.CreateTarget("helloworld")
---------8<---------

helloworld.cpp is just a blank executable compiled with "g++ helloworld.cpp -o
helloworld".

Crash details:
"Python quit unexpectedly while using the _lldb.so plugin."
Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000008
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.python.python                 0x000000010f6a9fce 0x10f609000 + 659406
1   org.python.python                 0x000000010f6aa481 PyGILState_Ensure + 55
2   _lldb.so                          0x0000000112da937a
lldb_private::ScriptInterpreterPython::Locker::DoAcquireLock() + 28
3   _lldb.so                          0x0000000112daea6b
lldb_private::ScriptInterpreterPython::Clear() + 37
4   _lldb.so                          0x0000000112ae9510
lldb_private::Debugger::Clear() + 266
5   _lldb.so                          0x0000000112aea8ec
lldb_private::Debugger::~Debugger() + 28
6   _lldb.so                          0x0000000112aeac0e
lldb_private::Debugger::~Debugger() + 14
7   libc++.1.dylib                    0x00007fff95ee5cb8
std::__1::__shared_weak_count::__release_shared() + 44
8   _lldb.so                          0x0000000110b2b6cf
std::__1::__vector_base<std::__1::shared_ptr<lldb_private::TypeImpl>,
std::__1::allocator<std::__1::shared_ptr<lldb_private::TypeImpl> >
<span class="quote">>::~__vector_base() + 49</span >
9   libsystem_c.dylib                 0x00007fff91e0746b __cxa_finalize_ranges
+ 345
10  libsystem_c.dylib                 0x00007fff91e0776f exit + 55
11  libdyld.dylib                     0x00007fff8fd2f5b4 start + 8

Python version: 2.7.10 (2.7.10)
LLDB version: 350.0.21.9
OS: Mac OS X 10.11.4 (15E65)

This crash can be suppressed by manually cleaning up the objects:
debugger.DeleteTarget(target)
debugger.Terminate()

I've searched around and didn't find any other reports of this on OSX. Possibly
related to rdar://problem/24580184 / dc5ef2da510f3adba99cd8b2fe18c2e6d417227d ?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>