[llvm-bugs] [Bug 52209] New: Adding char const * and std::string with -DLIBCPP_DEBUG yields segfault

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 18 11:46:20 PDT 2021


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

            Bug ID: 52209
           Summary: Adding char const * and std::string  with
                    -DLIBCPP_DEBUG yields segfault
           Product: libc++
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: e.fokken+libcpp at posteo.de
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Created attachment 25371
  --> https://bugs.llvm.org/attachment.cgi?id=25371&action=edit
full stack trace of the segfault

Compiling the following with clang++ -DLIBCPP_DEBUG -stdlib=libc++

#include <iostream>

int main() {
  std::pair<bool, double> minimum_{true, 1};

  std::cerr << "instance is below minimum of " +
std::to_string(minimum_.second)
            << "\n";

  return 0;
}

and executing yields a segfault. g++ or clang++ with libstdc++ instead output
the expected:
"instance is below minimum of 1.000000"

I've added a full stack trace.


See also https://github.com/pboettch/json-schema-validator/issues/177
Hope it helps!

-- 
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/20211018/562e8cb5/attachment.html>


More information about the llvm-bugs mailing list