<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 crashes when reading a core file"
   href="https://llvm.org/bugs/show_bug.cgi?id=25106">25106</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lldb crashes when reading a core file
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.7
          </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>vrba@mixedrealities.no
          </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=15031" name="attach_15031" title="Minimal test case needed to reproduce the bug; 7z archive">attachment 15031</a> <a href="attachment.cgi?id=15031&action=edit" title="Minimal test case needed to reproduce the bug; 7z archive">[details]</a></span>
Minimal test case needed to reproduce the bug; 7z archive

I compile the attached C++ program with clang++ z.cc, run it and receive
segmentation fault as expected. lldb crashes when trying to load the produced
core file:

vrba@zax:/tmp$ lldb 
(lldb) target create -c core a.out
Segmentation fault

gdb has no problems with loading the core file and showing the source.

vrba@zax:/tmp$ clang++ --version
Debian clang version 3.7.0-svn247539-1~exp1 (branches/release_37) (based on
LLVM 3.7.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

[I have installed Debian packages provided by the LLVM project.]


The attached archive contains the source code, the executable and the produced
core file.

This is the stack trace when lldb crashed:
#0  0x00007ffff6579120 in lldb_private::ArchSpec::GetMachine() const ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#1  0x00007ffff691674f in
RegisterContextPOSIX_x86::RegisterContextPOSIX_x86(lldb_private::Thread&,
unsigned int, lldb_private::RegisterInfoInterface*) () from
/usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#2  0x00007ffff75be764 in
RegisterContextCorePOSIX_x86_64::RegisterContextCorePOSIX_x86_64(lldb_private::Thread&,
lldb_private::RegisterInfoInterface*, lldb_private::DataExtractor const&,
lldb_private::DataExtractor const&) ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#3  0x00007ffff75bf212 in
ThreadElfCore::CreateRegisterContextForFrame(lldb_private::StackFrame*) ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#4  0x00007ffff75becdb in ThreadElfCore::GetRegisterContext() () from
/usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#5  0x00007ffff69b97cc in lldb_private::StackFrameList::GetFramesUpTo(unsigned
int) ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#6  0x00007ffff69ba22b in
lldb_private::StackFrameList::ResetCurrentInlinedDepth() ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#7  0x00007ffff69e0242 in
lldb_private::Thread::ShouldStop(lldb_private::Event*) ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#8  0x00007ffff69e68f6 in
lldb_private::ThreadList::ShouldStop(lldb_private::Event*) ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#9  0x00007ffff69a3ad3 in
lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*) ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#10 0x00007ffff69a3bb1 in
lldb_private::Process::HandlePrivateEvent(std::shared_ptr<lldb_private::Event>&)
()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#11 0x00007ffff69a6a1c in lldb_private::Process::RunPrivateStateThread(bool) ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#12 0x00007ffff66d1eb2 in
lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) ()
   from /usr/lib/x86_64-linux-gnu/liblldb-3.7.so
#13 0x00007ffff5a3a0a4 in start_thread (arg=0x7fffeedd8700) at
pthread_create.c:309
#14 0x00007ffff491704d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111</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>