Re: pt_PieceTable::_getStruxFromFragSkip

From: Robert Wilhelm (robert.wilhelm@gmx.net)
Date: Sun Sep 07 2003 - 01:06:38 EDT

  • Next message: Pierre Abbat: "Latin (Renaissance)"

    Hi Martin,

    Thank you for looking into it.
    Reproducing is easy here under Linux. I load the guadec-4.zabw
    doc (370490 bytes), then I press Control-A.

    Now only everything up to the last endnote (#GTkMathView on page 14)
    is marked.

    Then I press Control-X. Funny thing that I cannot place the mouse in the
    first remainung paragraph now.

    Now I press Control-V and then it crashes.

    BTW my patch brings us only a very small step forward, as in several
    place we use _getStruxFromFragSkip() without checking the return value
    and then immediately accessing the return NULL pointer (e.g. in
    pt_PT_DeleteSpan.cpp line 501 and pt_PT_InsertStrux.cpp line 362).

    Anyway we check for ->pref being null in many places in
    pt_PieceTable.cpp, so I think my patch may be usefull anyway for
    consistence.

    Robert
     
    On Sun, 2003-09-07 at 00:29, msevior@physics.unimelb.edu.au wrote:
    > > When loading guadec-4.zabw and just doing C-A C-X C-V one or
    > > several times, my AbiWord CVS HEAD crashes in
    > > pt_PieceTable::_getStruxFromFragSkip doing a isFootnote(pf)
    > > with pf == 0x0.
    > >
    >
    > Hi Robert,
    > This would probobally just mask the real problem. (I guess we
    > should apply the patch anyway. It would add robustness.) Can
    > you explain how to reproduce this bug? I'll fix it properly
    > once I can reproduce.
    >
    > Thanks!
    >
    > Martin
    >
    > > Probably we need something like a attached (untested) patch.
    > >
    > > diff -u -r1.102 pt_PieceTable.cpp
    > > --- pt_PieceTable.cpp 19 Aug 2003 04:18:12 -0000 1.102
    > > +++ pt_PieceTable.cpp 6 Sep 2003 15:25:13 -0000
    > > @@ -889,6 +889,10 @@
    > > || isFootnote(pf) ||
    > > isEndFootnote(pf)))
    > > {
    > > pf=pf->getPrev();
    > > +
    > > + if (!pf)
    > > + return false;
    > > +
    > > if(isFootnote(pf))
    > > {
    > > countFoots--;
    >
    >
    >



    This archive was generated by hypermail 2.1.4 : Sun Sep 07 2003 - 01:25:25 EDT