Bug 406534

Summary: KWin freezes when running this simple script
Product: [Plasma] kwin Reporter: trmdi
Component: scriptingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: kde
Priority: NOR    
Version: 5.15.4   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Backtrace

Description trmdi 2019-04-14 16:30:41 UTC
KWin freezes when running this simple script then close any window.
I don't know if there is something wrong with my script.

STEPS TO REPRODUCE
1. Install this simple script: https://github.com/trmdi/test
2. Open a new window, the sound is played as expected.
3. Close a window.

OBSERVED RESULT
KWin freezes.

EXPECTED RESULT
The window is closed and the sound is played without making KWin freeze.
Comment 1 Martin Flöser 2019-04-14 18:40:08 UTC
Please attach gdb and get a backtrace of the freeze.
Comment 2 trmdi 2019-04-15 03:07:26 UTC
Created attachment 119413 [details]
Backtrace

Sometimes kwin does not freeze, but 99% it freezes.
Comment 3 Martin Flöser 2019-04-15 06:48:36 UTC
Freeze is triggered from Qt Multimedia. Nothing we can do. I recommend to not play the sound in KWin, but pass it to another application through dbus.
Comment 4 trmdi 2019-04-15 06:58:48 UTC
(In reply to Martin Flöser from comment #3)
> Freeze is triggered from Qt Multimedia. Nothing we can do. I recommend to
> not play the sound in KWin, but pass it to another application through dbus.

Thanks for your reply! :)

I just tag @davidedmundson here, in case he wants to do something in the Qt side.
Comment 5 David Edmundson 2019-04-15 08:02:03 UTC
I get kwin bug reports directly, no need to add me.

X is deadlocked as we're creating new connections whilst handling an X client removed. I wouldn't say it's a Qt bug, sorry. 

Pulseaudio from within kwin must normally work as the knotifications backend is in process. So adding Qt.callLater() might suffice.

But as MF says, passing to another process would be better.