[lldb-dev] [Bug 39500] New: Segfault when evaluating STL expression

via lldb-dev lldb-dev at lists.llvm.org
Tue Oct 30 08:06:31 PDT 2018


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

            Bug ID: 39500
           Summary: Segfault when evaluating STL expression
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: ldionne at apple.com
                CC: llvm-bugs at lists.llvm.org

When evaluating some STL expression, lldb segfaults. This only seems to happen
with a recent Clang and LLDB, which may be related to the removal of
`always_inline` from libc++ shipped with recent Clangs.

This bug is a reduction of the STL-related failure that started happening in
http://green.lab.llvm.org/green/job/lldb-cmake/11896.

Here's the reproduction (with Trunk Clang and LLDB):

```
#!/bin/sh

cat > t.cpp <<EOF
#include <cstdio>
#include <map>
#include <string>
int main() {
    std::string hello_world = "Hello World!";
    std::map<std::string, int> associative_array;
    associative_array[hello_world] = 1;
    associative_array.count(hello_world);
    std::printf("before returning....\n"); // Set break point at this line.
}
EOF

clang++ t.cpp -O0 -g
lldb a.out
```

Then, from within lldb:
```
breakpoint set -l 9
run
expr associative_array.count(hello_world)
expr associative_array.count(hello_world)
```

The evaluation works the first time around, but fails the second time around
with a segfault.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20181030/dcd45718/attachment.html>


More information about the lldb-dev mailing list