Bug 114509 - LibreOffice Calc may hang at 100 % CPU usage
Summary: LibreOffice Calc may hang at 100 % CPU usage
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-17 10:23 UTC by Nemo_bis
Modified: 2018-10-09 11:31 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
strace (23.27 KB, text/x-log)
2017-12-17 10:25 UTC, Nemo_bis
Details
strace -ttt (11.35 KB, text/x-log)
2017-12-17 10:26 UTC, Nemo_bis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nemo_bis 2017-12-17 10:23:47 UTC
Description:
I have a rather big spreadsheet which sometimes hangs LibreOffice Calc forever. CPU is maxed out at 100 %, while RAM is stable and GPU doesn't seem to be doing anything (according to radeontop).

I'm collecting some of the information requested in bug 46468 now. The strace has little output but it seems to show that nothing is really happening: most of the lines are like

[pid  9317] futex(0x7efffc7e1040, FUTEX_WAKE_PRIVATE, 1) = 0
[pid  9317] futex(0x7efffc7e12ac, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 7791, {tv_sec=1513504177, tv_nsec=959517000}, 0xffffffff) = -1 ETIMEDOUT (Connection timed out)

Steps to Reproduce:
1. Open a long table (in my case it's a CSV with ~500k lines, about 100 MB in size)
2. Launch some operation, for instance a VLOOKUP over a few hundred thousands lines (applying the formula with a whole column by e.g. ctrl-c ctrl-p as in https://stackoverflow.com/a/31271467/1333493 )

Actual Results:  
After several hours, LibreOffice is still unresponsive (trying to switch to its window will not bring up anything on the screen).

In the worst case, usually after working on the document for a bit, even the smallest operation will hang libreoffice for a few minutes: for instance clicking a cell, or typing one letter, or clicking a menu item. Parts of its GUI may be stuck on the screen even when switching to other programs, until it's done. This variant is usually temporary: by closing the document and opening it again, the spreadsheet is again usable.

Expected Results:
LibreOffice should work hard for a while, probably consuming GPU resources as well, and potentially be unresponsive, but eventually finish the job or crash.


Reproducible: Sometimes


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
$ libreoffice --version
LibreOffice 5.2.7.2 20(Build:2)
$ rpm -qa | grep libreoffice
libreoffice-ure-common-5.2.7.2-12.fc25.noarch
libreoffice-impress-5.2.7.2-12.fc25.x86_64
libreoffice-langpack-en-5.2.7.2-12.fc25.x86_64
libreoffice-5.2.7.2-12.fc25.x86_64
libreoffice-ure-5.2.7.2-12.fc25.x86_64
libreoffice-math-5.2.7.2-12.fc25.x86_64
libreoffice-gtk3-5.2.7.2-12.fc25.x86_64
libreoffice-opensymbol-fonts-5.2.7.2-12.fc25.noarch
libreoffice-x11-5.2.7.2-12.fc25.x86_64
libreoffice-graphicfilter-5.2.7.2-12.fc25.x86_64
libreoffice-emailmerge-5.2.7.2-12.fc25.x86_64
libreoffice-writer-5.2.7.2-12.fc25.x86_64
libreoffice-core-5.2.7.2-12.fc25.x86_64
libreoffice-langpack-it-5.2.7.2-12.fc25.x86_64
libreoffice-gtk2-5.2.7.2-12.fc25.x86_64
libreoffice-pdfimport-5.2.7.2-12.fc25.x86_64
libreoffice-calc-5.2.7.2-12.fc25.x86_64
libreoffice-draw-5.2.7.2-12.fc25.x86_64
libreoffice-base-5.2.7.2-12.fc25.x86_64
libreoffice-pyuno-5.2.7.2-12.fc25.x86_64
libreoffice-data-5.2.7.2-12.fc25.noarch
libreoffice-wiki-publisher-5.2.7.2-12.fc25.x86_64
$ uname -a
Linux a88x 4.13.11-100.fc25.x86_64 #1 SMP Thu Nov 2 19:58:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ lshw
[...]
     *-memory
          description: System memory
          physical id: 0
          size: 14GiB
     *-cpu
          product: AMD A8-7600 Radeon R7, 10 Compute Cores 4C+6G
          vendor: Advanced Micro Devices [AMD]
[...]
        *-display
             description: VGA compatible controller
             product: Kaveri [Radeon R7 Graphics]
             vendor: Advanced Micro Devices, Inc. [AMD/ATI]
             physical id: 1
             bus info: pci@0000:00:01.0
             version: 00
             width: 64 bits
             clock: 33MHz
             capabilities: vga_controller bus_master cap_list rom
             configuration: driver=radeon latency=0
             resources: irq:44 memory:c0000000-cfffffff memory:d0000000-d07fffff ioport:f000(size=256) memory:feb00000-feb3ffff memory:c0000-dffff


User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0
Comment 1 Nemo_bis 2017-12-17 10:25:25 UTC
P.s.: I had to select the 6.0 version and then change it back, otherwise bug posting would fail with a red warning that I had not selected a version.
Comment 2 Nemo_bis 2017-12-17 10:25:47 UTC
Created attachment 138483 [details]
strace
Comment 3 Nemo_bis 2017-12-17 10:26:04 UTC
Created attachment 138484 [details]
strace -ttt
Comment 4 Nemo_bis 2017-12-17 10:34:45 UTC
gdb not very helpful, will try after a restart:

$ sudo gdb -p 9316
GNU gdb (GDB) Fedora 7.12.1-48.fc25
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 9316
[New LWP 9317]
[New LWP 9327]
[New LWP 9328]
[New LWP 9329]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007effd59b315b in com::sun::star::i18n::Transliteration_body::transliterate (this=0x7eff9d9a11b0, inStr=..., startPos=0, nCount=30, offset=...)
    at /usr/src/debug/libreoffice-5.2.7.2/i18npool/source/transliteration/transliteration_body.cxx:135
135                     out[j++] = map.map[k];
Comment 5 Nemo_bis 2017-12-17 10:45:18 UTC
The result is identical if I allow to use OpenCL in the settings. After installing all the required packages, gdb only gives:

$ sudo gdb -p 15601
GNU gdb (GDB) Fedora 7.12.1-48.fc25
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 15601
[New LWP 15602]
[New LWP 15611]
[New LWP 15612]
[New LWP 15613]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
icu_57::UVector64::reserveBlock (status=@0x55b9c9df903c: U_ZERO_ERROR, size=8, this=0x55b9c67c87c0) at ../common/uvectr64.h:226
226         int64_t  *rp = elements+count;
(gdb)
Comment 6 m_a_riosv 2017-12-17 13:07:54 UTC
VLOOKUP it's not the quicker function.

Using it without regular expressions or wild cards and with Menu/Tools/Options/LibreOffice calc/calculate - Search criteria = and <> must apply to the whole cells -> enale, it's quicker.
Comment 7 Nemo_bis 2017-12-17 20:10:21 UTC
I cannot reproduce the bug with LibreOfficeDev_6.0.0.0.beta2_Linux_x86-64_rpm: the VLOOKUP takes 200 % CPU (yay multithreading) and is completed in few seconds.

(In reply to m.a.riosv from comment #6)
> Using it without regular expressions or wild cards and with
> Menu/Tools/Options/LibreOffice calc/calculate - Search criteria = and <>
> must apply to the whole cells -> enale, it's quicker.

I'll try this too, but we're talking of a difference between seconds (in 6.0) and hours (in 5.2).
Comment 8 Xisco Faulí 2018-01-10 10:18:57 UTC
multithreading is still under development, and will be disable by default in 6.0. altough you will be able to enable it from the advanced options.
Did you try what m.a.riosv commented?
Comment 9 Nemo_bis 2018-01-10 14:06:13 UTC
Sorry, I forgot doing the "whole cells" VLOOKUP because the LibreOffice 6 solution is thousands times faster. I'll see if I manage to test again (maybe in a moment when I can afford walking away from the computer for a few hours).
Comment 10 Xisco Faulí 2018-01-24 10:02:58 UTC
(In reply to Nemo_bis from comment #9)
> Sorry, I forgot doing the "whole cells" VLOOKUP because the LibreOffice 6
> solution is thousands times faster. I'll see if I manage to test again
> (maybe in a moment when I can afford walking away from the computer for a
> few hours).

Any update ?
Comment 11 Kevin Suo 2018-03-05 23:30:54 UTC
As said, this bug may be caused by Calc Threaded Calculation. Multithreading is still under development, and is already disable by default in 6.0 releases.

To observe this, goto the about libreoffice dialog and you will see Calc: Group Threaded. To disabled it, either reset the user profile or goto advanced settings and search for threaded.
Comment 12 QA Administrators 2018-09-03 14:49:52 UTC Comment hidden (obsolete)
Comment 13 QA Administrators 2018-10-09 11:31:34 UTC
Dear Bug Submitter,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-20181009