Bug 90303 - Resizing window of large file causes hang / crash
Summary: Resizing window of large file causes hang / crash
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.1.2 release
Hardware: Other Linux (All)
: medium critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-28 19:24 UTC by Jackson Sul
Modified: 2016-03-29 18:21 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
large file example (1.56 MB, application/vnd.oasis.opendocument.text)
2015-03-28 19:24 UTC, Jackson Sul
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jackson Sul 2015-03-28 19:24:30 UTC
Created attachment 114425 [details]
large file example

Resizing the window when Writer has a large file open causes the it to hang or crash. Small files resize instantaneously, but larger files can take dozens of seconds or even minutes to resize the window. Attached is a large example file which simply causes LO to permanently hang on my computer (well, after 4 minutes the window still does not resize so I force quit the program). I'm using version 4.4.1.2 on Ubuntu 14.04. This does not occur with version 4.2, which resizes the window of even extremely large files instantly. 

To reproduce, simply open a large .odt file, then resize the window (e.g. maximize a non-maximized window or vice versa). The program will hang, and possible permanently crash allowing for the possibility of data loss.
Comment 1 Robinson Tryon (qubit) 2015-03-29 15:20:38 UTC
TESTING with 4.4.1.2 + Ubuntu 14.04
(and a 4.5 master from 2015-03-19)

(In reply to Aibara from comment #0)
> Created attachment 114425 [details]
> large file example

How big is this document? Just trying to open it in Writer causes the application to freeze-up on my machine. Maybe someone with a beefier machine can open it?  (cc'ing mjf)
Comment 2 Matthew Francis 2015-03-29 15:52:55 UTC
Attempted with both my beefy machines:

- Ubuntu 14.04/lxde
    4.4.2.1: Loaded and resized snappily. No issues
    Latest 4.5 master: A big slower, but that's not surprising when it's compiled with debug on. Otherwise no issues

- OSX 10.10
    4.2.6.3, 4.3.5.1: Loaded and resized snappily. No issues
    4.4.2.1: Hung variously on loading and shortly after when resizing the window.


So clearly there's some kind of issue there, but the nature of it isn't clear. Possibly layout related rather than specifically resize. (When it hung on loading, it did so in the part where it looks like the toolbars, sidebar etc. are sizing themselves, which could support that theory)

It would very useful if someone who could reproduce this on Linux could wave the 44max bibisect repository at it - back to you, cq?
(probably start by explicitly trying "latest" and "oldest" to validate my assumption about the period)

-> NEW
Comment 3 Michael 2015-05-20 21:32:19 UTC
I can not reproduce with 5.0 master or 4.3.7.2. Also tried 'oldest' and 'latest' in both bibisect-44 and bibisect-44max without reproduction. (All Linux 64bit)

In all cases, file opens rapidly (2-3 seconds maximum), resizing the window is instant, and jumping hundreds of pages through the document is also instant.
Comment 4 Armin Le Grand (allotropia) 2015-11-05 15:33:42 UTC
Could not reproduce on Win7 using 5.1.0.0.alpha1+. Zoom is pretty fast (ctrl. scroll wheel). Window resize is fast, too. Also fast with ZoomFactor 'optimal' whch make sthe content zoom when you change win size. Gets slow at some point when zoom close or below 25% so that many pages are shown (without 'optimal'), but that is the amount of data to paint and has to start at some point, no used case.
Comment 5 Björn Michaelsen 2015-11-23 22:39:43 UTC
Not reproducible on 1:5.0.3~rc2-0ubuntu1 from ppa on Ubuntu 15.10. Possibly RESOLVED/WORKSFORME (esp. with comments 3 and 4). NEEDINFO for now for a better repoduction scenario.
Comment 6 Robinson Tryon (qubit) 2015-12-14 05:32:48 UTC
Migrating Whiteboard tags to Keywords: (bibisectRequest)
[NinjaEdit]
Comment 7 Luke Kendall 2016-01-17 07:20:55 UTC
I have this same problem with LO 5.0.3.2 on Linux after upgrading to Xenial release (16.04).

When I open a large file (e.g. 130k wds or more), if the default starting window size is wide, so I need to resize it to just see one page at a atime, not two pages side-by-side, and I resize the window, it takes about 5 minutes for the resize to complete.

What I observe while it's doing so is the LO window goes grey (which means, in the Xenial UI, the process has become CPU-bound), and the window resizes in increments of what looks very much like 1 pixel at a time, with a second or few between each redraw of the window, 1 pixel narrower.

When it has eventually finished resizing, performance seems normal.

But, I just now tried to scroll, and missed the scrollbar and accidentally resized the window frame instead. Instantly, LO locks up as described above, and I'm still waiting for the small resizing to finish while I type this addendum.

Vertical resizing of the window is slow (you can watch the step-by-step redraws), but orders of magnitude faster than the horizontal resizing (narrowing) of the window.
Comment 8 Luke Kendall 2016-01-17 07:30:44 UTC
Oh, and having just now needed to open a 2nd large file, I can confirm that when you resize a 2nd window, not only does the 5-min-creep-towards-resize commence, but it affects all open LO windows.

Here's some "top" output:
$ top

top - 18:25:59 up 14:02,  1 user,  load average: 1.39, 0.85, 0.84
Tasks: 288 total,   3 running, 283 sleeping,   1 stopped,   1 zombie
%Cpu(s): 38.7 us,  2.8 sy,  0.0 ni, 58.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 16100300 total,   424464 free,  2789796 used, 12886040 buff/cache
KiB Swap:  9820156 total,  9815708 free,     4448 used. 12025944 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
22209 luke      20   0 1661780 245772 116936 R 101.0  1.5   6:27.63 soffice.bin 

If it helps, I attached to the process with gdb and asked for a backtrace while it was CPU-bound:

(gdb) where
#0  0x00007fe099669335 in com::sun::star::uno::OWeakRefListener::acquire() ()
   from /opt/libreoffice5.0/program/libuno_cppuhelpergcc3.so.3
#1  0x00007fe09960177a in cppu::sequenceRemoveElementAt(com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >&, int)
    () from /opt/libreoffice5.0/program/libuno_cppuhelpergcc3.so.3
#2  0x00007fe09960233f in cppu::OInterfaceContainerHelper::removeInterface(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) ()
   from /opt/libreoffice5.0/program/libuno_cppuhelpergcc3.so.3
#3  0x00007fe09966beaa in com::sun::star::uno::WeakReferenceHelper::clear() ()
   from /opt/libreoffice5.0/program/libuno_cppuhelpergcc3.so.3
#4  0x00007fe06ceabdd3 in std::_List_base<SwAccessibleEvent_Impl, std::allocator<SwAccessibleEvent_Impl> >::_M_clear() ()
   from /opt/libreoffice5.0/program/../program/libswlo.so
#5  0x00007fe06cea1e5a in SwAccessibleMap::FireEvents() ()
   from /opt/libreoffice5.0/program/../program/libswlo.so
#6  0x00007fe06d491881 in SwViewShell::ImplEndAction(bool) ()
   from /opt/libreoffice5.0/program/../program/libswlo.so
#7  0x00007fe06cf01493 in SwCrsrShell::EndAction(bool, bool) ()
   from /opt/libreoffice5.0/program/../program/libswlo.so
#8  0x00007fe06d6e5f53 in SwView::OuterResizePixel(Point const&, Size const&)
    () from /opt/libreoffice5.0/program/../program/libswlo.so
#9  0x00007fe0a0afea6a in SfxViewFrame::DoAdjustPosSizePixel(SfxViewShell*, Point const&, Size const&) () from /opt/libreoffice5.0/program/libmergedlo.so
#10 0x00007fe0a0afff60 in SfxViewFrame::Resize(bool) ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#11 0x00007fe0a17bb1e7 in vcl::Window::ImplCallResize() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#12 0x00007fe0a1822fd1 in vcl::Window::ImplPosSizeWindow(long, long, long, long, PosSizeFlags) () from /opt/libreoffice5.0/program/libmergedlo.so
#13 0x00007fe0a1823e26 in vcl::Window::setPosSizePixel(long, long, long, long, PosSizeFlags) () from /opt/libreoffice5.0/program/libmergedlo.so
#14 0x00007fe0a0ae270e in SfxFrame::SetToolSpaceBorderPixel_Impl(SvBorder const&) () from /opt/libreoffice5.0/program/libmergedlo.so
#15 0x00007fe0a08a220e in SfxFrameWorkWin_Impl::ArrangeChildren_Impl(bool) ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#16 0x00007fe0a0ae2b5f in SfxFrame::Resize() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#17 0x00007fe0a17bb1e7 in vcl::Window::ImplCallResize() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#18 0x00007fe0a1822fd1 in vcl::Window::ImplPosSizeWindow(long, long, long, long, PosSizeFlags) () from /opt/libreoffice5.0/program/libmergedlo.so
#19 0x00007fe0a1822f6f in vcl::Window::ImplPosSizeWindow(long, long, long, long, PosSizeFlags) () from /opt/libreoffice5.0/program/libmergedlo.so
#20 0x00007fe0a1823e26 in vcl::Window::setPosSizePixel(long, long, long, long, PosSizeFlags) () from /opt/libreoffice5.0/program/libmergedlo.so
#21 0x00007fe0a14503ab in VCLXWindow::setPosSize(int, int, int, int, short) ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#22 0x00007fe0a0437b1e in framework::DockingAreaDefaultAcceptor::setDockingAreaSpace(com::sun::star::awt::Rectangle const&) ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#23 0x00007fe0a04727f6 in framework::LayoutManager::implts_doLayout(bool, bool)
    () from /opt/libreoffice5.0/program/libmergedlo.so
#24 0x00007fe0a0477366 in framework::LayoutManager::AsyncLayoutHdl(Timer*) ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#25 0x00007fe0a04655e2 in framework::LayoutManager::windowResized(com::sun::star::awt::WindowEvent const&) () from /opt/libreoffice5.0/program/libmergedlo.so
#26 0x00007fe0a1575835 in WindowListenerMultiplexer::windowResized(com::sun::star::awt::WindowEvent const&) () from /opt/libreoffice5.0/program/libmergedlo.so
#27 0x00007fe0a1454729 in VCLXWindow::ProcessWindowEvent(VclWindowEvent const&)
    () from /opt/libreoffice5.0/program/libmergedlo.so
#28 0x00007fe0a144f659 in VCLXWindow::WindowEventListener(VclSimpleEvent*) ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#29 0x00007fe0a1a2b41f in VclEventListeners::Call(VclSimpleEvent*) const ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#30 0x00007fe0a17bacce in vcl::Window::CallEventListeners(unsigned long, void*)
    () from /opt/libreoffice5.0/program/libmergedlo.so
#31 0x00007fe0a1822fd1 in vcl::Window::ImplPosSizeWindow(long, long, long, long, PosSizeFlags) () from /opt/libreoffice5.0/program/libmergedlo.so
#32 0x00007fe0a1781bf9 in ImplBorderWindow::Resize() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#33 0x00007fe0a17bb1e7 in vcl::Window::ImplCallResize() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#34 0x00007fe0a1777d46 in vcl::Window::ImplHandleResizeTimerHdl(Idle*) ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#35 0x00007fe0a1a16f9f in ImplSchedulerData::Invoke() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#36 0x00007fe0a1a1710f in Scheduler::ProcessTaskScheduling(bool) ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#37 0x00007fe0a1a242e0 in Application::Yield() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#38 0x00007fe0a1a24395 in Application::Execute() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#39 0x00007fe0a0b35f13 in desktop::Desktop::Main() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#40 0x00007fe0a1a29609 in ImplSVMain() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#41 0x00007fe0a1a29652 in SVMain() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#42 0x00007fe0a0b54d82 in soffice_main ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#43 0x000000000040075b in main ()

In contrast, when LO returns to normal, I see:

(gdb) where
#0  0x00007fe09e9f583d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fe09acc230c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fe09acc241c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fe08df3f4d3 in GtkData::Yield(bool, bool) ()
   from /opt/libreoffice5.0/program/libvclplug_gtklo.so
#4  0x00007fe0a1a24313 in Application::Yield() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#5  0x00007fe0a1a24395 in Application::Execute() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#6  0x00007fe0a0b35f13 in desktop::Desktop::Main() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#7  0x00007fe0a1a29609 in ImplSVMain() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#8  0x00007fe0a1a29652 in SVMain() ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#9  0x00007fe0a0b54d82 in soffice_main ()
   from /opt/libreoffice5.0/program/libmergedlo.so
#10 0x000000000040075b in main ()

Hope that helps.
Comment 9 Luke Kendall 2016-01-17 07:42:42 UTC
Oh, and since I started it from a Terminal window, I notice that I (currently) have about 30 warnings like this:

** (soffice:22209): WARNING **: Unknown event notification 36

** (soffice:22209): WARNING **: Unknown event notification 36

...
Comment 10 Buovjaga 2016-01-25 10:57:38 UTC
attachment 114425 [details] does give me a weird resizing experience - lagging and ui elements travel choppily and it is almost hanging. It did not hang, though.

Ubuntu 15.10 64-bit 
Version: 5.2.0.0.alpha0+
Build ID: 7aeb2e8c42cd7d0850aaf33a8a8b4d88c173047f
CPU Threads: 2; OS Version: Linux 4.2; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF-dbg, Branch:master, Time: 2016-01-07_03:58:16
Locale: en-US (en_US.UTF-8)
Comment 11 Luke Kendall 2016-03-01 09:31:46 UTC
This behaviour is gone for me with LO 5.1.0.3.  Still on Ubuntu (non-Unity desktop: Flashback or whatever it's called, with Metacity) and 16.04 LTS.
Comment 12 Buovjaga 2016-03-02 19:48:20 UTC
No problem here.
The Ubuntu issue I mentioned in a previous comment was something different and general.

Aibara: what is your current status with version 5.1?

Set to NEEDINFO.
Change back to UNCONFIRMED, if the problem persists. Change to RESOLVED WORKSFORME, if the problem went away.

64-bit, KDE Plasma 5
Build ID: 5.1.0.3 Arch Linux build-1
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Comment 13 Timur 2016-03-29 18:21:21 UTC
Since there's no reply from reporter, WFM per latest comments.
Feel free to reopen if tested otherwise with recent LO versions.