Bug 127344 - Idle LibreOffice consumes 100% CPU on i386
Summary: Idle LibreOffice consumes 100% CPU on i386
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.2.6.2 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: wantBacktrace
Depends on:
Blocks: Performance CPU-AT-100%
  Show dependency treegraph
 
Reported: 2019-09-04 17:26 UTC by Albrecht Dreß
Modified: 2024-04-25 06:39 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
test LibreOffice 6.4.3 from Debian Buster backports on i386 (16.64 KB, application/octet-stream)
2020-05-10 16:23 UTC, Albrecht Dreß
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albrecht Dreß 2019-09-04 17:26:14 UTC
Package: LibreOffice_6.2.6_Linux_x86_deb.tar.gz
OS: Debian Buster/i386
Hardware: MacBookPro5,5; Virtualbox 6.0.10 VM

Hi all,

after some time, LibreOffice starts to consume 100% of one CPU, although it is completely idle.

To reproduce:
- launch LibreOffice writer
- wait for some time without touching Libreoffice

After a few minutes (typically less than ~15?), soffice.bin starts to consume 100% cpu.  Entering a few characters in writer /briefly/ reduces the cpu load to almost 0, but after a short time (typically seconds), it again goes up to 100 %.

The effect is reproducible on an old 2009 MacBookPro5,5 (which is particularly bad as it triggers a high fan speed and quickly drains the battery!) and in a Virtualbox VM, both running Debian Buster/i386.  The LibreOffice packages coming with Debian Buster (libreoffice_6.1.5-3_i386.deb) show the same effect.

I didn't notice this effect on my 64-bit Buster boxes, running the exactly the same LibreOffice versions, so it /might/ be specific for i386.

On the VM, the soffice.bin thread consumes the 100% cpu, as reported by top:

<snip>
 3575 albrecht  20   0  268344 140700  83740 R  99,9   7,0   1:03.72 soffice.bin                                                                  
 3580 albrecht  20   0  268344 140700  83740 S   0,0   7,0   0:00.00 PipeIPC                                                                      
 3581 albrecht  20   0  268344 140700  83740 S   0,0   7,0   0:00.00 ICEConnectionWo                                                              
 3582 albrecht  20   0  268344 140700  83740 S   0,0   7,0   0:00.00 SelectionManage                                                              
 3592 albrecht  20   0  268344 140700  83740 S   0,0   7,0   0:00.00 GrammarChecking                                                              
 3595 albrecht  20   0  268344 140700  83740 S   0,0   7,0   0:00.02 UpdateCheckThre                                                              
</snip>

In gdb, I interrupted the process, and got the following information:

<snip>
Thread 1 "soffice.bin" received signal SIGINT, Interrupt.
0xb7fa7d71 in __kernel_vsyscall ()
(gdb) where
#0  0xb7fa7d71 in __kernel_vsyscall ()
#1  0xb7fa7d34 in __vdso_gettimeofday ()
#2  0xb6be1cb2 in tools::Time::GetMonotonicTicks() () from /opt/libreoffice6.2/program/libmergedlo.so
#3  0xb6be1ce9 in tools::Time::GetSystemTicks() () from /opt/libreoffice6.2/program/libmergedlo.so
#4  0xb6f850ba in Scheduler::ProcessTaskScheduling() () from /opt/libreoffice6.2/program/libmergedlo.so
#5  0xb6f8546d in Scheduler::CallbackTaskScheduling() () from /opt/libreoffice6.2/program/libmergedlo.so
#6  0xb071b4ec in ?? () from /opt/libreoffice6.2/program/libvclplug_gtklo.so
#7  0xb427be65 in g_main_dispatch (context=0x9c7a120) at ../../../glib/gmain.c:3182
#8  g_main_context_dispatch (context=0x9c7a120) at ../../../glib/gmain.c:3847
#9  0xb427c269 in g_main_context_iterate (context=context@entry=0x9c7a120, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ../../../glib/gmain.c:3920
#10 0xb427c314 in g_main_context_iteration (context=0x9c7a120, may_block=1) at ../../../glib/gmain.c:3981
#11 0xb071ab19 in ?? () from /opt/libreoffice6.2/program/libvclplug_gtklo.so
#12 0xb071bff0 in ?? () from /opt/libreoffice6.2/program/libvclplug_gtklo.so
#13 0xb6f90829 in ?? () from /opt/libreoffice6.2/program/libmergedlo.so
#14 0xb6f91b7f in Application::Execute() () from /opt/libreoffice6.2/program/libmergedlo.so
#15 0xb64912ae in ?? () from /opt/libreoffice6.2/program/libmergedlo.so
#16 0xb6f9717e in ImplSVMain() () from /opt/libreoffice6.2/program/libmergedlo.so
#17 0xb6f97285 in SVMain() () from /opt/libreoffice6.2/program/libmergedlo.so
#18 0xb64a409b in soffice_main () from /opt/libreoffice6.2/program/libmergedlo.so
#19 0x080485ac in ?? ()
#20 0xb519cb41 in __libc_start_main (main=0x8048580, argc=3, argv=0xbfdddf04, init=0x80486b0, fini=0x80486a0, rtld_fini=0xb7fb9520 <_dl_fini>, 
    stack_end=0xbfdddefc) at ../csu/libc-start.c:308
#21 0x080485e5 in ?? ()
(gdb) info threads
  Id   Target Id                                      Frame 
* 1    Thread 0xb0bf38c0 (LWP 3575) "soffice.bin"     0xb7fa7d71 in __kernel_vsyscall ()
  2    Thread 0xaf2ffb40 (LWP 3580) "PipeIPC"         0xb7fa7d71 in __kernel_vsyscall ()
  3    Thread 0xae362b40 (LWP 3581) "ICEConnectionWo" 0xb7fa7d71 in __kernel_vsyscall ()
  4    Thread 0xad9ffb40 (LWP 3582) "SelectionManage" 0xb7fa7d71 in __kernel_vsyscall ()
  5    Thread 0xafcd5b40 (LWP 3592) "GrammarChecking" 0xb7fa7d71 in __kernel_vsyscall ()
  6    Thread 0xab5e8b40 (LWP 3595) "UpdateCheckThre" 0xb7fa7d71 in __kernel_vsyscall ()
</snip>

Please let me know if you need more information – it's actually pretty easy to reproduce the bug.

Any help for resolving this issue is highly appreciated!
Comment 1 Xisco Faulí 2019-09-24 11:51:13 UTC
Thank you for reporting the bug. To be certain the reported issue is not
related to corruption in the user profile, could you please reset your
Libreoffice profile ( https://wiki.documentfoundation.org/UserProfile ) and
re-test?

I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the issue is still present
Comment 2 Albrecht Dreß 2019-09-24 20:43:40 UTC
Thanks a lot for your feedback!

The short answer: the bug is still present in safe mode.

Long answer:
* installed Debian Buster/32 Bit from scratch on a newly created VirtualBox 6.0.12 VM
* installed all Debian updates, and the VBox guest additions
* removed all libreoffice deb's installed during the Buster install
* downloaded the packages LibreOffice_6.2.7_Linux_x86_deb.tar.gz and LibreOffice_6.2.7_Linux_x86_deb_langpack_de.tar.gz (just to be sure, if i18n/l10n makes any difference), and installed all deb's from both
* launched libreoffice6.2 from a terminal
* selected from the menu (German Locale) “Hilfe -> Im abgesicherten Modus neu starten…” and from the dialogue “Im abgesicherten Modus fortfahren” (= “safe mode”)
* opened a new Writer document; window title says “[…] abgesicherter Modus”
* leave Writer idle for ~35 minutes: soffice.bin goes to 100% CPU in top

Note 1: compared to the earlier tests in normal mode, it took longer for the issue to pop up in safe mode.  As this is just a single test, I don't know if this is of any significance, though.

Note 2: on the MacBookPro5,5 (which is my wife's “production” machine, so I could not run the safe mode test there yet), the effect occurred on a freshly installed system, i.e. with a default profile.
Comment 3 Miguel 2019-11-25 16:40:36 UTC
I have the same problem, with a similar configuration.

LibreOffice: 6.1.5.2
Build ID: 1:6.1.5-3+deb10u5
Threads CPU : 2; OS : Linux 4.19; UI Render : default; VCL: gtk3; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group threaded

OS: Debian 10 (Buster), i686, LxQt version

I had reported the problem one year ago, when using Xubuntu (XFCE, gtk2):
https://bugs.documentfoundation.org/show_bug.cgi?id=121356

At that time, the problem was classified as "resolved, won't fix" because it seemed associated with gtk2, deprecated, so I am quite surprised to find that it happens also with gtk3, with the same strange behavior (when left idle with no document open, CPU goes to 100% only after some time; it temporarily goes to 0% when passing the mouse over a recent file miniature in the start window).

So I retried the previous solution, launching:
SAL_USE_VCLPLUGIN=gen libreoffice
   ("VCL: x11")

And I found this method as effective as before.
Comment 4 Albrecht Dreß 2019-11-25 20:01:38 UTC
I wasn't aware of the SAL_USE_VCLPLUGIN environment variable, and re-checked with the latest 32-bit Debian Buster backport version of Libreoffice, running on Virtualbox 6.0.14:

Version: 6.3.3.2.0+
Build-ID: 1:6.3.3-2~bpo10+1
CPU-Threads: 2; BS: Linux 4.19; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Calc: threaded

Both the gtk2 and the gtk3 version show the 100% CPU load of the idle Writer after a few minutes.  So the bug is still there!

I can also confirm that, as Miguel noted, the "gen" version (x11) seems to run without the bug.  However, as it looks –compared to the gtk versions, somewhat ugly, I don't think it's a real solution.
Comment 5 Bryan 2020-01-16 16:12:28 UTC
I have the same problem running LO 6.0.7.3 on an HP Probook 32 bit machine running Ubuntu Mate 18.04.3 LTS.  With LibreOffice running minimized with no documents open, one CPU core will go to 100% every short while and remain at 100% for several minutes before dropping back to a much lower level.  When that happens System Monitor reports soffice.bin to be at 50% CPU.
Comment 6 Xisco Faulí 2020-02-17 14:51:21 UTC
(In reply to Bryan from comment #5)
> I have the same problem running LO 6.0.7.3 on an HP Probook 32 bit machine
> running Ubuntu Mate 18.04.3 LTS.  With LibreOffice running minimized with no
> documents open, one CPU core will go to 100% every short while and remain at
> 100% for several minutes before dropping back to a much lower level.  When
> that happens System Monitor reports soffice.bin to be at 50% CPU.

Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 7 Miguel 2020-02-17 16:11:19 UTC
It is not possible answer you, because the latest version is 6.4.0 but Linux i386 is supported only up to 6.2.x and this bug is specifically for Linux i386.

The bug is still there in 6.2.8 (last version for i386) and the "solution" of using "SAL_USE_VCLPLUGIN=gen libreoffice" is still effective (but ugly).
Comment 8 Albrecht Dreß 2020-02-17 21:36:51 UTC
As there is no “official” build for Buster/32 Bit, I installed the latest version from backports in a Debian Buster VM running on Virtualbox 6.0.16:

Version: 6.4.1.1
Build-ID: 1:6.4.1~rc1-2~bpo10+1
CPU-Threads: 2; BS: Linux 4.19; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Calc: threaded

Unfortunately, the bug is *still* there, i.e. the completely idle Writer starts to consume 100% of one CPU after ~15 Minutes.

Before starting Libreoffice, I completely erased $HOME/.config/libreoffice folder as to simulate a completely fresh install.
Comment 9 Buovjaga 2020-05-09 15:11:02 UTC
NEW per multiple confirmations. If you could install debug packages for Debian / Ubuntu, you could get a perf trace:
https://wiki.documentfoundation.org/QA/BugReport/Debug_Information#GNU.2FLinux
https://wiki.documentfoundation.org/Development/How_to_debug#Performance_debugging_.28perf.29
Comment 10 Miguel 2020-05-09 21:23:10 UTC
I tried on libreoffice-6.2.8.2 (last version available on i386).
I did not find how to install debug symbols, if needed.

I ran with "perf" for 10 seconds, with LibreOffice idle for 1 hour with no document open, the resulting perf.data is 3.9 MB, do you need it?

Using "perf report", the first lines are:

Samples: 38K of event 'cycles', Event count (approx.): 16381262792                                    
  Children      Self  Command      Shared Object                Symbol                                
+   41,71%     0,00%  soffice.bin  [unknown]                    [k] 00000000                         ◆
+   34,83%     3,87%  soffice.bin  [kernel.kallsyms]            [k] entry_SYSENTER_32                ▒
+   33,43%     1,89%  soffice.bin  [vdso]                       [.] __kernel_vsyscall                ▒
+   29,76%     1,94%  soffice.bin  [kernel.kallsyms]            [k] do_fast_syscall_32               ▒
+   24,65%     0,77%  soffice.bin  libglib-2.0.so.0.5800.3      [.] g_main_context_dispatch          ▒
+   15,87%     0,00%  soffice.bin  libvclplug_gtklo.so          [.] 0xb06a34ec                       ▒
+   15,77%     0,02%  soffice.bin  libmergedlo.so               [.] Scheduler::CallbackTaskScheduling▒
+   15,71%     0,40%  soffice.bin  libglib-2.0.so.0.5800.3      [.] g_get_current_time               ▒
+   15,59%     0,26%  soffice.bin  libmergedlo.so               [.] Scheduler::ProcessTaskScheduling ▒
+   15,41%     0,60%  soffice.bin  [kernel.kallsyms]            [k] __se_sys_gettimeofday            ▒
+   14,43%     0,94%  soffice.bin  [kernel.kallsyms]            [k] ktime_get_real_ts64              ▒
+   14,11%     0,00%  soffice.bin  libglib-2.0.so.0.5800.3      [.] g_idle_remove_by_data            ▒
+   14,11%     0,00%  soffice.bin  [unknown]                    [.] 0xb42f2180                       ▒
+   13,91%    13,88%  soffice.bin  [kernel.kallsyms]            [k] read_hpet                        ▒
+   10,57%     0,00%  soffice.bin  [unknown]                    [k] 0x08c39f50                       ▒
+    9,25%     0,00%  soffice.bin  libmergedlo.so               [.] 0xb6f1d66f                       ▒
+    7,54%     0,46%  soffice.bin  [kernel.kallsyms]            [k] __se_sys_socketcall              ▒
+    6,54%     1,05%  soffice.bin  libglib-2.0.so.0.5800.3      [.] g_main_context_prepare           ▒
+    6,33%     0,12%  soffice.bin  [kernel.kallsyms]            [k] __sys_recvmsg                    ▒
+    6,29%     0,00%  soffice.bin  libc-2.28.so                 [.] __libc_start_main                ▒
+    6,29%     0,00%  soffice.bin  soffice.bin                  [.] 0x080485ac                       ▒
+    6,29%     0,00%  soffice.bin  libmergedlo.so               [.] soffice_main                     ▒
+    6,29%     0,00%  soffice.bin  libmergedlo.so               [.] SVMain                           ▒
+    6,29%     0,00%  soffice.bin  libmergedlo.so               [.] ImplSVMain                       ▒
+    6,29%     0,00%  soffice.bin  libmergedlo.so               [.] 0xb6428c26                       ▒
+    6,25%     0,18%  soffice.bin  libmergedlo.so               [.] Application::Execute             ▒
+    5,74%     0,00%  soffice.bin  libmergedlo.so               [.] 0xb6f287f3                       ▒
+    5,55%     0,00%  soffice.bin  libvclplug_gtklo.so          [.] 0xb06a34c7                       ▒
+    5,53%     0,00%  soffice.bin  libvclplug_gtklo.so          [.] 0xb06a1bd3                       ▒
+    5,25%     0,00%  soffice.bin  libvclplug_gtklo.so          [.] 0xb06a3ff0                       ▒
+    5,20%     0,22%  soffice.bin  [kernel.kallsyms]            [k] ___sys_recvmsg                   ▒
+    5,15%     0,24%  soffice.bin  [kernel.kallsyms]            [k] __se_sys_poll
Comment 11 Albrecht Dreß 2020-05-10 16:23:55 UTC
Created attachment 160609 [details]
test LibreOffice 6.4.3 from Debian Buster backports on i386

I installed the latest packages, including the dbgsyms for core, writer and gtk3, from Debian buster backports on a Virtualbox 32 bit VM, running the latest buster with all updates (see file packages.log in the attached package).

Then I cleared the user config, launched the writer from the XFCE menu, and waited ~10 minutes until the one cpu (out of 2) went to 100%.  Then I opened gdb:

| test@debian32:~$ rm -rf .config/libreoffice/
| [launch LO writer from the XFCE menu]
| [wait until the cpu goes to 100%]
| gdb /usr/lib/libreoffice/program/soffice.bin

Htop reports a bunch of threads related to pid 1244, of which “soffice.bin” comsumes 100% cpu (see top.log).

Running perf on pid 1244 results in the attached perf-report.log.

In gdb, I attached to pid 1244, listed the threads, and a few times interrupted thread “soffice.bin” go get the bt (gdb.log).

Please let me know if you need more information.
Comment 12 Albrecht Dreß 2020-07-14 15:19:04 UTC
Update: the latest version available from Debian Backports for i386

| Version: 6.4.5.2
| Build-ID: 1:6.4.5-1~bpo10+1
| CPU-Threads: 2; BS: Linux 4.19; UI-Render: Standard; VCL: gtk3; 
| Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
| Calc: threaded

still shows the bug on a 32 bit VirtualBox VM.  I couldn't try it on the real 32 bit hardware (a MacBookPro5,5 which is my wife's working machine) yet, but I strongly presume it will show the same effect.

Please let me know if you need more input.
Comment 13 Albrecht Dreß 2020-08-28 18:30:15 UTC
Updated to the latest version for Debian Buster/i386 in a Virtualbox VM from debian-backports

libreoffice-writer 1:7.0.1~rc1-1~bpo10+1 i386

which identifies itself as

|Version: 7.0.1.1.0+
|Build ID: <buildversion>
|CPU threads: 2; OS: Linux 4.19; UI render: default; VCL: gtk3
|Locale: de-DE (de_DE.UTF-8); UI: de-DE
|Debian package version: 1:7.0.1_rc1-1~bpo10+1
|Calc: threaded

I then completely removed the config and launched the writer

test@debian32:~$ rm -rf .config/libreoffice/
test@debian32:~$ soffice 

Leaving the writer idle, after some time one cpu goes to 100%.  IOW, regrettably this annoying bug *still* exists in Libreoffice 7.
Comment 14 QA Administrators 2022-08-29 06:43:38 UTC Comment hidden (obsolete)
Comment 15 Albrecht Dreß 2022-08-29 19:59:38 UTC
It appears that the bug is actually gone in version

--8<---------------------------------------------------------
Version: 7.3.5.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 2; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Debian package version: 1:7.3.5~rc2-1~bpo11+1
Calc: threaded
--8<---------------------------------------------------------

(as no "official" 32-bit build available, this is the version coming with Debian Bullseye backports).  At least, leaving Writer idle in a 32-bit VM does *not* hog the CPU even after ~3 hours.  I had no time yet to check the status on the old MacBookPro5,5, though.