<html>
<head>
<base href="https://bugs.llvm.org/">
</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 on a file compiled with clang-3.8 at -O3"
href="https://bugs.llvm.org/show_bug.cgi?id=40827">40827</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lldb crashes on a file compiled with clang-3.8 at -O3
</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>enhancement
</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>qrzhang@gatech.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>It affects the latest lldb trunk version.
It only happens with clang-3.8 at -O3. 4.0 and later versions work fine.
$ lldb-trunk -v
lldb version 9.0.0 (<a href="https://llvm.org/svn/llvm-project/lldb/trunk">https://llvm.org/svn/llvm-project/lldb/trunk</a> revision
354654)
clang revision 354654
llvm revision 354654
$ cat abc.c
char a;
int main() {
int i;
int b[] = {7, 7, 7};
a = b[2];
i = 0;
for (; i < 5; i++)
;
optimize_me_not();
}
$ cat outer.c
optimize_me_not() {}
$ cat cmds
b 9
r
p i
kill
q
$ clang-3.8 -O3 -g outer.c abc.c
$ lldb-trunk -s cmds -b a.out
(lldb) target create "a.out"
Current executable set to 'a.out' (x86_64).
(lldb) command source -s 0 'cmds'
Executing commands in '/home/absozero/projects/LLDB-testing/reduce/cmds'.
(lldb) b 9
Breakpoint 1: where = a.out`main + 10 at abc.c:9:3, address =
0x00000000004004aa
(lldb) r
a.out was compiled with optimization - stepping may behave oddly; variables may
not be available.
#0 0x00005573e13b3d4a (lldb-trunk+0x25d4a)
#1 0x00005573e13b2074 (lldb-trunk+0x24074)
#2 0x00005573e13b21b2 (lldb-trunk+0x241b2)
#3 0x00007f89a0687890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#4 0x00007f8998b78c40 (/lib/x86_64-linux-gnu/libc.so.6+0x18ec40)
#5 0x00007f899a6a6641 lldb_private::DataBufferHeap::CopyData(void const*,
unsigned long)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xd62641)
#6 0x00007f899a4e94d7 lldb_private::DWARFExpression::CopyOpcodeData(unsigned
long, unsigned long, unsigned char)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xba54d7)
#7 0x00007f899a9b8674
SymbolFileDWARF::ParseVariableDIE(lldb_private::SymbolContext const&, DWARFDIE
const&, unsigned long)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0x1074674)
#8 0x00007f899a9b93c4
SymbolFileDWARF::ParseVariables(lldb_private::SymbolContext const&, DWARFDIE
const&, unsigned long, bool, bool, lldb_private::VariableList*)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0x10753c4)
#9 0x00007f899a9ba150
SymbolFileDWARF::ParseVariablesForContext(lldb_private::SymbolContext const&)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0x1076150)
#10 0x00007f899a5a8e82
lldb_private::SymbolVendor::ParseVariablesForContext(lldb_private::SymbolContext
const&) (/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xc64e82)
#11 0x00007f899a56312e lldb_private::Block::GetBlockVariableList(bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xc1f12e)
#12 0x00007f899a450b14
lldb_private::FormatEntity::Format(lldb_private::FormatEntity::Entry const&,
lldb_private::Stream&, lldb_private::SymbolContext const*,
lldb_private::ExecutionContext const*, lldb_private::Address const*,
lldb_private::ValueObject*, bool, bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xb0cb14)
#13 0x00007f899a4500b1
lldb_private::FormatEntity::Format(lldb_private::FormatEntity::Entry const&,
lldb_private::Stream&, lldb_private::SymbolContext const*,
lldb_private::ExecutionContext const*, lldb_private::Address const*,
lldb_private::ValueObject*, bool, bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xb0c0b1)
#14 0x00007f899a4500b1
lldb_private::FormatEntity::Format(lldb_private::FormatEntity::Entry const&,
lldb_private::Stream&, lldb_private::SymbolContext const*,
lldb_private::ExecutionContext const*, lldb_private::Address const*,
lldb_private::ValueObject*, bool, bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xb0c0b1)
#15 0x00007f899a450167
lldb_private::FormatEntity::Format(lldb_private::FormatEntity::Entry const&,
lldb_private::Stream&, lldb_private::SymbolContext const*,
lldb_private::ExecutionContext const*, lldb_private::Address const*,
lldb_private::ValueObject*, bool, bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xb0c167)
#16 0x00007f899a626288
lldb_private::StackFrame::DumpUsingSettingsFormat(lldb_private::Stream*, bool,
char const*)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xce2288)
#17 0x00007f899a6265b0
lldb_private::StackFrame::GetStatus(lldb_private::Stream&, bool, bool, bool,
char const*)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xce25b0)
#18 0x00007f899a62d25a
lldb_private::StackFrameList::GetStatus(lldb_private::Stream&, unsigned int,
unsigned int, bool, unsigned int, bool, char const*)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xce925a)
#19 0x00007f899a65a0e0 lldb_private::Thread::GetStatus(lldb_private::Stream&,
unsigned int, unsigned int, unsigned int, bool, bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xd160e0)
#20 0x00007f899a60b960
lldb_private::Process::GetThreadStatus(lldb_private::Stream&, bool, unsigned
int, unsigned int, unsigned int, bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xcc7960)
#21 0x00007f899a60c14f
lldb_private::Process::HandleProcessStateChangedEvent(std::shared_ptr<lldb_private::Event>
const&, lldb_private::Stream*, bool&)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xcc814f)
#22 0x00007f899a60c3e0
lldb_private::Process::WaitForProcessToStop(lldb_private::Timeout<std::ratio<1l,
1000000l> > const&, std::shared_ptr<lldb_private::Event>*, bool,
std::shared_ptr<lldb_private::Listener>, lldb_private::Stream*, bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xcc83e0)
#23 0x00007f899a64a549
lldb_private::Target::Launch(lldb_private::ProcessLaunchInfo&,
lldb_private::Stream*)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xd06549)
#24 0x00007f899bdb3f38
CommandObjectProcessLaunch::DoExecute(lldb_private::Args&,
lldb_private::CommandReturnObject&)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0x246ff38)
#25 0x00007f899a534279 lldb_private::CommandObjectParsed::Execute(char const*,
lldb_private::CommandReturnObject&)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xbf0279)
#26 0x00007f899a52deea lldb_private::CommandInterpreter::HandleCommand(char
const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&,
lldb_private::ExecutionContext*, bool, bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xbe9eea)
#27 0x00007f899a52f1a8
lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
<span class="quote">>&) (/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xbeb1a8)</span >
#28 0x00007f899a4672c1 lldb_private::IOHandlerEditline::Run()
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xb232c1)
#29 0x00007f899a43021f
lldb_private::Debugger::RunIOHandler(std::shared_ptr<lldb_private::IOHandler>
const&) (/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xaec21f)
#30 0x00007f899a523752
lldb_private::CommandInterpreter::HandleCommandsFromFile(lldb_private::FileSpec&,
lldb_private::ExecutionContext*, lldb_private::CommandInterpreterRunOptions&,
lldb_private::CommandReturnObject&)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xbdf752)
#31 0x00007f899bd70491
CommandObjectCommandsSource::DoExecute(lldb_private::Args&,
lldb_private::CommandReturnObject&)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0x242c491)
#32 0x00007f899a534279 lldb_private::CommandObjectParsed::Execute(char const*,
lldb_private::CommandReturnObject&)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xbf0279)
#33 0x00007f899a52deea lldb_private::CommandInterpreter::HandleCommand(char
const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&,
lldb_private::ExecutionContext*, bool, bool)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xbe9eea)
#34 0x00007f899a52f1a8
lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
<span class="quote">>&) (/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xbeb1a8)</span >
#35 0x00007f899a4672c1 lldb_private::IOHandlerEditline::Run()
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xb232c1)
#36 0x00007f899a42f0cb lldb_private::Debugger::ExecuteIOHandlers()
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xaeb0cb)
#37 0x00007f899a521a45
lldb_private::CommandInterpreter::RunCommandInterpreter(bool, bool,
lldb_private::CommandInterpreterRunOptions&)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0xbdda45)
#38 0x00007f899a2982f0 lldb::SBDebugger::RunCommandInterpreter(bool, bool,
lldb::SBCommandInterpreterRunOptions&, int&, bool&, bool&)
(/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn+0x9542f0)
#39 0x00005573e1398fa5 (lldb-trunk+0xafa5)
#40 0x00005573e13966a9 (lldb-trunk+0x86a9)
#41 0x00007f8998a0bb97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#42 0x00005573e1397b1a (lldb-trunk+0x9b1a)
Stack dump:
0. Program arguments: lldb-trunk -s cmds -b a.out
Segmentation fault (core dumped)</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>