[LLVMbugs] [Bug 23287] New: lldb crashes when displaying information for an array of structs and inside of struct there is a long double member field

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 19 08:22:47 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23287

            Bug ID: 23287
           Summary: lldb crashes when displaying information for an array
                    of structs and inside of struct there is a long double
                    member field
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mihail.nistor at freescale.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14227
  --> https://llvm.org/bugs/attachment.cgi?id=14227&action=edit
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 (http://llvm.org/git/lldb.git 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150419/a1ab71b4/attachment.html>


More information about the llvm-bugs mailing list