Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Ok I looked into the corresponding gcc stl function and it seems that the
debug function checks if the iterator is incrementable. I haven't checked
the macro that performs this check but the iterator might be marked as
invalid after an element has been erased. So this crash will only happen
during a debug build, but I think it is good to know that during a debug
build some additional checks are performed.

the relevant code is:

      _Safe_iterator&
      operator++()
      {
    _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
                  _M_message(__msg_bad_inc)
                  ._M_iterator(*this, "this"));
    ++_M_current;
    return *this;
      }

I still don't understand why it fails with my patch but this might be
because it is not delivered correctly. I'll push a patch based on your idea
to master.

2011/6/21 Noel Power <nopower@novell.com>

On 21/06/11 18:52, Markus Mohrhard wrote:

I did a debug build. And I had some stl debug symbols in my backtrace so
it might be that perhaps the compiler won't optimize this out.

I attached the backtrace.

print it shows: it = {<__gnu_debug::_Safe_iterator_**base> = {_M_sequence
= 0x29e3678, _M_version = 0, _M_prior = 0x0, _M_next = 0x0}, _M_current =
{_M_current = 0x2a27bf0}}

ah, ok -D_GLIBCXX_DEBUG is enabled, right I tried to build some stuff
partially ( with some extra debug flags etc. ) <sigh> didn't work ( link
problems ) I will try a full debug build ( have never done that up to now )

Noel


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.