<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 displaying information for an array of structs and inside of struct there is a long double member field"
href="https://llvm.org/bugs/show_bug.cgi?id=23287">23287</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lldb crashes when displaying information for an array of structs and inside of struct there is a long double member field
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mihail.nistor@freescale.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=14227" name="attach_14227" title="test case to reproduce the problem">attachment 14227</a> <a href="attachment.cgi?id=14227&action=edit" title="test case to reproduce the problem">[details]</a></span>
test case to reproduce the problem
This problem was reproduced by using Ubuntu 64bits; find more details below:
$uname -a
Linux 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64
x86_64 x86_64 GNU/Linux
The relevant source code from test1.c is below:
struct _lstruct{
long double a_long_double;
};
int main(void) {
struct _lstruct ls[10];
return EXIT_SUCCESS;
}
The source code was compiled by using the gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
version.
The test1.elf was compiled by using the following command:
$gcc -o test1.elf -g -O0 test1.c
## COMMAND TO REPRODUCE:
$ lldb ./test1.elf
(lldb) target create "./test1.elf"
Current executable set to './test1.elf' (x86_64).
(lldb) b main
Breakpoint 1: where = test1.elf`main + 8 at test1.c:11, address =
0x00000000004004f5
(lldb) r
Process 12180 launched: './test1.elf' (x86_64)
Process 12180 stopped
* thread #1: tid = 12180, 0x00000000004004f5 test1.elf`main + 8 at test1.c:11,
name = 'test1.elf', stop reason = breakpoint 1.1
frame #0: 0x00000000004004f5 test1.elf`main + 8 at test1.c:11
8 int main(void) {
9 struct _lstruct ls[10];
10
-> 11 return EXIT_SUCCESS;
12 }
(lldb) p ls
lldb: /home/work/llvm/lib/Support/APFloat.cpp:3657: void
llvm::APFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned
int) const: Assertion `!buffer.empty() && "no characters in buffer!"' failed.
Aborted (core dumped)
or
(lldb) p ls[0].a_long_double
lldb: /home/work/llvm/lib/Support/APFloat.cpp:3657: void
llvm::APFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned
int) const: Assertion `!buffer.empty() && "no characters in buffer!"' failed.
Aborted (core dumped)
##EXPECTED
The LLDB doesn’t crash.
## TOOLS VERSION INFO:
$ lldb --version
lldb version 3.7.0 (<a href="http://llvm.org/git/lldb.git">http://llvm.org/git/lldb.git</a> revision
ffc85fd7b1d05e955111a5e8805209039663017b clang revision
e8d60ed0efed466103489cf893bd8bcc32d5dfa7)
$ gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</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>