Issue 125723 - CRASH when open particular.html documents
Summary: CRASH when open particular.html documents
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: open-import (show other issues)
Version: 3.4.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: crash, regression
Depends on:
Blocks:
 
Reported: 2014-10-07 06:24 UTC by Rainer Bielefeld
Modified: 2023-01-04 04:52 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---


Attachments
streamed down version of wiki page (102.62 KB, text/html)
2015-01-14 20:18 UTC, Dorel
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Rainer Bielefeld 2014-10-07 06:24:18 UTC
Steps how to reproduce with "AOO 4.2.0-Dev – German UI / German locale [AOO420m1(Build:9800)  -  Rev. 1628595  2014-10-02]" on German WIN7 Home Premium (64bit)", own user profile:

1. From (Seamonkey-) Browser save <https://wiki.openoffice.org/wiki/Main_Page>
   on you HDD so that you will get a document "Apache OpenOffice Wiki.htm"
   and a folder "Apache OpenOffice Wiki-files" with all required additional
   contents like pictures ...
2. From Start Center - AOO files dialog open "Apache OpenOffice Wiki.htm"
   > CRASH

Many Mediawiki, but also other pages are affected like
<https://cwiki.apache.org/confluence/display/OOOUSERS/QA+Testing+Preferences>
<https://en.wikipedia.org/wiki/File:NortheimWassergasse.jpg>
<https://en.wikipedia.org/wiki/Northeim>,

but not

<http://ci.apache.org/projects/openoffice/index.html>
<http://ask.libreoffice.org/en/questions/scope:unanswered/sort:answers-asc/page:1/>
and many others

Was still ok with OOo 3.3.0
Already crashes with AOO 3.4.0

Also crashes if yo try to open via WEB page URL in file name pane of AOO file open dialog.

No Crash when you copy WEB page contents from (Seamonkey-) Browser to empty new AOO Writer/WEB document
Comment 1 Dorel 2015-01-14 20:18:26 UTC
Created attachment 84420 [details]
streamed down version of wiki page
Comment 2 Dorel 2015-01-14 20:25:59 UTC
(In reply to Dorel from comment #1)
> Created attachment 84420 [details]
> streamed down version of wiki page

I tried to generalize, but the furthest that i got was that the problem could be connected to how the document is saved (issue did not reproduced if I saved as "html only") and - at least for the wiki pages - issue seems to be triggered by some code inside the page (removing big chunks of code from the html the issue did not reproduce anymore).
I've attached such a streamed down wiki file, containing as least elements as i could, for which the issue reproduces.

Description of steps (that always trigger the issue):
1. download a wiki webpage - complete html (File -> Save As -> Complete Webpage)
2. Open the .html file with Open Office Writer (File - Open or by right clicking - Open with)

Actual:
OpenOffice crashes and OO Document Recovery screen is shown.
Trying the recovery option, OO crashes again and Document Recovery screen is shown.

Expected: 
OO Writer should not crash when opening .html files. 
It should also be taken into account that, according to the wiki, Writer has HTML capabilities, thus it should be able to open HTML documents (or at least trigger a message if it can not and not crash).

Notes: 
Issue does not happen if the page was saved as "html only" or content was copy/pasted from the browser.
Also, I would have tried to also attach a log file, but according to the OO wiki it's better to send them from inside the application.
I used wiki pages from wikipedia.org and cwiki.apache.org, in order to reproduce the issue in a easier way.


This issue was reproduced on the following configuration:
- Windows 7 64 bit - AOO 4.2.0-Dev-En_US (Build 9800 - Rev. 1651106) 
- Windows 7 64bit - AOO 3.4.0 - version from issue
- MAC OS X Yosemite (10.10.1) - AOO411m6(Build:9775)  -  Rev. 1617669
- Windows 7 (64 bit) - AOO411m4(Build:9774) - Rev. 1614269
- Windows Server 2008 Standard - AOO411m6(Build:9775)  -  Rev. 1617669
- Windows Server 2008 Standard - with an older version - 3.4.1 AOO341m1 - build:9593
Browsers used were Firefox 34.0.5 and Chrome 39.0.

The issue seems not to be platform or browser dependent.

Using Microsoft Office 2010 (14.0.7140.5002 - 64 bit) this issue does not reproduce - the file is opened and text shown. Also Wordpad (from Windows 7) opened the file instantly.

As a user and because in the wiki and site pages it's stated that OO Writer has HTML capabilities, I would expect that the Writer would be able to open html documents. If there is a problem while opening the document, the application should not crash (maybe inform the user about the problem).
Comment 3 damjan 2023-01-04 04:52:14 UTC
This sample file still crashes in the latest Git on FreeBSD, so it's not Windows related.

Confirming.

Let's see why.

If you Alt+Shift+Ctrl+D and set it to send warnings and errors to "Shell", there are tons of messages like:

Warning: GetOption: unbekannte HTML-Option From File main/svtools/source/svhtml/parhtml.cxx at Line 1519

Warning: es gibt gar keine Attribute From File main/svl/source/items/itemiter.cxx at Line 46

Warning: SfxDocumentMetaData: invalid date: 
Warning: SfxDocumentMetaData: invalid duration: 
Error: assertion failed! From File main/sw/source/ui/app/apphdl.cxx at Line 698

Now let's see what gdb can tell us. When it crashes, the top of the stack looks like this:

---snip---
Thread 1 received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
SwViewOption::getBrowseMode (this=0x0) at inc/viewopt.hxx:411
411	    inline sal_Bool  getBrowseMode() const { return mbBrowseMode; }
(gdb) bt
#0  SwViewOption::getBrowseMode() const (this=0x0) at inc/viewopt.hxx:411
#1  0x000000080e8bd28e in SwFlyFrm::CalcRel(SwFmtFrmSize const&) const (this=this@entry=0x80db25d90, rSz=...) at source/core/layout/fly.cxx:2581
#2  0x000000080e8bca58 in SwFlyFrm::Format(SwBorderAttrs const*) (this=0x80db25d90, pAttrs=0x80fd44420) at source/core/layout/fly.cxx:1386
#3  0x000000080e8c45cc in SwFlyFreeFrm::MakeAll() (this=0x80db25d90) at source/core/layout/flylay.cxx:231
#4  0x000000080e8ab594 in SwFrm::PrepareMake() (this=0x80db25d90) at source/core/layout/calcmove.cxx:388
#5  0x000000080e8da91d in SwLayAction::FormatLayoutFly(SwFlyFrm*) (this=0x7fffffffc500, pFly=0x80db25d90) at source/core/layout/layact.cxx:1644
#6  0x000000080e8e9435 in SwObjectFormatter::_FormatObj(SwAnchoredObject&) (this=0x80a9a0190, _rAnchoredObj=...) at source/core/layout/objectformatter.cxx:362
#7  0x000000080e8ea57a in SwObjectFormatterLayFrm::DoFormatObj(SwAnchoredObject&, bool) (this=0x0, _rAnchoredObj=...) at source/core/layout/objectformatterlayfrm.cxx:90
#8  0x000000080e8e965c in SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (this=0x80a9a0190, _pMasterTxtFrm=<optimized out>) at source/core/layout/objectformatter.cxx:497
#9  0x000000080e8ea5bc in SwObjectFormatterLayFrm::DoFormatObjs() (this=0x0) at source/core/layout/objectformatterlayfrm.cxx:102
#10 0x000000080e8e91cd in SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (_rAnchorFrm=<optimized out>, _rPageFrm=<optimized out>, _pLayAction=<optimized out>) at source/core/layout/objectformatter.cxx:213
#11 0x000000080e8d7b3b in SwLayAction::InternalAction() (this=this@entry=0x7fffffffc500) at source/core/layout/layact.cxx:694
#12 0x000000080e8d762b in SwLayAction::Action() (this=0x7fffffffc500) at source/core/layout/layact.cxx:497
#13 0x000000080eb200ca in ViewShell::ImplEndAction(unsigned char) (this=0x80dc0a410, bIdleEnd=0 '\000') at source/core/view/viewsh.cxx:210
#14 0x000000080e7183f0 in ViewShell::EndAction(unsigned char) (this=this@entry=0x80dc0a410, bIdleEnd=bIdleEnd@entry=0 '\000') at inc/viewsh.hxx:619
#15 0x000000080e7109d4 in SwCrsrShell::EndAction(unsigned char) (this=0x80dc0a410, bIdleEnd=<optimized out>) at source/core/crsr/crsrsh.cxx:282
#16 0x000000080ed0f135 in SwView::OuterResizePixel(Point const&, Size const&) (this=0x80daf1890, rOfst=..., rSize=...) at source/ui/uiview/viewport.cxx:1219
#17 0x00000008014c8153 in SfxViewFrame::DoAdjustPosSizePixel(SfxViewShell*, Point const&, Size const&) (this=this@entry=0x80dbb7a10, pSh=pSh@entry=0x80daf1890, rPos=..., rSize=...) at source/view/viewfrm.cxx:1782
#18 0x00000008014cba3f in SfxViewFrame::Resize(unsigned char) (this=0x80dbb7a10, bForce=<optimized out>) at source/view/viewfrm.cxx:2800
#19 0x00000008014cdcf3 in SfxFrameViewWindow_Impl::Resize() (this=0x80daf1d90) at source/view/viewfrm2.cxx:111
#20 0x0000000802c10db8 in Window::ImplCallResize() (this=this@entry=0x80daf1d90) at source/window/window.cxx:1148
#21 0x0000000802c158d2 in Window::Show(unsigned char, unsigned short) (this=0x80daf1d90, bVisible=<optimized out>, nFlags=0) at source/window/window.cxx:6597
#22 0x00000008014babd8 in SfxBaseController::ConnectSfxFrame_Impl(SfxBaseController::ConnectSfxFrame) (this=this@entry=0x80dd36540, i_eConnect=i_eConnect@entry=SfxBaseController::E_CONNECT) at source/view/sfxbasecontroller.cxx:1352
#23 0x00000008014ba7cf in SfxBaseController::attachFrame(com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (this=0x80dd36540, xFrame=...) at source/view/sfxbasecontroller.cxx:635
#24 0x00000008014b0cc4 in SfxFrameLoader_Impl::impl_createDocumentView(com::sun::star::uno::Reference<com::sun::star::frame::XModel2> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, comphelper::NamedValueCollection const&, rtl::OUString const&) (this=<optimized out>, i_rModel=..., i_rFrame=..., i_rViewFactoryArgs=..., i_rViewName=...) at source/view/frmload.cxx:510
---snip---


The proximal cause is that a "this" value of NULL is passed to:

#0  SwViewOption::getBrowseMode() const (this=0x0) at inc/viewopt.hxx:411

From the frame below:

---snip---
2581	             pSh && pSh->GetViewOptions()->getBrowseMode() &&
---snip---

and:

---snip---
(gdb) print pSh->GetViewOptions()
$3 = (const SwViewOption *) 0x0
---snip---

Since:

---snip---
Was still ok with OOo 3.3.0
Already crashes with AOO 3.4.0
---snip---

then it seems like a possible regression too.