First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 773
Product:
Component:
Status: CLOSED
Resolution: FIXED
Assigned To: bugs-owner@abisource.com
Hardware:
OS:
Version:
Priority:
Severity:
Target Milestone:
Reporter: sytobinh@uchicago.edu
Add CC:
CC:
QA Contact:
URL:
Summary:
Status Whiteboard:
Keywords:

Attachment Type Creator Created Size Flags Actions
test case application/abiword Hubert Figuiere 2001-06-15 03:28 988 bytes none Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 773 depends on: Show dependency tree
Show dependency graph
Bug 773 blocks:

Additional Comments:





View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2000-02-27 04:06
Attempting to open a document that contains no <p></p> pair causes a segfault.
If either is present, the parser recognizes it as a bogus document.

(gdb) bt
#0  0x8111617 in fl_BlockLayout::getPosition (this=0x0, bActualBlockPos=0
'\000') at fl_BlockLayout.cpp:842
#1  0x8111704 in fl_BlockLayout::findPointCoords (this=0x0, iPos=2, bEOL=0
'\000', x=@0xbffff800, y=@0xbffff7fc, height=@0xbffff7f8) at fl_BlockLayout.cpp:877
#2  0x810c661 in FV_View::_findPositionCoords (this=0x8304e90, pos=2, bEOL=0
'\000', x=@0x8304ed8, y=@0x8304edc, height=@0x8304ee0, ppBlock=0x0, ppRun=0x0)
at fv_View.cpp:3460
#3  0x810c738 in FV_View::_fixInsertionPointCoords (this=0x8304e90) at
fv_View.cpp:3498
#4  0x810729d in FV_View::moveInsPtTo (this=0x8304e90, dp=FV_DOCPOS_BOD) at
fv_View.cpp:918
#5  0x8105716 in FV_View::FV_View (this=0x8304e90, pApp=0x82ab320,
pParentData=0x829ac30, pLayout=0x8304760) at fv_View.cpp:114
#6  0x80b68fa in AP_UnixFrame::_showDocument (this=0x829ac30, iZoom=100) at
ap_UnixFrame.cpp:107
#7  0x80b7cb2 in AP_UnixFrame::loadDocument (this=0x829ac30,
    szFilename=0xbffffc45 "break.abw", ieft=0) at ap_UnixFrame.cpp:477
#8  0x80a1074 in AP_UnixApp::parseCommandLine (this=0x82ab320) at ap_UnixApp.cpp:914
#9  0x80a0c44 in AP_UnixApp::main (szAppName=0x81bc448 "AbiWord Personal", argc=2,
    argv=0xbffffaf4) at ap_UnixApp.cpp:808
#10 0x80911eb in main (argc=2, argv=0xbffffaf4) at UnixMain.cpp:24

If you attempt to open a document that has neither a <section> nor a <p>, the
the program also segfaults.  However, the backtrace is different.

(gdb) bt
#0  pf_Frag_Strux::getStruxType (this=0x0) at pf_Frag_Strux.cpp:44
#1  0x812fa11 in pt_PieceTable::_getStruxOfTypeFromPosition (this=0x8316510,
dpos=2,
    pts=PTX_Block, ppfs=0xbfffecc4) at pt_PieceTable.cpp:598
#2  0x812f8bb in pt_PieceTable::getStruxOfTypeFromPosition (this=0x8316510,
listenerId=0,
    docPos=2, pts=PTX_Block, psfh=0xbfffed40) at pt_PieceTable.cpp:546
#3  0x812bf6e in PD_Document::getStruxOfTypeFromPosition (this=0x8312650,
listenerId=0,
    docPos=2, pts=PTX_Block, psfh=0xbfffed40) at pd_Document.cpp:564
#4  0x81182b3 in FL_DocLayout::findBlockAtPosition (this=0x831b008, pos=2)
    at fl_DocLayout.cpp:356
#5  0x8107476 in FV_View::_findBlockAtPosition (this=0x82c4bd0, pos=2) at
fv_View.cpp:960
#6  0x810c615 in FV_View::_findPositionCoords (this=0x82c4bd0, pos=2, bEOL=0
'\000',
    x=@0x82c4c18, y=@0x82c4c1c, height=@0x82c4c20, ppBlock=0x0, ppRun=0x0)
    at fv_View.cpp:3458
#7  0x810c738 in FV_View::_fixInsertionPointCoords (this=0x82c4bd0) at
fv_View.cpp:3498
#8  0x810729d in FV_View::moveInsPtTo (this=0x82c4bd0, dp=FV_DOCPOS_BOD) at
fv_View.cpp:918
#9  0x8105716 in FV_View::FV_View (this=0x82c4bd0, pApp=0x82ab320,
pParentData=0x829ac30,
    pLayout=0x831b008) at fv_View.cpp:114
#10 0x80b68fa in AP_UnixFrame::_showDocument (this=0x829ac30, iZoom=100)
    at ap_UnixFrame.cpp:107
#11 0x80b7cb2 in AP_UnixFrame::loadDocument (this=0x829ac30,
    szFilename=0x82c2380 "/home/sam/break.abw", ieft=0) at ap_UnixFrame.cpp:477
#12 0x80c1af0 in _fileOpen (pFrame=0x829ac30, pNewFile=0x82c2380
"/home/sam/break.abw",
    ieft=IEFT_Unknown) at ap_EditMethods.cpp:1315
#13 0x80c1be4 in ap_EditMethods::fileOpen (pAV_View=0x83050c0) at
ap_EditMethods.cpp:1343
#14 0x816f76c in EV_Menu::invokeMenuMethod (this=0x82b4f10, pView=0x83050c0,
pEM=0x824b1d0,
    pData=0x0, dataLength=0) at ev_Menu.cpp:93
#15 0x816c113 in EV_UnixMenu::menuEvent (this=0x82b4f10, id=3) at
ev_UnixMenu.cpp:276
#16 0x81bb8c6 in _wd::s_onActivate (callback_data=0x82c31c8) at ev_UnixMenu.cpp:66
#17 0x400f0fa7 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0
#18 0x401221a6 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
Cannot access memory at address 0x47.

I don't find it particularily surprising that we segfault on these document
problems, but it seems strange that the traces should be different.  If I get
some time, I'll look into this.

------- Comment #1 From sytobinh@uchicago.edu 2000-03-13 17:34:59 -------
More info on this -
In the first case, when there is <section> but not <p></p>, you get two asserts
before the segfault -
**** (1) Assert ****
**** (1) (0) at fl_DocLayout.cpp:372 ****
**** (1) Continue ? (y/n) [y] : n

**** (2) Assert ****
**** (2) pBlock at fv_View.cpp:3529 ****
**** (2) Continue ? (y/n) [y] : y

------- Comment #2 From Dom Lachowicz 2001-01-20 19:19:59 -------
Isn't this the intended behavior? I mean, every document should have at least
one empty paragraph...

------- Comment #3 From Hubert Figuiere 2001-06-15 03:20:45 -------
Sam, do you have a sample document ?

------- Comment #4 From Hubert Figuiere 2001-06-15 03:28:17 -------
Currently this is not a bug but a feature: the piecetable stuff AND the
formatter expect to have at least one PTX_Block in a PTX_Section. If there is
none, it crash. I encountered the problem when implementing header/footer stuff.

As a fix, we should make the importer add a PTX_Block if there is none in the
file. This allow working around corrupt file of some sort.

BTW if AbiWord write such a file, it is a real bug.

------- Comment #5 From Hubert Figuiere 2001-06-15 03:28:53 -------
Created an attachment (id=67) [edit]
test case

------- Comment #6 From Tim 2001-07-23 18:09:48 -------
dom> Isn't this the intended behavior? I mean, every document should have at 
dom> least one empty paragraph...

well good lord, it shouldn't cause a crash!

------- Comment #7 From Dom Lachowicz 2001-11-02 12:34:41 -------
I just fixed this. Will check in when i can connect to abiword cvs again

------- Comment #8 From Jesper Skov 2001-11-15 10:50:39 -------
works for me

------- Comment #9 From Hubert Figuiere 2004-02-12 13:34:21 -------
closing verified bugs whose target is no longer

First Last Prev Next    No search results available      Search page      Enter new bug