Description: If a large number of Calc sheets are deleted in a single operation, then soffice continues to use very high CPU (97+%) after the deletes finish. The high CPU usage never stops after that point (I waited for 15-20 minutes). Meanwhile, the GUI responds normally. So something must be in an infinite loop [conjecture: gc bug?] Steps to Reproduce: 1. Open the attached demo.ods spreadsheet. Do NOT enable macros. 2. Click the |< button at the left-bottom to view the first Sheet tab 3. Click the "AAPL" tab (3rd sheet over) Click the >| button to view the last sheet tab Shift-Click "ZUO" (the last sheet). This selects all except the first 2 sheets. 4. Rightclick (in the sheet tab area)->Delete Sheet... and confirm; 5. In another terminal, run "top" Actual Results: After a while the sheets are deleted and the GUI becomes usable again, but "top" shows soffice.bin using 99% CPU forever after (tested for 15-20 minutes). Expected Results: CPU usage should drop to ~zero when the GUI is idle. Reproducible: Always User Profile Reset: Yes Additional Info: There is zero swap space used (I have 16M ram so didn't expect any swapping).
Created attachment 162221 [details] demo.ods - see Steps to Reproduce
Version: 7.1.0.0.alpha0+ Build ID: 573138efec7fa28a98ba3b0301f6e0a97dac7978 CPU threads: 12; OS: Linux 5.4; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-06-18_14:08:32 Calc: threaded
Actually, the CPU gets stuck immediately upon opening the file. There is no need to delete any sheets. Bisected with Linux 7.1 repo to https://git.libreoffice.org/core/commit/4111ed76906bf6be05b704bf52fa91353dfef183 tdf#132137 Rename Default Style in Calc. Adding Cc: to Srijan Bhatia Also observed on Windows.
I can already see that this difference is a problem: https://opengrok.libreoffice.org/xref/core/sc/source/core/data/stlsheet.cxx?r=b225980d#284 if ( rNew == aFileStdName && aFileStdName != ScResId(STR_STYLENAME_STANDARD_CELL) ) return false; else if ( rNew == aFileStdName && aFileStdName != ScResId(STR_STYLENAME_STANDARD_PAGE) ) return false; else return SfxStyleSheet::SetName(rNew, bReindexNow); ======== If 'rNew == aFileStdName' is true, it'll either return false in the first branch, or in the second, and never gets to the third, ie. this kind of branching makes no sense.
Similarly wrong if condition: https://opengrok.libreoffice.org/xref/core/sc/source/core/data/patattr.cxx?r=b225980d#1018 However, fixing them (at least in a way that looks sensible, no idea if the fix is actually correct) doesn't help here. In addition, in Windows with Skia rendering the menus are empty with this file open (but not with just any file, and neither without Skia).
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a5b3211f072d982e1ee136e864f153836c76a5ca tdf#134161: Revert "tdf#132137 Rename Default Style in Calc." It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
commit reverted, the document should no longer hang
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7ccbeade150f450568f44ad6283d4a4dc3b379bf tdf#134161: sc_anchor: Add unittest It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Confirming fixed (CPU is low when idle) in Master. Thanks! Version: 7.1.0.0.alpha1+ Build ID: 03a9a80125cf887d26348486b71d78d80c99344d CPU threads: 12; OS: Linux 5.4; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-11-07_18:04:03 Calc: threaded
Let's set to verified, thanks for confirming.
Patch in libreoffice-7-0 branch has been reverted in https://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-7-0&id=7002053174aed5c3a7b1fe5b1785011080aa6cbe
Xisco Fauli committed a patch related to this issue. It has been pushed to "libreoffice-7-0": https://git.libreoffice.org/core/commit/a509659205601e51887127d7ecec0d4f4c137278 tdf#134161: sc_anchor: Add unittest It will be available in 7.0.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 137202 has been marked as a duplicate of this bug. ***