Bug 134203 - Layout loop for single cell table splitting across 23 pages with tables within; SwFrame::setRootFrame -> SwFrame::UnionFrame
Summary: Layout loop for single cell table splitting across 23 pages with tables withi...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks: Anchor-and-Text-Wrap CPU-AT-100%
  Show dependency treegraph
 
Reported: 2020-06-21 18:27 UTC by Telesto
Modified: 2021-08-26 15:04 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Example file (1.33 MB, application/vnd.oasis.opendocument.text)
2020-06-21 18:28 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-06-21 18:27:30 UTC
Description:
Layout loop 

Steps to Reproduce:
1. Open the attached file
2. Press Enter 20x -> Hang/freeze

Actual Results:
Freeze

Expected Results:
Some response.. not looping for ever


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 43c60ce1ac7629a1462e927e6ff937469f58f743
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2020-06-21 18:28:44 UTC
No repro with
Version: 6.3.0.0.beta1+ (x86)
Build ID: 5cfac16dbd4af456a7fb6d52c8953c69a72ba2ba
CPU threads: 4; OS: Windows 6.3; UI render: GL; VCL: win; 
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL
Comment 2 Telesto 2020-06-21 18:28:56 UTC
Created attachment 162266 [details]
Example file
Comment 3 Attila Baraksó (NISZ) 2020-06-27 11:33:43 UTC
Reproduced in:

Version: 7.1.0.0.alpha0+
Build ID: 10129e2dfc582915d999e24deed34f7303a6f02e
CPU threads: 6; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded
Comment 4 Buovjaga 2020-06-29 15:42:32 UTC
No repro

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 8fe03ea93213bbb19b6ee9862a3966144f0df5cb
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: Skia/Raster; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: threaded
Comment 5 Telesto 2020-06-29 16:44:19 UTC
(In reply to Buovjaga from comment #4)
Still the same
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 006c65bbd472cb1d7d44e095714e28190b76be0d
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

@Buovjaga.. do you also have throttle button on you're powerful machine. Maybe it's some kind of race condition .. And your computer is just to fast to hit it
Comment 6 psidiumcode 2021-08-16 19:01:03 UTC
I could reproduce it. 
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 5aac78e5fb241050a86714687e9ff8804588ae3c
CPU threads: 12; OS: Mac OS X 10.15.7; UI render: default; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded

I could reproduce it, when I pressed enter over 20X.
Version: 7.0.6.2
Build ID: 144abb84a525d8e30c9dbbefa69cbbf2d8d4ae3b
CPU threads: 12; OS: Mac OS X 10.15.7; UI render: default; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 7 Buovjaga 2021-08-26 09:17:37 UTC
Bibisected with linux-64-6.4 to
https://git.libreoffice.org/core/commit/383032c50a3e3354f04200ce984a47ab9d2c5c67
tdf#123583 use TaskStopwatch for Writer Idle loop

Adding Cc: to Jan-Marek Glogowski
Comment 8 Jan-Marek Glogowski 2021-08-26 10:00:09 UTC
FYI: the bibisect commit was reverted to fix bug 141556 in 
https://git.libreoffice.org/core/+/0fedac18214a6025401c4c426466a5166553e8ec%5E%21

I tried to find an alternative fix (dropping quite some code), but everything I came up with resulted in broken layout: https://gerrit.libreoffice.org/c/core/+/114105

Main problem is that I simply don't understand the condition, when it's actually fine to break the layout, so it can be resumed correctly. 2nd problem is, that the idle layout is currently stateless, but for my current approach it would need some state to handle removing of pages.

So I'm removing the bibisect* keywords; maybe it can be bibisected again hoping for a better result.
Comment 9 Buovjaga 2021-08-26 10:06:45 UTC
(In reply to Jan-Marek Glogowski from comment #8)
> FYI: the bibisect commit was reverted to fix bug 141556 in 
> https://git.libreoffice.org/core/+/
> 0fedac18214a6025401c4c426466a5166553e8ec%5E%21
> 
> I tried to find an alternative fix (dropping quite some code), but
> everything I came up with resulted in broken layout:
> https://gerrit.libreoffice.org/c/core/+/114105
> 
> Main problem is that I simply don't understand the condition, when it's
> actually fine to break the layout, so it can be resumed correctly. 2nd
> problem is, that the idle layout is currently stateless, but for my current
> approach it would need some state to handle removing of pages.
> 
> So I'm removing the bibisect* keywords; maybe it can be bibisected again
> hoping for a better result.

I don't see how it could be bibisected again as 0fedac18214a6025401c4c426466a5166553e8ec makes no difference to the result. Do you mean bibisecting earlier than 6.4? What would be the good/bad states?
Comment 10 Jan-Marek Glogowski 2021-08-26 10:20:20 UTC
(In reply to Buovjaga from comment #9)
> (In reply to Jan-Marek Glogowski from comment #8)
> > FYI: the bibisect commit was reverted to fix bug 141556 in 
> > https://git.libreoffice.org/core/+/
> > 0fedac18214a6025401c4c426466a5166553e8ec%5E%21
> > 
> > I tried to find an alternative fix (dropping quite some code), but
> > everything I came up with resulted in broken layout:
> > https://gerrit.libreoffice.org/c/core/+/114105
> > 
> > Main problem is that I simply don't understand the condition, when it's
> > actually fine to break the layout, so it can be resumed correctly. 2nd
> > problem is, that the idle layout is currently stateless, but for my current
> > approach it would need some state to handle removing of pages.
> > 
> > So I'm removing the bibisect* keywords; maybe it can be bibisected again
> > hoping for a better result.
> 
> I don't see how it could be bibisected again as
> 0fedac18214a6025401c4c426466a5166553e8ec makes no difference to the result.
> Do you mean bibisecting earlier than 6.4? What would be the good/bad states?

No. I thought it may have been fixed by 0fedac18214a6025401c4c426466a5166553e8ec and then broken again after it and you just unluckily skipped that in the bibisect. My assumption is that 0fedac18214a6025401c4c426466a5166553e8ec is ok, as it's a revert.

OTOH, while it technically reverts my commit, it also includes new code to fix the original problem. So you can test 0fedac18214a6025401c4c426466a5166553e8ec, but if that is still broken, you need to rule out, that the new code introduces this, which would mean to build LO at that commit and just revert the new part; that's a lot of work...

Or maybe it's enough to just revert that new code part on master.
Comment 11 Buovjaga 2021-08-26 10:29:23 UTC
(In reply to Jan-Marek Glogowski from comment #10)
> No. I thought it may have been fixed by
> 0fedac18214a6025401c4c426466a5166553e8ec and then broken again after it and
> you just unluckily skipped that in the bibisect. My assumption is that
> 0fedac18214a6025401c4c426466a5166553e8ec is ok, as it's a revert.
> 
> OTOH, while it technically reverts my commit, it also includes new code to
> fix the original problem. So you can test
> 0fedac18214a6025401c4c426466a5166553e8ec, but if that is still broken, you
> need to rule out, that the new code introduces this, which would mean to
> build LO at that commit and just revert the new part; that's a lot of work...
> 
> Or maybe it's enough to just revert that new code part on master.

In my comment 9 I should have mentioned that I checked out and tested 0fedac18214a6025401c4c426466a5166553e8ec in 7.2 repo
Comment 12 Buovjaga 2021-08-26 10:45:11 UTC
I will try manually reverting later today and compiling
Comment 13 Buovjaga 2021-08-26 11:43:10 UTC
I reverted the new bit, but unfortunately the problem remains :(

Git diff of what I changed:

diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index a0f955aa4099..a0f84d720a67 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -21,7 +21,6 @@
 
 #include <sal/config.h>
 
-#include <vcl/inputtypes.hxx>
 #include <tools/color.hxx>
 
 #include <ctime>
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 95a48df5efda..e5edd93cee58 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -39,7 +39,6 @@
 #include <sfx2/event.hxx>
 
 #include <ftnidx.hxx>
-#include <vcl/svapp.hxx>
 #include <editeng/opaqitem.hxx>
 #include <SwSmartTagMgr.hxx>
 #include <sal/log.hxx>
@@ -2246,7 +2245,7 @@ SwLayIdle::SwLayIdle( SwRootFrame *pRt, SwViewShellImp *pI ) :
         bool bInterrupt(false);
         {
             SwLayAction aAction( m_pRoot, m_pImp );
-            aAction.SetInputType( VCL_INPUT_ANY & VclInputFlags(~VclInputFlags::TIMER) );
+            aAction.SetInputType( VCL_INPUT_ANY );
             aAction.SetIdle( true );
             aAction.SetWaitAllowed( false );
             aAction.Action(m_pImp->GetShell()->GetOut());
Comment 14 Telesto 2021-08-26 15:04:43 UTC
(In reply to Jan-Marek Glogowski from comment #8)
> Main problem is that I simply don't understand the condition, when it's
> actually fine to break the layout, so it can be resumed correctly. 2nd
> problem is, that the idle layout is currently stateless, but for my current
> approach it would need some state to handle removing of pages.

Is this not simply some layout issue, where table rendering keeps forcing a frame union. Which for some reason not 'passed' based on timing? 

I see this more as an uncovered table splitting bug. Where certain kind of frame union is tried, but failing (oscillating back and forward) without a bail-out (likely because embedded table in table)

The bail-out obviously result in some layout change, but if it's the same prior 6.4, who cares? Layout loop seems more evil to me ;-)