Apache OpenOffice (AOO) Bugzilla – Issue 121977
crash on doc file opening
Last modified: 2017-05-20 11:42:13 UTC
Created attachment 80479 [details] file causing the crash When opening the file in attachment under Windows 8, Writer crashes (receovery dialog is displayed).
Reproduced in WIN 8, I have the same error, but I could opened in Microsoft Office I saw it's only for reading not to edit it.
I can reproduce this crash on Windows 7 64 bit (changing platform to Windows, all). Here is the interesting part of the stack trace: > msword.dll!SwWW8ImplReader::SetDocumentGrid(SwFrmFmt & rFmt, const wwSection & rSection) Line 309 + 0x4 bytes C++ msword.dll!wwSectionManager::SetSegmentToPageDesc(const wwSection & rSection, bool bTitlePage, bool bIgnoreCols) Line 3850 C++ msword.dll!wwSectionManager::SetSwFmtPageDesc(std::_Deque_iterator<wwSection,std::allocator<wwSection>,1> & rIter, std::_Deque_iterator<wwSection,std::allocator<wwSection>,1> & rStart, bool bIgnoreCols) Line 3952 C++ msword.dll!wwSectionManager::InsertSegments() Line 4060 + 0x1c bytes C++ msword.dll!SwWW8ImplReader::CoreLoad(WW8Glossary * pGloss, const SwPosition & rPos) Line 4655 C++ msword.dll!SwWW8ImplReader::LoadThroughDecryption(SwPaM & rPaM, WW8Glossary * pGloss) Line 5153 + 0x19 bytes C++ msword.dll!SwWW8ImplReader::LoadDoc(SwPaM & rPaM, WW8Glossary * pGloss) Line 5461 + 0x10 bytes C++ msword.dll!WW8Reader::Read(SwDoc & rDoc, const String & rBaseURL, SwPaM & rPam, const String & __formal) Line 5530 + 0xe bytes C++ sw.dll!SwReader::Read(const Reader & rOptions) Line 189 + 0x30 bytes C++ sw.dll!SwDocShell::ConvertFrom(SfxMedium & rMedium) Line 256 + 0xc bytes C++ sfx.dll!SfxObjectShell::DoLoad() + 0x7e4 bytes Crash happens in this line aGrid.SetLines(writer_cast<sal_uInt16>(nTextareaHeight/nLinePitch)); where nLinePitch is zero => division by zero.
ALG: Checked on Mac, crashes, too.
set showstopper flag
There seems to be a general problem with the bug doc. MS Office 2013 opens the document in a protected view and reports "Office has detected a problem with this file. Editing it may harm your computer. Click for more details." But there are no noteworthy details. Replacing aGrid.SetLines(writer_cast<sal_uInt16>(nTextareaHeight/nLinePitch)); with if (nLinePitch > 0) aGrid.SetLines(writer_cast<sal_uInt16>(nTextareaHeight/nLinePitch)); results in the document being correctly loaded (looks the same as what MS Office shows in its viewer). Maybe that is enough of a fix?
The given document is corrupt according to MS Word 2003, MS Word 2007, MS Word 2010 and MS Word 2013. MS Word versions are reporting that a problem with the file has been detected and that editing may harm your computer.
(In reply to Andre from comment #5) > There seems to be a general problem with the bug doc. MS Office 2013 opens > the document in a protected view and reports "Office has detected a problem > with this file. Editing it may harm your computer. Click for more details." > But there are no noteworthy details. > > Replacing > > aGrid.SetLines(writer_cast<sal_uInt16>(nTextareaHeight/nLinePitch)); > > with > > if (nLinePitch > 0) > aGrid.SetLines(writer_cast<sal_uInt16>(nTextareaHeight/nLinePitch)); > > results in the document being correctly loaded (looks the same as what MS > Office shows in its viewer). > Maybe that is enough of a fix? From my point of view with fix would be enough to fix the problem. I have some further changes in mind to improve the corresponding method.
working on the fix which is definitely inspired by Andre ;-)
"orw" committed SVN revision 1496918 into trunk: 121977: WW8 import: apply grid property values, if grid is active and if the ...
fixed in trunk for AOO 4.0
Verify on Mac OS 10.8 on Rev. 1499347 ,pass ; maybe someone may verify on wondows8 OS
Verified with 4.0.0 RC on Windows 8 32-bit. Document loads and displays without error.