Re: commit (head): cjk patch

From: <msevior_at_physics.unimelb.edu.au>
Date: Sat Mar 26 2005 - 14:57:35 CET

>
> Here's a very small patch which fixes a bug in the previous CJK line
> breaking patch. This changes the behaviour from always returning true when
> asked about breaking after the last character in the document to always
> returning false instead.
>
> Returning true led to the LineBreaker trying to split after the last
> character resulting in a fatal assert.
>
> To see this start abiword set the font size to "72" (so you don't have to
> type too much) and type "Can I crash Abiword?". This should wrap onto the
> second line. Then delete characters one after another. When you get to the
> 'b', or there abouts, you should see the assert.
>
> In general, is this behaviour on the part of the LineBreaker sensible?
> Should a line breaking algorithm that returns true for the last character
> in the document crash abi?

Of course AbiWord should never crash and we have to code to make sure it
doesn't.

> Algorithms that only consider a single
> character may well do this, although fortunately it doesn't happen with
> standard English rules.

Hi Roland,
          On the Linux build with the current behaviour, I get lots of
asserts
*** (21) Assert ****
**** (21) (FPRUN_FMTMARK == pRun->getType()) || ((FPRUN_TAB ==
pRun->getType()) || (FPRUN_FIELD == pRun->getType()) &&
isContainedByTOC()) || (pRun->getLength() > 0) at
../../../../../abi-unstable/src/text/fmt/xp/fl_BlockLayout.cpp:5695 ****
**** (21) Continue ? (y/n) [y] :
**** (22) Assert ****
**** (22) (FPRUN_FMTMARK == pRun->getType()) || ((FPRUN_TAB ==
pRun->getType()) || (FPRUN_FIELD == pRun->getType()) &&
isContainedByTOC()) || (pRun->getLength() > 0) at
../../../../../abi-unstable/src/text/fmt/xp/fl_BlockLayout.cpp:5695 ****
**** (22) Continue ? (y/n) [y] :

**** (23) Assert ****
**** (23) (FPRUN_FMTMARK == pRun->getType()) || ((FPRUN_TAB ==
pRun->getType()) || (FPRUN_FIELD == pRun->getType()) &&
isContainedByTOC()) || (pRun->getLength() > 0) at
../../../../../abi-unstable/src/text/fmt/xp/fl_BlockLayout.cpp:5695 ****
**** (23) Continue ? (y/n) [y] :

(In fl_BlockLayout::_assertRunListIntegrityImpl())

 when I to the "w" but no crash.

I will need to investigate the origin of these asserts. Clearly something
bad has happened but we have to make sure the cure is not worse than the
disease. fb_LineBreaker has had a lot of eyes on it over the years.

I'll check out your patch next.

Thanks very much!

Martin

>
> Best wishes,
>
> R.
Received on Sat Mar 26 14:57:23 2005

This archive was generated by hypermail 2.1.8 : Sat Mar 26 2005 - 14:57:26 CET