Bug 340597

Summary: KWin crash at login
Product: [Plasma] kwin Reporter: Stefan Weigert <weigert.stefan>
Component: coreAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: hugo.pereira.da.costa
Priority: NOR    
Version: 5.1.0   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Crash report file
Backtrace when starting KMix

Description Stefan Weigert 2014-11-03 10:35:56 UTC
-- Information about the crash:
- What I was doing when the application crashed:
After logging in with SDDM, kwin crashes before the desktop shows. In other words: When the startup screen blends into the desktop, the crash-information is already there.

Reproducible: Always

Steps to Reproduce:
1. Boot system
2. Log into plasma

Actual Results:  
KWin crashes and restarts. (Crash-report window is already open when desktop appears)

Expected Results:  
No crash
Comment 1 Stefan Weigert 2014-11-03 10:37:25 UTC
Created attachment 89416 [details]
Crash report file
Comment 2 Martin Flöser 2014-11-03 10:39:42 UTC
@Hugo: please have a look at the crash trace. The crash seems to go through Oxygen size grip.
Comment 3 Hugo Pereira Da Costa 2014-11-03 10:55:15 UTC
mmm. I guess I'll need to log-in into kwin5 (tm) directly to try reproduce.
I cannot reproduce (last time I checked at least) when lauching kwin from kf5 manually (--replace)
Also, the crash happens in kdecoration (when accessed via sizegrip). Dangling pointer ? 
In any case, I'll investigate when I am home.
Comment 4 Stefan Weigert 2014-11-03 11:33:15 UTC
Maybe this makes things easier to debug... I just discovered that I can trigger the bug also whenever I'm starting kmix manually. To reproduce: quit kmix, run kmix.

I'll attach the backtrace immediately.
Comment 5 Stefan Weigert 2014-11-03 11:33:56 UTC
Created attachment 89420 [details]
Backtrace when starting KMix
Comment 6 Hugo Pereira Da Costa 2014-11-03 11:34:57 UTC
Question: you are running with window-borders = None. Correct ? 
If yes as a temporary fix you can probably set it to smthing larger (no side borders, or tiny)
Comment 7 Stefan Weigert 2014-11-03 11:37:07 UTC
@Hugo: Crazy. With tiny borders it's not crashing anymore. Thanks for the hint.
Comment 8 Hugo Pereira Da Costa 2014-11-03 16:12:36 UTC
Git commit 96a74a12570a9f6c65fb43a1416a020b4ae1c4f7 by Hugo Pereira Da Costa.
Committed on 03/11/2014 at 16:10.
Pushed by hpereiradacosta into branch 'master'.

Added WeakPointer typedef to oxygendecorationdefines to allow compilation against both KDE4 and KF5
Use WeakPointer<Client> inside Oxygen::SizeGrip to keep track of client deletion and avoid crash.

M  +13   -0    kwin-decoration/oxygendecorationdefines.h
M  +26   -22   kwin-decoration/oxygensizegrip.cpp
M  +4    -5    kwin-decoration/oxygensizegrip.h

http://commits.kde.org/oxygen/96a74a12570a9f6c65fb43a1416a020b4ae1c4f7
Comment 9 Hugo Pereira Da Costa 2014-11-03 16:13:14 UTC
Git commit 4da49ca005aad838bd912b00e3fb97a0ddd3cfaf by Hugo Pereira Da Costa.
Committed on 03/11/2014 at 16:10.
Pushed by hpereiradacosta into branch 'Plasma/5.1'.

Added WeakPointer typedef to oxygendecorationdefines to allow compilation against both KDE4 and KF5
Use WeakPointer<Client> inside Oxygen::SizeGrip to keep track of client deletion and avoid crash.

M  +13   -0    kwin-decoration/oxygendecorationdefines.h
M  +26   -22   kwin-decoration/oxygensizegrip.cpp
M  +4    -5    kwin-decoration/oxygensizegrip.h

http://commits.kde.org/oxygen/4da49ca005aad838bd912b00e3fb97a0ddd3cfaf
Comment 10 Hugo Pereira Da Costa 2014-11-03 16:18:33 UTC
Comments above should fix the crash
Stefan, can you double-check ? (using again 'no borders') ? 
Here I could reproduce (and cure) the kmix crash
I guess some paint events arrived to the size-grip after its parent decoration was destroyed.
(the size grip is not destroyed with the client because it is created as a top level window)
Comment 11 Stefan Weigert 2014-11-04 09:17:54 UTC
Hi Hugo,

how should I double-check? I'm not running plasma from git but I use the kubuntu next ppa. I don't really want to compile from source. Is there any other way in which I can help you?

Cheers,
Stefan.
Comment 12 Hugo Pereira Da Costa 2014-11-04 09:22:15 UTC
@Stefan
Nope, apart from waiting for next ubuntu update.

Compiling oxygen only should not be too much of a big deal though (its a small package), provided that you have the right "dev" packages installed (the header and .so shared libraries.