Bug 76057

Summary: FILE/OPEN: Writer crashes while opening the docx file
Product: LibreOffice Reporter: bisal.nayal
Component: WriterAssignee: bisal.nayal
Status: RESOLVED WORKSFORME    
Severity: major CC: jorendc, serval2412, st.shishkin
Priority: medium Keywords: haveBacktrace
Version: 4.3.0.0.alpha0+ Master   
Hardware: All   
OS: other   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: This file opens properly on MSWord 2010, but LO crashes while opening the file
This file has the stack
this file contains table in footnote, but it doesn't crash
console logs + bt with symbols

Description bisal.nayal 2014-03-12 06:21:41 UTC
Created attachment 95637 [details]
This file opens properly on MSWord 2010, but LO crashes while opening the file

STEPS:

1) Open the attached file in LO (Version: 4.3.0.0.alpha0+
Build ID: dd7787ed75e33b65ebee2a6c0aa152efded6f1b8 )

2) LO crashes.

Expected:
LO shouldn't crash.

I have attached the stack trace also.
Comment 1 bisal.nayal 2014-03-12 06:22:21 UTC
Created attachment 95638 [details]
This file has the stack
Comment 2 bisal.nayal 2014-03-12 08:28:42 UTC
1) The original file added to this bug contains a table which spans across pages. 2) On a table cell a footnote has been added.
3) In the footnote again a table has been added.
4) If I remove the table LO doesn't crash.
Comment 3 bisal.nayal 2014-03-12 11:48:07 UTC
Created attachment 95654 [details]
this file contains table in footnote, but it doesn't crash
Comment 4 Julien Nabet 2014-03-12 22:09:23 UTC
Created attachment 95682 [details]
console logs + bt with symbols

On pc Debian x86-64 with master sources updated yesterday, I could reproduce this.

I attached console logs + bt
Comment 5 Julien Nabet 2014-03-12 22:10:47 UTC
I haven't tested but could this patch make it?
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index fd6a778..86d007b 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1013,7 +1013,7 @@ SwFrm *SwFrm::_FindPrev()
         if ( !bIgnoreTab && pThis->IsInTab() )
         {
             SwLayoutFrm *pUp = pThis->GetUpper();
-            while ( !pUp->IsCellFrm() )
+            while ( pUp && !pUp->IsCellFrm() )
                 pUp = pUp->GetUpper();
             OSL_ENSURE( pUp, "Cntnt in table but not in cell." );
             if ( pUp->IsAnLower( pPrvCnt ) )
Comment 6 bisal.nayal 2014-03-13 05:14:44 UTC
(In reply to comment #5)
> I haven't tested but could this patch make it?
> diff --git a/sw/source/core/layout/findfrm.cxx
> b/sw/source/core/layout/findfrm.cxx
> index fd6a778..86d007b 100644
> --- a/sw/source/core/layout/findfrm.cxx
> +++ b/sw/source/core/layout/findfrm.cxx
> @@ -1013,7 +1013,7 @@ SwFrm *SwFrm::_FindPrev()
>          if ( !bIgnoreTab && pThis->IsInTab() )
>          {
>              SwLayoutFrm *pUp = pThis->GetUpper();
> -            while ( !pUp->IsCellFrm() )
> +            while ( pUp && !pUp->IsCellFrm() )
>                  pUp = pUp->GetUpper();
>              OSL_ENSURE( pUp, "Cntnt in table but not in cell." );
>              if ( pUp->IsAnLower( pPrvCnt ) )


Miklos told me that currently tables are not supported in footnotes. but I found a weird thing..
1) if single table in a footnote on the last paragraph, then it doesn't crash else if the footnote is on any other page it crashes.

Miklos has asked to handle it the same way as done for doc import.
Comment 7 bisal.nayal 2014-03-13 14:10:46 UTC
(In reply to comment #5)
> I haven't tested but could this patch make it?
> diff --git a/sw/source/core/layout/findfrm.cxx
> b/sw/source/core/layout/findfrm.cxx
> index fd6a778..86d007b 100644
> --- a/sw/source/core/layout/findfrm.cxx
> +++ b/sw/source/core/layout/findfrm.cxx
> @@ -1013,7 +1013,7 @@ SwFrm *SwFrm::_FindPrev()
>          if ( !bIgnoreTab && pThis->IsInTab() )
>          {
>              SwLayoutFrm *pUp = pThis->GetUpper();
> -            while ( !pUp->IsCellFrm() )
> +            while ( pUp && !pUp->IsCellFrm() )
>                  pUp = pUp->GetUpper();
>              OSL_ENSURE( pUp, "Cntnt in table but not in cell." );
>              if ( pUp->IsAnLower( pPrvCnt ) )


I tried your change, LO still crashes..
Comment 8 Jorendc 2014-07-20 17:23:43 UTC
The first attachment doesn't crash, tested using Windows 8.1 with LibreOffice Version: 4.4.0.0.alpha0+
Build ID: a82ff18269e5b37348d402b7c21c3f200068265c
TinderBox: Win-x86@39, Branch:master, Time: 2014-07-20_02:34:36

@Julien: you mind retesting and verifying? 

Kind regards,
Joren
Comment 9 Julien Nabet 2014-07-20 22:08:37 UTC
I confirm I've got no more crash too with master sources updated today.