<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>This looks like the ArchSpec merge issue, where if the target ArchSpec is not valid it doesn’t set the machine correctly.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><a href="https://llvm.org/bugs/show_bug.cgi?id=25106">https://llvm.org/bugs/show_bug.cgi?id=25106</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Zhenglin, can you load /usr/local/myproject/bin/cnode in lldb, without the core file? It should have a valid ArchSpec, but your backtrace looks like the backtrace from bug 25106, which doesn’t have a valid target ArchSpec.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>--<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Qualcomm Innovation Center, Inc.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> lldb-dev [mailto:lldb-dev-bounces@lists.llvm.org] <b>On Behalf Of </b>??? via lldb-dev<br><b>Sent:</b> Sunday, December 20, 2015 11:31 PM<br><b>To:</b> LLDB; llvm-dev@lists.llvm.org<br><b>Subject:</b> [lldb-dev] lldb -c corefile get segmentation fault on centos7<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Hi,<o:p></o:p></p></div><div><p class=MsoNormal>I build llvm+clang+lldb 3.7 successfully on centos7, and lldb -p PID works pretty well. However when I tried lldb -c corefile executable_bin, lldb itself core dumpped. Attached the following core info which is debugged by gdb:<br>[root@dn-cn-controller-4fbd4 data1]# lldb -c a.corefile /usr/local/myproject/bin/cnode<br><b>(lldb) target create "/usr/local/myproject/bin/cnode" --core "a.corefile"</b><br>Segmentation fault (core dumped)<br><br><b>And then I tried gdb to check the lldb call stack:</b><br><b>(gdb) info threads</b><br>  Id   Target Id         Frame<br>  3    Thread 0x7f81c4795700 (LWP 64) 0x00007f81c9ed46d5 in pthread_cond_wait@@GLIBC_2.3.2 ()<br>   from /lib64/libpthread.so.0<br>  2    Thread 0x7f81ce580740 (LWP 59) 0x00007f81c9ed46d5 in pthread_cond_wait@@GLIBC_2.3.2 ()<br>   from /lib64/libpthread.so.0<br>* 1    Thread 0x7f81c3f94700 (LWP 65) 0x00007f81cbe00630 in lldb_private::ArchSpec::GetMachine() const ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br><b>(gdb) bt</b><br>#0  0x00007f81cbe00630 in lldb_private::ArchSpec::GetMachine() const ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#1  0x00007f81cc20458f in RegisterContextPOSIX_x86::RegisterContextPOSIX_x86(lldb_private::Thread&, unsigned int, lldb_private::RegisterInfoInterface*) () from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#2  0x00007f81cc153a24 in RegisterContextCorePOSIX_x86_64::RegisterContextCorePOSIX_x86_64(lldb_private::Thread&, lldb_private::RegisterInfoInterface*, lldb_private::DataExtractor const&, lldb_private::DataExtractor const&) ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#3  0x00007f81cc151e5e in ThreadElfCore::CreateRegisterContextForFrame(lldb_private::StackFrame*) ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#4  0x00007f81cc1523b3 in ThreadElfCore::GetRegisterContext() ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#5  0x00007f81cbfae9e2 in lldb_private::StackFrameList::GetFramesUpTo(unsigned int) ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#6  0x00007f81cbfaf3e7 in lldb_private::StackFrameList::ResetCurrentInlinedDepth() ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#7  0x00007f81cbfd32e2 in lldb_private::Thread::ShouldStop(lldb_private::Event*) ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#8  0x00007f81cbfd98d2 in lldb_private::ThreadList::ShouldStop(lldb_private::Event*) ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#9  0x00007f81cbf997bb in lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*) ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#10 0x00007f81cbf998a1 in lldb_private::Process::HandlePrivateEvent(std::shared_ptr<lldb_private::Event>&) ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#11 0x00007f81cbf9a77a in lldb_private::Process::RunPrivateStateThread(bool) ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#12 0x00007f81cbdf7db2 in lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) ()<br>   from /opt/dependency/tools/bin/../lib64/liblldb.so.3.7<br>#13 0x00007f81c9ed0dc5 in start_thread () from /lib64/libpthread.so.0<br>#14 0x00007f81c91c821d in clone () from /lib64/libc.so.6<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Any suggesstion about why lldb -c core dump?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>Thanks,<o:p></o:p></p></div><p class=MsoNormal>Zhenglin<o:p></o:p></p></div></div></body></html>