Bug 99722 - FILEOPEN REGRESSION: Writer 5.1.x freezes when opening particular .odt document. CPU 100%
Summary: FILEOPEN REGRESSION: Writer 5.1.x freezes when opening particular .odt docume...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.0.2 rc
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:5.2.0 target:5.1.4
Keywords: accessibility, bisected, perf, regression
Depends on:
Blocks:
 
Reported: 2016-05-07 20:36 UTC by Gerry
Modified: 2016-10-25 19:03 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Opening this file causes LO 5.1. freeze (1.37 MB, application/vnd.oasis.opendocument.text)
2016-05-07 20:36 UTC, Gerry
Details
bibisect results in 44max repository (4.19 KB, text/plain)
2016-05-09 02:15 UTC, Terrence Enger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerry 2016-05-07 20:36:30 UTC
Created attachment 124899 [details]
Opening this file causes LO 5.1. freeze

Opening attached Writer document freezes LibreOffice 5.1.x. The CPU runs to 100% and LibreOffice permanently freezes. After approx. 15 minutes, I had to kill the process. The bug is always reproducible; it is not possible to open attached .odt file in LO on my system. However, Softmaker Office 2016 and MS Word 2010 open it without problems.

This is a regression in LibreOffice 5.1.x. The file worked without problems in LibreOffice 4.4.6.3 (nd if I remember correctly also in LO 5.0.x).


LO Version: 5.1.2.2
Build-ID: 1:5.1.2-0ubuntu1
CPU-Threats: 4; BS-Version: Linux 4.4; UI-Render: Standard; 
Gebietsschema: en-US (de_DE.UTF-8)
All LO extensions are disabled.
OS: Gnome Ubuntu 16.04
Comment 1 m_a_riosv 2016-05-07 21:04:53 UTC
No issue win10x64,
Version: 5.1.3.2 (x64)
Build ID: 644e4637d1d8544fd9f56425bd6cec110e49301b
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default;
Comment 2 MM 2016-05-07 22:50:13 UTC
Confirmed with v5.1.3.2 under ubuntu 16.04 x64.
Confirmed with v5.2.0.0a1 under ubuntu 16.04 x64.
Unconfirmed with v5.0.6.1 under mint 17.3 x64.
Unconfirmed with v5.1.3.2 under windows 10 x64.

Seems linux only ?!
Comment 3 Terrence Enger 2016-05-09 02:15:42 UTC
Created attachment 124921 [details]
bibisect results in 44max repository

Working in the 44max bibisect repository, I see that the loop was
added at ...

    commit b4558b508141af16d335f45a0f12bdd34521e944
    Author: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
    Date:   Fri Aug 22 22:37:56 2014 +0200

        fdo#73151 Make better use of the sidebar
    
        The general idea is to encourage use of the sidebar instead of floating windows (for Navigator, Styles&Formatting and Gallery)
    
        Changes:
        * Show the sidebar by default in Writer & Impress
        * Remove the Gallery floating window (Gallery now always opens in the sidebar)
        * Remove all Gallery, Navigator and Styles&Formatting links from the default toolbar in Writer
          (since they have an icon in the sidebar and the sidebar is shown by default now)
        * When selecting "More" from the Styles dropdown, the Stylelist opens in the sidebar instead of the floating window
    
        This has all been discussed extensively here: https://bugs.freedesktop.org/show_bug.cgi?id=73151
    
        Change-Id: I3a0461d1472711da7121801000af294b432fccb1
        Reviewed-on: https://gerrit.libreoffice.org/11077
        Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
        Tested-by: Thomas Arnhold <thomas@arnhold.org>

I am adding keyword bisected.
Comment 4 Terrence Enger 2016-05-09 03:03:45 UTC
With my local build of master commit ead3777, pulled 2016-05-08 03:10
UCT, configured ...
    CC=ccache /usr/bin/gcc
    CXX=ccache /usr/bin/g++
    --enable-option-checking=fatal
    --enable-dbgutil
    --enable-debug
    --enable-crashdump
    --without-system-postgresql
    --without-myspell-dicts
    --with-extra-buildid
    --without-doxygen
    --with-external-tar=/home/terry/lo_hacking/git/src
built and running on debian-stretch, I see the busy loop within
SwRootFrame::CheckViewLayout, sw/source/core/layout/pagechg.cxx lines
1958 to 2178.
Comment 5 Michael Stahl (allotropia) 2016-05-11 18:58:35 UTC
can't reproduce results from comment #3

4.4.4.3    no loop
4.4.7.2    no loop
5-0 branch point no loop
5.0.0.0.beta3     no loop
5.0.0.1    no loop
5.0.0.2    loop
5.0.0.3    loop
5.0.0.5    loop
5.0.5.2    loop

then i bisected and found that it only loops with the gtk3 backend,
not gtk or gen... (note i'm running via ssh -X, apparently that
enables a11y with gtk3 but not gtk?)

ok this problem became visible with:

commit cfcae6481a9180d057a34e3a4a157dbc2f96918e
Author:     Caolán McNamara <caolanm@redhat.com>
AuthorDate: Fri Jun 26 13:24:19 2015 +0100

    Resolves: tdf#92293 gtk3: get a11y working
    
    (cherry picked from commit 093d7b8142d0cb224fcf23506f3b36f7a3a10d2c)


it's not a layout loop as such, but there are 175k or so a11y events
queued up for this 2700 page document and apparently there is some very
non-linear performance going on there
Comment 6 Commit Notification 2016-05-12 18:09:20 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e3b990a47fc4b0b1191eb15a53badfc71aebc1fc

tdf#99722 sw: silly performance issue when firing a11y events

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2016-05-13 14:20:43 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6afa142fdecc3a7f2f182bcd2c035bf3089f1ce8

tdf#99722 sw: avoid buffering a11y events for not-visible frames

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Michael Stahl (allotropia) 2016-05-13 14:23:46 UTC
dbgutil times to load reduced bugdoc on master, until it's displayed:

1000p 20:44
500p 04:20
250p 00:55
100p 00:19

with the first fix from comment #6

500p 01:37
250p 00:35

with the second fix from comment #7

500p 00:17
full 01:02

full, with gtk (no a11y) instead of gtk3, for comparison it's 00:58

i'm calling that fast enough for now
Comment 9 Commit Notification 2016-05-14 20:27:04 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=812233147c8b09b59eeb212663727a9063c7c9c6&h=libreoffice-5-1

tdf#99722 sw: silly performance issue when firing a11y events

It will be available in 5.1.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Gerry 2016-05-15 09:11:17 UTC
m.a.riosv, MM, Terrence, Michael, I am sending a big thank-you to you!
Comment 11 Commit Notification 2016-05-17 07:21:41 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dc5ab01a75877d4f4c79b7ff734d3f41a232c31f&h=libreoffice-5-1

tdf#99722 sw: avoid buffering a11y events for not-visible frames

It will be available in 5.1.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.