<div dir="ltr"><div dir="ltr">On Fri, Oct 29, 2021 at 9:09 AM Stephan Bergmann via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org">libcxx-dev@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">At least with recent LLVM 14 trunk,<br>[...]<br>
> Segmentation fault<br>[...]<br>
because the std::string instance returned from std::to_string <br>
(implemented in libc++, not itself built with -D_LIBCPP_DEBUG=1) never <br>
called __libcpp_db::__insert_c(this), so __libcpp_db::swap doesn't find <br>
it in the __cbeg_/__cend_ table and then dereferences a null pointer.<br>
<br>
I wonder how usable and mature -D_LIBCPP_DEBUG=1 is considered in <br>
practice.  Is this a well-known shortcoming (in which case it might be <br>
good to mention it explicitly in libcxx/docs/DesignDocs/DebugMode.rst, <br>
beyond just "Users should compile their whole program at the same <br>
debugging level."), or would it be worth filing a bug?<br></blockquote><div><br></div><div>Just to link up the two threads: I ran into this earlier this year.</div><div><a href="https://lists.llvm.org/pipermail/libcxx-dev/2021-May/001119.html">https://lists.llvm.org/pipermail/libcxx-dev/2021-May/001119.html</a><br></div><div>It is the reason at least one test in libcxx/test/ is marked "LIBCXX-DEBUG-FIXME". I don't have any ideas how to fix it, though.</div><div><br></div><div>–Arthur</div></div></div>