Bug 107772 - High CPU load when keeping save or save as dialogue opening (KDE)
Summary: High CPU load when keeping save or save as dialogue opening (KDE)
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.3.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: perf
Depends on:
Blocks:
 
Reported: 2017-05-11 13:38 UTC by H Zeng
Modified: 2018-02-02 19:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H Zeng 2017-05-11 13:38:41 UTC
In Writer or Calc, when saving a document but keeping the save dialogue opening for a while (usually for looking for a directory), the process "soffice.bin" consumes all the CPU resource a process can have (25% for a 4 threads CPU).

This happens in spite of the document size.

My system information is as follows:

openSUSE Tumbleweed: 20170502
KDE Plasma: 5.9.5
Qt: 5.7.1
KDE Frameworks: 5.33.0
Kernel: 4.10.13-1-default
Comment 1 H Zeng 2017-05-11 13:40:13 UTC
Sorry that I forgot to mention that the CPU load is back to normal then the file is actually saved.
Comment 2 Buovjaga 2017-05-13 19:12:34 UTC
Yep, I see it. I had to wait for a while. I think I remember hitting this earlier.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha1+
Build ID: c0968aa4673a8ac9a8a09a0e291b58b94bdbb35e
CPU threads: 8; OS: Linux 4.10; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on May 13th 2016
Comment 3 H Zeng 2017-07-27 15:04:25 UTC
I happen to read a post today saying that this bug is only with KDE Dialogs. The post [1] suggested using the default dialog box in Tools > Options > General, tick "Use LibreOffice Dialogs"(as of LO version 5.4.0.1). After this, keeping the dialog open will not cause a high CPU usage then.

This is a good workaround before this bug is fixed.

[1] https://forums.opensuse.org/showthread.php/525008-soffice-bin-(LibreOffice)-is-pegging-a-cpu-to-100?p=2824436#post2824436
Comment 4 Buovjaga 2017-08-02 17:48:56 UTC
I can still trigger this with 5.4.0 stable, but not with a master build. With 5.4 it seemed to be aggravated when I switched to some other application. Then when I checked my terminal with htop, it showed one core on full load.

H Zeng: if you like, you could experiment with a recent master build: http://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64%4070-TDF/current/
https://wiki.documentfoundation.org/Installing_in_parallel/Linux

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.3
Build ID: 5.4.0-1
CPU threads: 8; OS: Linux 4.12; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group

Arch Linux 64-bit, KDE Plasma 5
Version: 6.0.0.0.alpha0+
Build ID: b66cfdbc1aa43fb42cf881bcc702798e95a50a9c
CPU threads: 8; OS: Linux 4.11; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on July 23rd 2017
Comment 5 H Zeng 2017-08-05 20:13:45 UTC
(In reply to Buovjaga from comment #4)
> 
> H Zeng: if you like, you could experiment with a recent master build:
> http://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64%4070-TDF/
> current/
> https://wiki.documentfoundation.org/Installing_in_parallel/Linux
> 
> Arch Linux 64-bit, KDE Plasma 5
> Version: 5.4.0.3
> Build ID: 5.4.0-1
> CPU threads: 8; OS: Linux 4.12; UI render: default; VCL: kde4; 
> Locale: fi-FI (fi_FI.UTF-8); Calc: group
> 
> Arch Linux 64-bit, KDE Plasma 5
> Version: 6.0.0.0.alpha0+
> Build ID: b66cfdbc1aa43fb42cf881bcc702798e95a50a9c
> CPU threads: 8; OS: Linux 4.11; UI render: default; VCL: kde4; 
> Locale: fi-FI (fi_FI.UTF-8); Calc: group
> Built on July 23rd 2017

I went to the first link but got a 404 response. Then I went to http://dev-builds.libreoffice.org/daily/master/ and clicked into the subfolders leading to a 404 again.

Furthermore, I am not sure I could do the parallel installation and test it correctly even if I could get the installer tarball although the second link gives a comprehensive instruction. I am sorry for my ignorance on the Linux thing.
Comment 6 Buovjaga 2017-08-06 10:25:01 UTC
Ok, the problem is that the files were cleaned because they were too old. They still existed when I commented on 2 Aug. It is an unfortunate situation that we do not have any Linux daily builds :(
Comment 7 H Zeng 2017-08-06 11:26:30 UTC
Sorry for my late response.

Is there any newer build I can test with then? I am using openSUSE with KDE.
Comment 8 Buovjaga 2017-08-06 11:55:22 UTC
(In reply to H Zeng from comment #7)
> Is there any newer build I can test with then? I am using openSUSE with KDE.

No, that's what I meant. We just have to wait until the Tinderbox keepers fix them. A lot of people are on holidays now..
Comment 9 H Zeng 2017-08-06 12:04:18 UTC
Ok, I will wait. At least we have a workaround to avoid problems.
Comment 10 Buovjaga 2017-08-06 16:48:28 UTC
(In reply to H Zeng from comment #9)
> Ok, I will wait. At least we have a workaround to avoid problems.

Ah, I missed that there is the build, which actually has updating feature built in: http://dev-builds.libreoffice.org/daily/master/Linux-archive-x86_64@80-updater/current/

https://mmohrhard.wordpress.com/2017/06/21/announcing-automatically-updating-libreoffice-builds/
Comment 11 H Zeng 2017-08-06 19:08:47 UTC
(In reply to Buovjaga from comment #10)
> Ah, I missed that there is the build, which actually has updating feature
> built in:
> http://dev-builds.libreoffice.org/daily/master/Linux-archive-x86_64@80-
> updater/current/
> 
> https://mmohrhard.wordpress.com/2017/06/21/announcing-automatically-updating-
> libreoffice-builds/

I noticed this updater build and downloaded it. The content inside the extracted folder, however, seems totally different than the instruction says here <https://wiki.documentfoundation.org/Installing_in_parallel/Linux#Step_3:_Tweaking_the_Install_Destination> (the link you gave me in https://bugs.documentfoundation.org/show_bug.cgi?id=107772#c4). Then, I don't know how to deal with it.
Comment 12 Buovjaga 2017-08-06 19:15:58 UTC
You should be able to just run the soffice executable inside the program/ directory after you have extracted the archive.
Comment 13 H Zeng 2017-08-06 19:34:25 UTC
(In reply to Buovjaga from comment #12)
> You should be able to just run the soffice executable inside the program/
> directory after you have extracted the archive.

I got an error of this,
```
cnzhx@a:/data/test/install/program> ./soffice
bash: ./soffice: Permission denied
```

Here is what I've done:
1. Download the tarball and extract all the content to `/data/test/install`;
2. Edit `/data/test/install/program/bootstraprc` to change the `UserInstallation=$ORIGIN/..` to 'UserInstallation=/data/test/..`;
3. Open a terminal in `/data/test/install/program/` and execute following command,
```./soffice```
4. Then here is the error.

What I have done wrong? I don't what to overwrite my current install of LibreOffice.
Comment 14 Buovjaga 2017-08-06 19:58:50 UTC
Are the files and folders owned by your user?

If they are not, do a recursive chown command to make then owned by you:

chown -R cnzhx /data/test/install
Comment 15 H Zeng 2017-08-06 20:26:26 UTC
(In reply to Buovjaga from comment #14)
> Are the files and folders owned by your user?
> 
> If they are not, do a recursive chown command to make then owned by you:
> 
> chown -R cnzhx /data/test/install

I think they are. Here is some of them (note I had changed soffice to 777 after the last failure),
```
cnzhx@a:/data/test/install/program> ls -al s*
-rwx------ 1 cnzhx users    63 Aug  5 00:05 sbase
-rwx------ 1 cnzhx users    63 Aug  5 00:05 scalc
-rwx------ 1 cnzhx users    63 Aug  5 00:05 sdraw
-rwx------ 1 cnzhx users 13188 Aug  5 00:05 senddoc
-rw------- 1 cnzhx users  8690 Aug  5 00:06 services.rdb
-rw------- 1 cnzhx users    61 Aug  5 00:06 setuprc
-rwx------ 1 cnzhx users    66 Aug  5 00:05 simpress
-rwx------ 1 cnzhx users    63 Aug  5 00:05 smath
-rwxrwxrwx 1 cnzhx users  6051 Aug  5 00:05 soffice
-rwx------ 1 cnzhx users  8840 Aug  5 00:05 soffice.bin
-rw------- 1 cnzhx users   453 Aug  5 00:06 sofficerc
-rwx------ 1 cnzhx users    65 Aug  5 00:05 swriter
```

Maybe it's better for me to wait for the LO 6.0 official release to confirm the status of this problem. What do you think?
Comment 16 Buovjaga 2017-08-07 08:16:30 UTC
(In reply to H Zeng from comment #13)
> 2. Edit `/data/test/install/program/bootstraprc` to change the
> `UserInstallation=$ORIGIN/..` to 'UserInstallation=/data/test/..`;

Does your user have write permission to the data directory? This config change you made is trying to create the user profile in "data".
Comment 17 H Zeng 2017-08-07 08:45:12 UTC
(In reply to Buovjaga from comment #16)
> (In reply to H Zeng from comment #13)
> > 2. Edit `/data/test/install/program/bootstraprc` to change the
> > `UserInstallation=$ORIGIN/..` to 'UserInstallation=/data/test/..`;
> 
> Does your user have write permission to the data directory? This config
> change you made is trying to create the user profile in "data".

No, I don't have write access to `/data` but only subdirectories. Now, I change the 'UserInstallation=/data/test/..` to 'UserInstallation=/data/test/install/..` so that the profile is created in `/data/test/`:
```
cnzhx@a:/data/test/install> ls -al
total 3472
drwx------  7 cnzhx users    4096 Aug  5 00:05 .
drwx------  3 cnzhx users    4096 Aug  6 20:27 ..
```

But the `./soffice` still throws the same error of permission,
```
cnzhx@a:/data/test/install> cd program
cnzhx@a:/data/test/install/program> cat bootstraprc 
[Bootstrap]
InstallMode=<installmode>
ProductKey=LibreOfficeDev 6.0
UserInstallation=/data/test/install/..
cnzhx@a:/data/test/install/program> ./soffice
bash: ./soffice: Permission denied
```

And I have already made sure no other instance related to old LO running in the system.
Comment 18 H Zeng 2018-02-02 15:29:37 UTC
I just want to report back that this problem is gone for me. I am using LO 6.0.0.2.0+ on openSUSE Tumbleweed. In this distribution, the LO is built with "UI render: default; VCL: kde4;" at the moment.

I also noticed that the option of "Use LibreOffice Dialogs" in Tools > Options > General is gone at current build.
Comment 19 Buovjaga 2018-02-02 19:16:14 UTC
Great, let's close.