Subject: Attention Internals Experts
From: Thomas Fletcher (thomasf@qnx.com)
Date: Fri Jan 12 2001 - 07:39:02 CST
All,
I've come across an odd situation that has caused a core
dump of AbiWord and I'm struggling with some of the
internals so I thought I would ask you guys who are more
familiar for advice.
I have someone here who is writing a design doc with
AbiWord and the document is about 14 pages long or so. They
like to have their settings to "Page Width". (I'm not sure
that this is directly related to the problem or not, but
it is part of the "reproducability") In this document
there is a text that looks like:
struct {
this is
some text
} vertices;
This is a line
--- END OF PAGE ---
When you edit vertices (ie make it vertice) and then go to below
"This is a line" and hit return (forcing it to the next page)
you would get the crash I'm talking about.
Now to the meat of the issue:
Abi core dumps because it calls _getPartRect() from
_fillRect() from _draw() all within fp_TextRun.cpp. In
_getPartRect() there is code that looks something like:
... fill in a rect structure ...
//This is enough for a zero length run
if(m_iLen == 0) {
return;
}
UT_uint16 *pCharWidths = pgbCharWidths->getPointer(0);
The reason that we are seg-faulting is that we reference
pCharWidths which is NULL since the byte buffer of pgbCharWidths
didn't have anything in it.
Just looking to get a quick patch so that this person would
be able to continue editing I tried to just consider this
case the same as a zero length run and modified the code to
be:
if (!pCharWidths) {
return;
}
(Yes I know fixing the symptom and not the problem ... I was
looking for a quick way to get this person back to editing
their document). This now passes through this code and performs
the editing as I would expect only now it doesn't properly move
from page to page and gives an assert in fv_View.cpp 3077 which
is _movInsPtNextPrevLine().
I'd offer the document to use to debug, but I'm afraid that
it probably won't show up the same on another platform due
to the font/text mapping differences. I'd also have to check
with the author to make sure that it would ok to release the
contents. I haven't found another document that exhibits
the same problem yet either.
Any thoughts?
Thanks,
Thomas
-------------------------------------------------------------
Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com Neutrino Development Group
(613)-591-0931 http://www.qnx.com/~thomasf
This archive was generated by hypermail 2b25 : Fri Jan 12 2001 - 07:40:05 CST