Bug 101827 - Contour Editor dialog maxes out a cpu core at 100%
Summary: Contour Editor dialog maxes out a cpu core at 100%
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.2.2 release
Hardware: All All
: medium normal
Assignee: Michael Meeks
URL:
Whiteboard: target:5.3.0, target:5.1.7 target:5.2.4
Keywords: bibisected, bisected, perf, regression
Depends on:
Blocks: Contour-Editor VCL-Scheduler CPU-AT-100%
  Show dependency treegraph
 
Reported: 2016-08-31 17:30 UTC by Yousuf Philips (jay) (retired)
Modified: 2017-10-29 18:54 UTC (History)
4 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 Yousuf Philips (jay) (retired) 2016-08-31 17:30:14 UTC
Steps:
1) Open Writer
2) Insert an image
3) Right-click > Wrap > Edit Contour
4) Notice that 1 cpu core is at 100%

Regression as this doesnt happen in 5.0.

Version: 5.3.0.0.alpha0+
Build ID: 139d3b3e8b157c1f365f888126269f0902acbaa2
CPU Threads: 2; OS Version: Linux 3.19; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-08-26_00:01:39
Locale: en-US (en_US.UTF-8); Calc: group
Comment 1 Aron Budea 2016-08-31 19:41:50 UTC
It seems like a thread is constantly repainting the image (profiling shows GdipCreateSolidFill calls in a thread taking up a significant amount of time).

Confirmed in master build.
Comment 2 raal 2016-09-23 14:28:08 UTC
This seems to have begun at the below commit.
Michael, could you possibly take a look at this one?
Thanks

author    Michael Meeks <michael.meeks@collabora.com>    2015-11-24 16:59:29 (GMT)
committer    Michael Meeks <michael.meeks@collabora.com>    2015-11-24 19:46:02 (GMT)
commit    87199d3829257420429057336283c55be6ae7481 (patch)
tree    40f63144f9b20cebbaa6cb6fd64184e27c7b192f
parent    9b52b8999be86e5c6e5f5901b2640b16f08a2323 (diff)
vcl: re-introduce idle handling.
 564a31a6903a2ae896058e5509236ccdc91062a3 is the first bad commit
commit 564a31a6903a2ae896058e5509236ccdc91062a3
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Tue Nov 24 21:51:11 2015 -0800

    source 87199d3829257420429057336283c55be6ae7481

    git bisect log
# bad: [05d11632892a322664fb52bac90b2598b7fb7544] source 5616d22b57a9a5e57d545e912e029162a230829b
# good: [c1efd324c6ad448ac9edb030dc9738b9e6899e4d] source ab465b90f6c6da5595393a0ba73f33a1e71a2b65
git bisect start 'origin/master' 'oldest'
# good: [97526ab777da7e58ce283c05498262ecdd4d6f7f] source 4ea70f87f7a2b61eda6e5ab1f48debf6fcfadc1f
git bisect good 97526ab777da7e58ce283c05498262ecdd4d6f7f
# good: [86fee7ded76d9c2756ccab6aef160a2d7fab0ab6] source 1b62841b1859ae3443e2bf1ebe99ec3d6afb6cc2
git bisect good 86fee7ded76d9c2756ccab6aef160a2d7fab0ab6
# good: [11864a7db429a57aeea021e0b3f1fb1412282d32] source e5b721a14c1c8e5261a70588b30353cbb5bd55c6
git bisect good 11864a7db429a57aeea021e0b3f1fb1412282d32
# good: [7d52a87c0aa24498584ec522705cfae3a3a5a038] source 479df22d0b4b0e0393fcf621e7380b38415bcef8
git bisect good 7d52a87c0aa24498584ec522705cfae3a3a5a038
# bad: [bea538a879f50238f4c9c6f05e3d7390db9d76c7] source 7289a140fc68dc898ba2b2357cc960968195f236
git bisect bad bea538a879f50238f4c9c6f05e3d7390db9d76c7
# good: [ad146f48b7f50d159d5b96f1c118cdb8412a98b8] source 91cbbb7797f048834b51690e9fab60aa778b1e44
git bisect good ad146f48b7f50d159d5b96f1c118cdb8412a98b8
# good: [773530329ceb1603b45cab2fadb112d5f2edbc9e] source 6525d1663f8d03e2c28e626fadc2e3e848798224
git bisect good 773530329ceb1603b45cab2fadb112d5f2edbc9e
# good: [121c8d35cf9a9ef1c1312f5e75b8d060ec842ea1] source f42d03f3e9393db693ed753837ce25e1f43297df
git bisect good 121c8d35cf9a9ef1c1312f5e75b8d060ec842ea1
# good: [de062e1c9e15e295d26a8bfe0de29395f9257cbc] source 7c654ee9d51a752e02c0a972de27d699ab5b649a
git bisect good de062e1c9e15e295d26a8bfe0de29395f9257cbc
# good: [98474941bf5d0775ec51591c8761b93974dd62f6] source 9015e72459b5112b0ebddf61c42cae7e8c35f734
git bisect good 98474941bf5d0775ec51591c8761b93974dd62f6
# good: [a6d2f799c50c1b476f3f5e5761350609c04dd3ad] source 9b52b8999be86e5c6e5f5901b2640b16f08a2323
git bisect good a6d2f799c50c1b476f3f5e5761350609c04dd3ad
# bad: [43c1e1712fb204a3e37288604237436f9d328cc0] source 22ebafe8897239696f46df6f093054d16285004a
git bisect bad 43c1e1712fb204a3e37288604237436f9d328cc0
# bad: [564a31a6903a2ae896058e5509236ccdc91062a3] source 87199d3829257420429057336283c55be6ae7481
git bisect bad 564a31a6903a2ae896058e5509236ccdc91062a3
# first bad commit: [564a31a6903a2ae896058e5509236ccdc91062a3] source 87199d3829257420429057336283c55be6ae7481
Comment 3 Michael Meeks 2016-09-23 20:13:58 UTC
Hokay - so this is a pre-existing bug in:

svx/source/dialog/graphctl.cxx:

IMPL_LINK_TYPED( GraphCtrl, UpdateHdl, Idle*, pTimer, void )
{
    aUpdateLink.Call( this );

    pTimer->Start();
}

We switched from some frequent timeout calling this 'Update' link on the graphics control all the time - to an idle handler doing it - which even at low priority consumes a great chunk of CPU time - we do nothing else ;-)

Quite why we need such a nonsense is not entirely clear to me (yet) - but this is the cause.
Comment 4 Xisco Faulí 2016-09-26 15:29:10 UTC
Adding Cc: to Michael Meeks
Comment 5 Michael Meeks 2016-09-27 16:12:33 UTC
Working on this - to try to avoid restoring the busy/timeout which was hardly better ...
Comment 6 Michael Meeks 2016-09-29 16:12:28 UTC
Not really a huge problem burning the CPU there I think, but fixed up in master - lets see how that shakes down there before back-porting to 5.2 or somesuch.
Comment 7 Commit Notification 2016-09-29 16:16:14 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1498c4f631e9c90b11dbdb18e8b094b90e143466

tdf#101827 - mend busy contour dialog.

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Yousuf Philips (jay) (retired) 2016-10-09 07:26:42 UTC
Seems to work fine from my testing, so please backport. Thanks.
Comment 9 Commit Notification 2016-10-18 10:50:02 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=47ba511bf4fcad8502d3501bc16b07621e2ae6d8&h=libreoffice-5-1

tdf#101827 - mend busy contour dialog.

It will be available in 5.1.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Yousuf Philips (jay) (retired) 2016-10-18 10:57:43 UTC
Thanks for backporting.
Comment 11 Commit Notification 2016-10-18 13:24:09 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0ba034f26883c0fd417d99ad410448bce44e33a6&h=libreoffice-5-2

tdf#101827 - mend busy contour dialog.

It will be available in 5.2.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.