<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>313655</bug_id>
          
          <creation_ts>2013-01-21 23:01:14 +0000</creation_ts>
          <short_desc>unloading of &quot;Mouse Click Animation&quot; result in kwin crash</short_desc>
          <delta_ts>2013-01-28 07:20:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>effects-various</component>
          <version>git master</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>4.10</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dario Cambié">dariocambie</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          
          
          <cf_commitlink>http://commits.kde.org/kde-workspace/aacfda87c5dd6d1ddc91c57c829d19afdbaba8ef</cf_commitlink>
          <cf_versionfixedin>4.10</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      <flag name="ReviewRequest"
          id="502"
          type_id="14"
          status="+"
          setter="thomas.luebking"
    />

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1334142</commentid>
    <comment_count>0</comment_count>
    <who name="Dario Cambié">dariocambie</who>
    <bug_when>2013-01-21 23:01:14 +0000</bug_when>
    <thetext>Application: kwin (4.10.60)
KDE Platform Version: 4.10.60 (Compiled from sources)
Qt Version: 4.8.3
Operating System: Linux 3.5.0-22-generic x86_64
Distribution: Ubuntu 12.10

-- Information about the crash:
- What I was doing when the application crashed:
Pressed Alt+Shift+F12 with Mouse Click Animation enabled makes kwin crash (without it doesn&apos;t).

Moreover also disabling the same effect from the kcm and press apply produces similar crash.

The crash can be reproduced every time.

-- Backtrace:
Application: KWin (kwin), signal: Aborted
Using host libthread_db library &quot;/lib/x86_64-linux-gnu/libthread_db.so.1&quot;.
[Current thread is 1 (Thread 0x7fe22567e7c0 (LWP 2507))]

Thread 4 (Thread 0x7fe20931b700 (LWP 2512)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:215
#1  0x00007fe21fee3fa7 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fe21fed754f in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007fe21fee3aec in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007fe21fc52e9a in start_thread (arg=0x7fe20931b700) at pthread_create.c:308
#5  0x00007fe224e5acbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fe203fff700 (LWP 2513)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:215
#1  0x00007fe21fee3fa7 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007fe21fed754f in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007fe21fee3aec in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007fe21fc52e9a in start_thread (arg=0x7fe203fff700) at pthread_create.c:308
#5  0x00007fe224e5acbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fe200d01700 (LWP 2520)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fe2214d9cd7 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#2  0x00007fe2214d9d09 in ?? () from /usr/lib/x86_64-linux-gnu/libQtScript.so.4
#3  0x00007fe21fc52e9a in start_thread (arg=0x7fe200d01700) at pthread_create.c:308
#4  0x00007fe224e5acbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fe22567e7c0 (LWP 2507)):
[KCrash Handler]
#6  0x00007fe224d9d425 in __GI_raise (sig=&lt;optimized out&gt;) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007fe224da0b8b in __GI_abort () at abort.c:91
#8  0x00007fe224d960ee in __assert_fail_base (fmt=&lt;optimized out&gt;, assertion=0x7fe225257bc5 &quot;mouse_poll_ref_count&quot;, file=0x7fe225257828 &quot;/home/kde/kdesrc/kde/kde-workspace/kwin/effects.cpp&quot;, line=&lt;optimized out&gt;, function=&lt;optimized out&gt;) at assert.c:94
#9  0x00007fe224d96192 in __GI___assert_fail (assertion=0x7fe225257bc5 &quot;mouse_poll_ref_count&quot;, file=0x7fe225257828 &quot;/home/kde/kdesrc/kde/kde-workspace/kwin/effects.cpp&quot;, line=589, function=0x7fe225259820 &lt;KWin::EffectsHandlerImpl::stopMousePolling()::__PRETTY_FUNCTION__&gt; &quot;virtual void KWin::EffectsHandlerImpl::stopMousePolling()&quot;) at assert.c:103
#10 0x00007fe225205b17 in KWin::EffectsHandlerImpl::stopMousePolling (this=&lt;optimized out&gt;) at /home/kde/kdesrc/kde/kde-workspace/kwin/effects.cpp:589
#11 0x00007fe200e3bfff in KWin::MouseClickEffect::~MouseClickEffect (this=0x128cec0, __in_chrg=&lt;optimized out&gt;) at /home/kde/kdesrc/kde/kde-workspace/kwin/effects/mouseclick/mouseclick.cpp:71
#12 0x00007fe200e3c109 in KWin::MouseClickEffect::~MouseClickEffect (this=0x128cec0, __in_chrg=&lt;optimized out&gt;) at /home/kde/kdesrc/kde/kde-workspace/kwin/effects/mouseclick/mouseclick.cpp:80
#13 0x00007fe225209f46 in KWin::EffectsHandlerImpl::unloadEffect (this=this@entry=0x13f2f20, name=...) at /home/kde/kdesrc/kde/kde-workspace/kwin/effects.cpp:1437
#14 0x00007fe22520a178 in KWin::EffectsHandlerImpl::~EffectsHandlerImpl (this=0x13f2f20, __in_chrg=&lt;optimized out&gt;) at /home/kde/kdesrc/kde/kde-workspace/kwin/effects.cpp:155
#15 0x00007fe22520a249 in KWin::EffectsHandlerImpl::~EffectsHandlerImpl (this=0x13f2f20, __in_chrg=&lt;optimized out&gt;) at /home/kde/kdesrc/kde/kde-workspace/kwin/effects.cpp:159
#16 0x00007fe2251e1c26 in KWin::Compositor::finish (this=0xd377e0) at /home/kde/kdesrc/kde/kde-workspace/kwin/composite.cpp:278
#17 0x00007fe225170f62 in KWin::Workspace::qt_static_metacall (_o=0xd0fc10, _c=&lt;optimized out&gt;, _id=&lt;optimized out&gt;, _a=0x7fff999c2ee0) at /home/kde/kdesrc/build/kde/kde-workspace/kwin/workspace.moc:309
#18 0x00007fe21fff5f5f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#19 0x00007fe21f164a32 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#20 0x00007fe21f164c20 in QAction::activate(QAction::ActionEvent) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#21 0x00007fe224985a21 in trigger (this=0xd7e910) at /usr/include/qt4/QtGui/qaction.h:218
#22 KGlobalAccelPrivate::_k_invokeAction (this=0xd3aa90, componentUnique=..., actionUnique=..., timestamp=29063689) at /home/kde/kdesrc/kde/kdelibs/kdeui/shortcuts/kglobalaccel.cpp:449
#23 0x00007fe21fff5f5f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#24 0x00007fe224a85349 in OrgKdeKglobalaccelComponentInterface::globalShortcutPressed (this=&lt;optimized out&gt;, _t1=..., _t2=..., _t3=29063689) at /home/kde/kdesrc/build/kde/kdelibs/kdeui/kglobalaccel_component_interface.moc:164
#25 0x00007fe224a857b4 in qt_static_metacall (_a=&lt;optimized out&gt;, _id=&lt;optimized out&gt;, _o=&lt;optimized out&gt;, _c=&lt;optimized out&gt;) at /home/kde/kdesrc/build/kde/kdelibs/kdeui/kglobalaccel_component_interface.moc:75
#26 OrgKdeKglobalaccelComponentInterface::qt_static_metacall (_o=0xd3bab0, _c=&lt;optimized out&gt;, _id=&lt;optimized out&gt;, _a=0x7fff999c3440) at /home/kde/kdesrc/build/kde/kdelibs/kdeui/kglobalaccel_component_interface.moc:69
#27 0x00007fe224a85e1f in OrgKdeKglobalaccelComponentInterface::qt_metacall (this=0xd3bab0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff999c3440) at /home/kde/kdesrc/build/kde/kdelibs/kdeui/kglobalaccel_component_interface.moc:130
#28 0x00007fe22035bed3 in ?? () from /usr/lib/x86_64-linux-gnu/libQtDBus.so.4
#29 0x00007fe21fff543e in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#30 0x00007fe21f16ae9c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#31 0x00007fe21f16f30a in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#32 0x00007fe224941396 in KApplication::notify (this=0x7fff999c40c0, receiver=0xd3bab0, event=0xe881b0) at /home/kde/kdesrc/kde/kdelibs/kdeui/kernel/kapplication.cpp:311
#33 0x00007fe21ffe056e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#34 0x00007fe21ffe43f1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#35 0x00007fe21f21089c in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#36 0x00007fe21ffdf2bf in QEventLoop::processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#37 0x00007fe21ffdf548 in QEventLoop::exec(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#38 0x00007fe21ffe4708 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#39 0x00007fe22519a454 in kdemain (argc=3, argv=0x7fff999c4208) at /home/kde/kdesrc/kde/kde-workspace/kwin/main.cpp:537
#40 0x00007fe224d8876d in __libc_start_main (main=0x4006a0 &lt;main(int, char**)&gt;, argc=3, ubp_av=0x7fff999c4208, init=&lt;optimized out&gt;, fini=&lt;optimized out&gt;, rtld_fini=&lt;optimized out&gt;, stack_end=0x7fff999c41f8) at libc-start.c:226
#41 0x00000000004006d1 in _start ()

Possible duplicates by query: bug 311955, bug 309626, bug 308195, bug 303176, bug 301141.

Reported using DrKonqi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334143</commentid>
    <comment_count>1</comment_count>
    <who name="Dario Cambié">dariocambie</who>
    <bug_when>2013-01-21 23:04:06 +0000</bug_when>
    <thetext>FYI: The same doesn&apos;t happen with Track Mouse or Magnifier.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334154</commentid>
    <comment_count>2</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2013-01-21 23:29:03 +0000</bug_when>
    <thetext>if (m_enabled)
   effects-&gt;stopMousePolling();</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334155</commentid>
    <comment_count>3</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2013-01-21 23:32:01 +0000</bug_when>
    <thetext>https://git.reviewboard.kde.org/r/108536/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334156</commentid>
    <comment_count>4</comment_count>
      <attachid>76620</attachid>
    <who name="Dario Cambié">dariocambie</who>
    <bug_when>2013-01-21 23:32:01 +0000</bug_when>
    <thetext>Created attachment 76620
Quick and dirty patch

The problem could be in
effects-&gt;stopMousePolling();
being called whithout a previous
effects-&gt;startMousePolling();
(I wasn&apos;t using the plugin when crash occurred).

Magnifier seems to use a private variable &quot;polling&quot; to address this problem, so I&apos;ve copied some code from there and the issue is now gone here.

[disclaimer: I&apos;m by no means a C++ programmer: the attachment is just a try!]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334158</commentid>
    <comment_count>5</comment_count>
    <who name="Dario Cambié">dariocambie</who>
    <bug_when>2013-01-21 23:33:05 +0000</bug_when>
    <thetext>(Sorry Thomas, I&apos;ve seen only now your post :D)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334161</commentid>
    <comment_count>6</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2013-01-21 23:35:43 +0000</bug_when>
    <thetext>Nevermind - happens to me all the time (hello mid-air-collision =)
The patch should be ok, but the information is already encoded in m_enabled, so there&apos;s no need for another variable (yet actually had considered to propse a Effect::pollMouse(bool) and shortcut that on a flag whether we&apos;re already polling (and on destruction autostop - the current way is pretty error prone. proof: this bug)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334781</commentid>
    <comment_count>7</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2013-01-23 21:11:34 +0000</bug_when>
    <thetext>Git commit 809a7fdb63b8659c31e9ffdac41813b0787076dd by Thomas Lübking.
Committed on 22/01/2013 at 00:29.
Pushed by luebking into branch &apos;KDE/4.10&apos;.

don&apos;t stopMousePolling when not started

REVIEW: 108536

M  +2    -1    kwin/effects/mouseclick/mouseclick.cpp

http://commits.kde.org/kde-workspace/809a7fdb63b8659c31e9ffdac41813b0787076dd</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334786</commentid>
    <comment_count>8</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2013-01-23 21:12:17 +0000</bug_when>
    <thetext>Git commit aacfda87c5dd6d1ddc91c57c829d19afdbaba8ef by Thomas Lübking.
Committed on 22/01/2013 at 00:29.
Pushed by luebking into branch &apos;master&apos;.

don&apos;t stopMousePolling when not started

REVIEW: 108536

M  +2    -1    kwin/effects/mouseclick/mouseclick.cpp

http://commits.kde.org/kde-workspace/aacfda87c5dd6d1ddc91c57c829d19afdbaba8ef</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>76620</attachid>
            <date>2013-01-21 23:32:01 +0000</date>
            <delta_ts>2013-01-21 23:32:01 +0000</delta_ts>
            <desc>Quick and dirty patch</desc>
            <filename>0001-Mouse-Pooling-fix-for-mouseclick.patch</filename>
            <type>text/plain</type>
            <size>1784</size>
            <attacher name="Dario Cambié">dariocambie</attacher>
            
              <data encoding="base64">RnJvbSBkODE5YjNmMmQ1NmQyYzc0MGI1MWJlNzYyZTNjYzgwYjExZTVlYjg2IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/RGFyaW89MjBDYW1iaT1DMz1BOT89IDxkYXJp
b2NhbWJpZUBnbWFpbC5jb20+CkRhdGU6IFR1ZSwgMjIgSmFuIDIwMTMgMDA6MjU6NDIgKzAxMDAK
U3ViamVjdDogW1BBVENIXSBNb3VzZSBQb29saW5nIGZpeCBmb3IgbW91c2VjbGljawoKLS0tCiBr
d2luL2VmZmVjdHMvbW91c2VjbGljay9tb3VzZWNsaWNrLmNwcCB8ICAgIDggKysrKysrKy0KIGt3
aW4vZWZmZWN0cy9tb3VzZWNsaWNrL21vdXNlY2xpY2suaCAgIHwgICAgMiArKwogMiBmaWxl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ICAgICAgIGRlbGV0ZSBjbGljazsKICAgICB9CkBAIC0yNTIsOCArMjU2LDEwIEBA
IHZvaWQgTW91c2VDbGlja0VmZmVjdDo6dG9nZ2xlRW5hYmxlZCgpCiAgICAgfQogCiAgICAgaWYg
KG1fZW5hYmxlZCkgeworICAgICAgICBwb2xsaW5nID0gdHJ1ZTsKICAgICAgICAgZWZmZWN0cy0+
c3RhcnRNb3VzZVBvbGxpbmcoKTsKICAgICB9IGVsc2UgeworICAgICAgICBwb2xsaW5nID0gZmFs
c2U7CiAgICAgICAgIGVmZmVjdHMtPnN0b3BNb3VzZVBvbGxpbmcoKTsKICAgICB9CiB9CmRpZmYg
LS1naXQgYS9rd2luL2VmZmVjdHMvbW91c2VjbGljay9tb3VzZWNsaWNrLmggYi9rd2luL2VmZmVj
dHMvbW91c2VjbGljay9tb3VzZWNsaWNrLmgKaW5kZXggMzU5MzJlYi4uNWJjZjk0OSAxMDA2NDQK
LS0tIGEva3dpbi9lZmZlY3RzL21vdXNlY2xpY2svbW91c2VjbGljay5oCisrKyBiL2t3aW4vZWZm
ZWN0cy9tb3VzZWNsaWNrL21vdXNlY2xpY2suaApAQCAtMTc2LDYgKzE3Niw4IEBAIHByaXZhdGU6
CiAgICAgTW91c2VCdXR0b24qIG1fYnV0dG9uc1tCVVRUT05fQ09VTlRdOwogCiAgICAgYm9vbCBt
X2VuYWJsZWQ7CisgICAgCisgICAgYm9vbCBwb2xsaW5nOyAvLyBNb3VzZSBwb2xsaW5nCiAKIH07
CiAKLS0gCjEuNy4xMC40Cgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>