<?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>290482</bug_id>
          
          <creation_ts>2012-01-03 11:05:28 +0000</creation_ts>
          <short_desc>KWin crash, when trying to use the new qml-based switcher</short_desc>
          <delta_ts>2012-05-29 05:55:23 +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>tabbox</component>
          <version>unspecified</version>
          <rep_platform>Fedora RPMs</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://git.reviewboard.kde.org/r/105000/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>4.9 Beta 1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andreas Krohn">Hamburger1984</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>arthur.souza12</cc>
    
    <cc>g111</cc>
    
    <cc>rvoinea</cc>
    
    <cc>ssendilkumar</cc>
          
          <cf_commitlink>http://commits.kde.org/kde-workspace/19c0fa5abd90a46de2ef6949a15de31111f930f4</cf_commitlink>
          <cf_versionfixedin>4.8.4</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      <flag name="ReviewRequest"
          id="106"
          type_id="14"
          status="+"
          setter="mgraesslin"
    />

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1208513</commentid>
    <comment_count>0</comment_count>
    <who name="Andreas Krohn">Hamburger1984</who>
    <bug_when>2012-01-03 11:05:28 +0000</bug_when>
    <thetext>Application: kwin (4.7.95 (4.8 RC1 (4.7.95))
KDE Platform Version: 4.7.95 (4.8 RC1 (4.7.95)
Qt Version: 4.8.0
Operating System: Linux 3.1.6-1.fc16.x86_64 x86_64
Distribution: &quot;Fedora release 16 (Verne)&quot;

-- Information about the crash:
- What I was doing when the application crashed:

* System was under quite heavy load
* Attempted to switch to another window (qml/layout based switcher)
* Crash

The crash can be reproduced some of the time.

-- Backtrace:
Application: KWin (kwin), signal: Segmentation fault
Using host libthread_db library &quot;/lib64/libthread_db.so.1&quot;.
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[Current thread is 1 (Thread 0x7fd125d91840 (LWP 14374))]

Thread 2 (Thread 0x7fd111698700 (LWP 14482)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:165
#1  0x0000003b76584e62 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x3b7687e240) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#2  0x0000003b76584e99 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=&lt;optimized out&gt;) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#3  0x0000003b61c07d90 in start_thread (arg=0x7fd111698700) at pthread_create.c:309
#4  0x0000003b610ef48d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7fd125d91840 (LWP 14374)):
[KCrash Handler]
#6  0x0000003b7def3090 in KWin::TabBox::ClientModel::data (this=0x1704090, index=&lt;optimized out&gt;, role=&lt;optimized out&gt;) at /usr/src/debug/kde-workspace-4.7.95/kwin/tabbox/clientmodel.cpp:80
#7  0x0000003b77d8ca12 in QDeclarativeVisualDataModelDataMetaObject::initialValue (this=&lt;optimized out&gt;, propId=3) at graphicsitems/qdeclarativevisualitemmodel.cpp:534
#8  0x0000003b77cfbf25 in QDeclarativeOpenMetaObjectPrivate::getData (this=0x2042080, idx=3) at util/qdeclarativeopenmetaobject.cpp:149
#9  0x0000003b77cfaacf in QDeclarativeOpenMetaObject::metaCall (this=0x1f19bc0, c=&lt;optimized out&gt;, id=&lt;optimized out&gt;, a=&lt;optimized out&gt;) at util/qdeclarativeopenmetaobject.cpp:230
#10 0x0000003b68182088 in QMetaProperty::read (this=0x7fff2f10de30, object=0x2153f80) at kernel/qmetaobject.cpp:2267
#11 0x0000003b77e56e5d in QDeclarativeObjectScriptClass::property (this=&lt;optimized out&gt;, obj=0x2153f80, name=&lt;optimized out&gt;) at qml/qdeclarativeobjectscriptclass.cpp:319
#12 0x0000003b77e5c4ee in QDeclarativeContextScriptClass::property (this=0x1e8d190, object=&lt;optimized out&gt;, name=&lt;optimized out&gt;) at qml/qdeclarativecontextscriptclass.cpp:289
#13 0x0000003b765fd8a0 in QScript::DeclarativeObjectDelegate::getOwnPropertySlot (this=0x2218220, object=0x7fd10994f9c0, exec=0x7fd1099a50f8, propertyName=..., slot=...) at bridge/qscriptdeclarativeobject.cpp:76
#14 0x0000003b764d4bc5 in fastGetOwnPropertySlot (this=0x7fd10994f9c0, slot=..., propertyName=..., exec=0x7fd1099a50f8) at ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h:382
#15 getPropertySlot (slot=&lt;optimized out&gt;, propertyName=&lt;optimized out&gt;, exec=&lt;optimized out&gt;, this=&lt;optimized out&gt;) at ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h:391
#16 QTJSC::cti_op_resolve_skip (args=0x7fff2f10e1a0) at ../3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp:2307
#17 0x00007fd112faf572 in ?? ()
#18 0x0000000000000000 in ?? ()

Reported using DrKonqi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1208682</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2012-01-03 16:34:10 +0000</bug_when>
    <thetext>any way to reproduce the crash? Being just under heavy load is rather 
difficult to test :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1208902</commentid>
    <comment_count>2</comment_count>
    <who name="Andreas Krohn">Hamburger1984</who>
    <bug_when>2012-01-03 23:56:01 +0000</bug_when>
    <thetext>well - that&apos;s the only situation I remember.. if I observe this behavior in other situations, i&apos;ll add another comment.

&apos;heavy load&apos; was &apos;building calligra and digikam&apos; ;-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1221650</commentid>
    <comment_count>3</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-02-01 15:15:05 +0000</bug_when>
    <thetext>*** Bug 293031 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1221654</commentid>
    <comment_count>4</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-02-01 15:18:22 +0000</bug_when>
    <thetext>*** Bug 292589 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1234165</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2012-03-09 07:31:09 +0000</bug_when>
    <thetext>we need a reproducable way how to reproduce this crash. In case anyone is able to reproduce the crash, please provide steps on how to reproduce it. Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1234687</commentid>
    <comment_count>6</comment_count>
    <who name="Andreas Krohn">Hamburger1984</who>
    <bug_when>2012-03-10 18:12:06 +0000</bug_when>
    <thetext>I didn&apos;t observe this behavior in quite a while - maybe it was just an incompatibility with different qt/kms/intel libraries/drivers. I guess we can close this bug if noone else triggers this problem..?!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1234691</commentid>
    <comment_count>7</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2012-03-10 18:21:25 +0000</bug_when>
    <thetext>thanks for the feedback. I think we can just keep it in this state and reopen it if it happens again :-)

Btw I had seen the crash in the past, too. But had never been able to reproduce and haven&apos;t seen it for some weeks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1234975</commentid>
    <comment_count>8</comment_count>
    <who name="">g111</who>
    <bug_when>2012-03-11 11:41:08 +0000</bug_when>
    <thetext>Well, the crash does happen for me (using ubuntu backports) at least once a day. Sometimes it happens when using the hotkey function &quot;Walk Through Desktops&quot;, sometimes I think it also happend with &quot;Walk Through Windows&quot;. I do not know if it is always the same crash reason. The problem is that I cannot find a way to reproduce it. Sometimes I have the feeling that it happens after opening or maybe closing some windows or changing the stack order or something. Sometimes I think that it happens more often after working on one desktop for a bit longer or after unlocking the desktop lock after a break. But I do not know.

I am very happen that kwin restarts and resets itself automatically afterwards, so I can continue to work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1235027</commentid>
    <comment_count>9</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-03-11 13:19:31 +0000</bug_when>
    <thetext>please have a look at bug #294534

it&apos;s just a wild guess, but do you (your distro) compile w/ -ftree-vectorize?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1235560</commentid>
    <comment_count>10</comment_count>
    <who name="">g111</who>
    <bug_when>2012-03-12 11:00:47 +0000</bug_when>
    <thetext>Well, I am using ubuntu 10.10 with the KDE 4.8.1 backports at work. How can I find out if it was compiled with the  -ftree-vectorize flag?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1235561</commentid>
    <comment_count>11</comment_count>
    <who name="">g111</who>
    <bug_when>2012-03-12 11:02:23 +0000</bug_when>
    <thetext>Argh, sorry. it is today one year later than I thought. I am using ubuntu 11/10 (oneric or what the name is. well, version &quot;O&quot;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1235700</commentid>
    <comment_count>12</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-03-12 17:02:44 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; Well, I am using ubuntu 10.10 with the KDE 4.8.1 backports at work. How can
&gt; I find out if it was compiled with the  -ftree-vectorize flag?

probably only by asking ubuntu / package maintainer - i can&apos;t see compiler flags listed in the .dsc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1254178</commentid>
    <comment_count>13</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-05-12 11:54:24 +0000</bug_when>
    <thetext>*** Bug 299871 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1256651</commentid>
    <comment_count>14</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-05-20 08:08:50 +0000</bug_when>
    <thetext>*** Bug 300340 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1256652</commentid>
    <comment_count>15</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-05-20 08:09:41 +0000</bug_when>
    <thetext>Anyone experiencing this bug:
what is your shortcut configuration for window and desktop switching?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1256683</commentid>
    <comment_count>16</comment_count>
    <who name="Sendil">ssendilkumar</who>
    <bug_when>2012-05-20 11:57:19 +0000</bug_when>
    <thetext>The shortcut I had set was Win+Tab for workspace cycle List, and Alt+tab for window-list current desktop. What I have noticed is that usually (heavy loaded conditions - my case when google-chrome browsing activity was running with multiple tabs or kdevelop or qtcreator code writing) it crashes. 

[Seems solved]
- Recently I installed bumblebee based on the instructions here https://help.ubuntu.com/community/Asus_U31SD
- Switched to OpenGL mode 
- Disabled OpenGL 2 Shaders &amp; Use VSync from Desktop Effects (Advanced Settings)

I find that recently it has not happened after that.




====
System :
Kubuntu 12.04 upgraded from 11.10
Kernel 3.2.0-24-generic-pae (32bit)
Asus : U31S 
Nvidia GT520</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1256750</commentid>
    <comment_count>17</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2012-05-20 15:20:19 +0000</bug_when>
    <thetext>I think I found a way to reproduce the crash:
1. Configure both primary and secondary TabBox with different layouts
2. Use primary TabBox
3. Close a window, best the one which used to be active
4. Use secondary TabBox
-&gt; Crash

Review Request on the way</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1257445</commentid>
    <comment_count>18</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2012-05-22 16:36:43 +0000</bug_when>
    <thetext>Git commit 05a3420175c88c7a106a245071d4bb3a75694e00 by Martin Gräßlin.
Committed on 20/05/2012 at 15:52.
Pushed by graesslin into branch &apos;master&apos;.

Use smart pointers to protect access to TabBoxClient

Client holds a SharedPointer to the TabBoxClient and only
provides access to a WeakPointer which is passed to TabBox.
ClientModel is adjusted to hold a list of WeakPointers instead
of the direct pointers.

This fixes the following reproducable crash:
1. Configure both primary and secondary TabBox with different
   layouts
2. Use primary TabBox
3. Close a window, best the one which used to be active
4. Use secondary TabBox
-&gt; Crash

The reason is that the ClientModel still contains the pointer
to the deleted TabBoxClient in step 3 and while creating the
layout access to the TabBoxClient is needed to get the Client&apos;s
icon.

By using the weak pointer it can be ensured that we don&apos;t try
to dereference the deleted pointer and prevent the crash.
Related: bug 285747, bug 237345
REVIEW: 105000

M  +1    -4    kwin/client.cpp
M  +3    -3    kwin/client.h
M  +40   -28   kwin/tabbox/clientmodel.cpp
M  +1    -1    kwin/tabbox/clientmodel.h
M  +26   -14   kwin/tabbox/tabbox.cpp
M  +4    -4    kwin/tabbox/tabbox.h
M  +28   -6    kwin/tabbox/tabboxhandler.cpp
M  +6    -6    kwin/tabbox/tabboxhandler.h

http://commits.kde.org/kde-workspace/05a3420175c88c7a106a245071d4bb3a75694e00</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1257448</commentid>
    <comment_count>19</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2012-05-22 16:43:39 +0000</bug_when>
    <thetext>unfortunately backporting to 4.8 results in too many merge conflicts, so it&apos;s just a fix in 4.9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1257625</commentid>
    <comment_count>20</comment_count>
    <who name="Sendil">ssendilkumar</who>
    <bug_when>2012-05-23 04:52:22 +0000</bug_when>
    <thetext>The reproducible steps, is that by writing a small test application. Or it relates to multiple-tabs in the APPLICATION kwin&apos;s titlebar (by grouping applications)?

Hope I did not sound very silly in this question !!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1259998</commentid>
    <comment_count>21</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2012-05-29 05:55:23 +0000</bug_when>
    <thetext>Git commit 19c0fa5abd90a46de2ef6949a15de31111f930f4 by Martin Gräßlin.
Committed on 20/05/2012 at 15:52.
Pushed by graesslin into branch &apos;KDE/4.8&apos;.

Use smart pointers to protect access to TabBoxClient

Client holds a SharedPointer to the TabBoxClient and only
provides access to a WeakPointer which is passed to TabBox.
ClientModel is adjusted to hold a list of WeakPointers instead
of the direct pointers.

This fixes the following reproducable crash:
1. Configure both primary and secondary TabBox with different
   layouts
2. Use primary TabBox
3. Close a window, best the one which used to be active
4. Use secondary TabBox
-&gt; Crash

The reason is that the ClientModel still contains the pointer
to the deleted TabBoxClient in step 3 and while creating the
layout access to the TabBoxClient is needed to get the Client&apos;s
icon.

By using the weak pointer it can be ensured that we don&apos;t try
to dereference the deleted pointer and prevent the crash.

Cherry-Picked from 05a3420175c88c7a106a245071d4bb3a75694e00
Related: bug 285747, bug 237345
FIXED-IN: 4.8.4
REVIEW: 105000
REVIEW: 105069

M  +1    -4    kwin/client.cpp
M  +3    -3    kwin/client.h
M  +31   -22   kwin/tabbox/clientmodel.cpp
M  +1    -1    kwin/tabbox/clientmodel.h
M  +4    -2    kwin/tabbox/desktopitemdelegate.cpp
M  +19   -12   kwin/tabbox/tabbox.cpp
M  +4    -4    kwin/tabbox/tabbox.h
M  +28   -6    kwin/tabbox/tabboxhandler.cpp
M  +6    -6    kwin/tabbox/tabboxhandler.h

http://commits.kde.org/kde-workspace/19c0fa5abd90a46de2ef6949a15de31111f930f4</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>