[lldb-dev] [Bug 52393] New: LLDB crashes while printing optional<string> member from parent class

via lldb-dev lldb-dev at lists.llvm.org
Wed Nov 3 17:17:34 PDT 2021


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

            Bug ID: 52393
           Summary: LLDB crashes while printing optional<string> member
                    from parent class
           Product: lldb
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: manas18244 at iiitd.ac.in
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org

Created attachment 25419
  --> https://bugs.llvm.org/attachment.cgi?id=25419&action=edit
Stack trace produced before segfault

```c++ (-std=c++17)
#include <string>
#include <optional>
using namespace std;

class A {
public:
  optional<string> Label;
  A() {}
};

class B : public A {
public:
  B() {}
  void foo();
};

void B::foo() {
  return;
}

int main() {
  B *Obj = new B();
  Obj->foo();
  return 0;
}
```

The above code when compiled with
  g++ (GCC) 11.1.0
and tried to debug via
  1. lldb version 12.0.1, and also with
  2. lldb version 14.0.0 (https://github.com/llvm/llvm-project.git revision
3be3c944a5bacfd208b56853941b0fa4dec3ddcc)
  clang revision 3be3c944a5bacfd208b56853941b0fa4dec3ddcc
  llvm revision 3be3c944a5bacfd208b56853941b0fa4dec3ddcc

produces the following trace and crashes with 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/20211104/d46d4991/attachment.html>


More information about the lldb-dev mailing list