[Libreoffice-bugs] [Bug 50372] BASE SIGABRT: dereference a past-the-end iterator
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon May 28 07:14:43 PDT 2012
https://bugs.freedesktop.org/show_bug.cgi?id=50372
--- Comment #2 from Terrence Enger <lo_bugs at iseries-guru.com> 2012-05-28 07:14:43 PDT ---
I have tried a couple of hacks which only deferred the failure to
later points in execution.
(*) The first of these hacks was equivalent to the patch you propose:
an early return from OKeySet::refreshRow if m_aKeyIter equals
m_aKeyMap.end(). This makes OKeySet::getBookmark() fail with
message "getBookmark is possible only when we stand on a valid
row!".
Note that the test isAfterLast() early in OKeySet::refreshRow() is
not a sufficient guard against past-the-end iterator because
OKeySet::isAfterLast() looks first at m_bRowCountFinal. So,
beyond the present problem, I wonder whether there is some reason
to expect that OKeySet::refreshRow() is never called with false
m_bCountFinal and m_aKeyIter equal m_aKeyMap.end(); I think this
combination would make the routine fail every time.
(*) The second was to replace the increment of m_aKeyIter with a
decrement before KeySet::refreshRow() does the recursive call.
(Yes, the table has two rows. And I *think* the first element of
m_aKeyMap is a dummy anyway, existing just to allow a
before-the-first test like the after-the-last test which STL
provides. So, I guessed that at worst this would result in an
return from the recursive call because isBeforeFirst().) I think
this led to a failure within OSL_ENSURE within OKeySet::getInt(),
KeySet.cxx line 1441. (Just "I think" because I made a mess of my
notes and silly me was not collecting a typescript.)
As the program seems to have fetched all two rows of the table, I
suspect that m_aRowCountFinal should be true--maybe, perhaps. But,
all I know about that variable is its name and the fact that it seems
to be used a lot. And the result of my first hack suggests that that
might not be sufficient to fix the problem anyway.
More information about the Libreoffice-bugs
mailing list