[libcxx-dev] How do _LIBCPP_DEBUG=1 "debug iterators" ever work, when linking against libc++.a?

Arthur O'Dwyer via libcxx-dev libcxx-dev at lists.llvm.org
Wed Jun 9 07:24:52 PDT 2021


Bump again, since this just came up AGAIN in Louis's
https://reviews.llvm.org/D103960

On Sat, May 29, 2021 at 1:00 PM Mark de Wever <koraq at xs4all.nl> wrote:

> On Sat, May 08, 2021 at 04:49:20PM -0400, Arthur O'Dwyer via libcxx-dev
> wrote:
> > Gentle bump.
> >
> > Quoting myself for emphasis:
> > >
> > > The problem seems to be that
> > > (1) libc++.a needs to copy strings sometimes, so it contains codegen
> for
> > the copy constructor
> > > (2) libc++.a is compiled with -D_LIBCPP_DEBUG=0, i.e., assertions but
> no
> > debug iterators
> > > (3) Therefore any strings created by the copy constructor inside
> > libc++.a, don't get registered with the debug-iterators library
> > > (4) Therefore pretty much everything is affected by unpredictable
> > assert-fails??
> > >
> > > The real question is, how was this ever *supposed* to work?
>
> It seems the issue also happens with strings returned from
> std::to_string. This function is implemented in src/string.cpp.
> I ran into it a while ago while implementing the std::formatter stubs.
>
> (I actually forgot about this issue, but Arthur reminded me.)
>
> To me it seems unintentional and unwanted. But I don't have a suggestion
> how to fix it.
>
> Cheers,
> Mark de Wever
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20210609/b741b0dc/attachment.html>


More information about the libcxx-dev mailing list