Bug 453928

Summary: Slow shutdown problems in plasma due to KWin hang
Product: [Plasma] kwin Reporter: Rounak Dutta <rounakpropubg>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: minor CC: hujq, katyaberezyaka, kde, nate
Priority: NOR Flags: nate: Wayland-
nate: X11+
Version: 5.24.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Rounak Dutta 2022-05-17 09:40:45 UTC
SUMMARY



STEPS TO REPRODUCE
1. Shut down your pc 
2. You will see a blank screen with a cursor (_) blinking for 1 minutes
3. And after waiting for 1 minute it shuts down.

OBSERVED RESULT
This happens 1 or 2 times . It doesn't show frequently but it does. I just shut down my pc and I saw a blank screen with a blinkng cursor like this - (  _  ) for 1 minute and then  it shuts down. 

EXPECTED RESULT
I expected my pc to normally shut down like it would in other desktop environments like xfce, gnome and cinnamon. 

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.17.7-zen1-1-zen ( Using xorg X11)
(available in About System)
KDE Plasma Version: 5.24.25
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4

ADDITIONAL INFORMATION
N/A
Comment 1 Rounak Dutta 2022-05-17 10:29:47 UTC
This is my journalctl logs (Shutdown logs) - 
http://0x0.st/oaiV.txt

If u look at this line in that log file - 
May 17 15:43:46 archissexy systemd[558]: app-firefox-663133abf48d4c0ab238cf6cc4831123.scope: Consumed 1min 40.732s CPU time.
May 17 15:45:14 archissexy systemd[1]: session-2.scope: Stopping timed out. Killing.
May 17 15:45:14 archissexy systemd[1]: session-2.scope: Killing process 604 (kwin_x11) with signal SIGKILL.
May 17 15:45:14 archissexy systemd[1]: session-2.scope: Killing process 767 (n/a) with signal SIGKILL.
May 17 15:45:14 archissexy systemd[1]: session-2.scope: Killing process 2138 (QSGRenderThread) with signal SIGKILL.
May 17 15:45:14 archissexy systemd[1]: session-2.scope: Failed with result 'timeout'.
May 17 15:45:14 archissexy systemd[1]: Stopped Session 2 of User rounak.
May 17 15:45:14 archissexy systemd[1]: session-2.scope: Consumed 42.543s CPU time.
May 17 15:45:14 archissexy systemd[1]: Stopping User Login Management...
May 17 15:45:14 archissexy systemd[1]: Stopping User Manager for UID 1000...
May 17 15:45:14 archissexy systemd-logind[427]: Removed session 2.
This shows that my kwin is not stopping and so it has to kill the process. Which is taking so much time for my pc to shutdown.
Comment 2 Rounak Dutta 2022-05-18 10:17:03 UTC
I don't know why no one is fixing this problem. I like kde so much but this bug is annoying and this thing is preventing me to use kde. I am forced to use crappy desktop environments like gnome , budgie , lxqt and mate. Everyone is having this problem and there is literally no response - 
Just look at how many people are having this problem - 

https://bugs.kde.org/show_bug.cgi?id=427373 ( Open since 2020 but no response ) 
https://bbs.archlinux.org/viewtopic.php?id=271102 ( This is my arch forum post ) 
https://bbs.archlinux.org/viewtopic.php?id=269310
https://bbs.archlinux.org/viewtopic.php?id=269549
https://bbs.archlinux.org/viewtopic.php?id=270759
https://bbs.archlinux.org/viewtopic.php?id=254577

Please look at this matter please.
Comment 3 Rounak Dutta 2022-05-18 12:56:24 UTC
Here is the detailed screenshot of the bug I am facing- https://imgur.com/a/BWnCXhh
Comment 4 Nate Graham 2022-05-18 16:34:52 UTC
You just reported the issue yesterday. Please read https://community.kde.org/Get_Involved/Issue_Reporting#Have_realistic_expectations
Comment 5 Rounak Dutta 2022-06-16 09:06:55 UTC
After the new kde update. I thought it will get fixed but still I am having the same problem. I am facing a message like this when I am turning off or rebooting my pc -
https://imgur.com/a/v2k3PnD
https://imgur.com/a/kWYNOwP

and it takes 2 to 3 minutes exactly for it to automatically shut down.
Comment 6 David Edmundson 2022-06-16 10:07:52 UTC
Can you confirm if this is an issue with 5.25. There is an important change to how we manage kwin.


The most important line from this log is:
May 17 15:43:44 archissexy kwin_x11[604]: The X11 connection broke: I/O error (code 1)

So kwin_x11 is trying to exit probably around the same time as the sigterm. It then potentially restarts after the sigterm is sent so therefore misses it.
Can you check if "coredumpctl" lists anything for kwin?
Comment 7 Rounak Dutta 2022-06-16 19:11:52 UTC
(In reply to David Edmundson from comment #6)
> Can you confirm if this is an issue with 5.25. There is an important change
> to how we manage kwin.
> 
> 
> The most important line from this log is:
> May 17 15:43:44 archissexy kwin_x11[604]: The X11 connection broke: I/O
> error (code 1)
> 
> So kwin_x11 is trying to exit probably around the same time as the sigterm.
> It then potentially restarts after the sigterm is sent so therefore misses
> it.
> Can you check if "coredumpctl" lists anything for kwin?

Umm I read the archwiki on core dump -https://wiki.archlinux.org/title/Core_dump#Making_a_core_dump I did 

[rounak@archissexy ~]$ sudo coredumpctl list
No coredumps found.

and 

[rounak@archissexy ~]$ sudo coredumpctl info 505
No coredumps found.

505 is the kwin process - 

[rounak@archissexy ~]$ pgrep -f kwin
505
[rounak@archissexy ~]$ 

so no coredump were found
Comment 8 Rounak Dutta 2022-06-17 11:07:54 UTC
(In reply to David Edmundson from comment #6)
> Can you confirm if this is an issue with 5.25. There is an important change
> to how we manage kwin.
> 
> 
> The most important line from this log is:
> May 17 15:43:44 archissexy kwin_x11[604]: The X11 connection broke: I/O
> error (code 1)
> 
> So kwin_x11 is trying to exit probably around the same time as the sigterm.
> It then potentially restarts after the sigterm is sent so therefore misses
> it.
> Can you check if "coredumpctl" lists anything for kwin?

I still have the same problem with plasma. Kwin hangs and I updated it to kwin 5.25.0-1 still have the same problem :'( . What should I do ? 
This is my system info in details- http://0x0.st/oupH.txt , http://0x0.st/oup8.png
Comment 9 Rounak Dutta 2022-06-19 17:18:32 UTC
Oh it is working now !!!! I didn't restart my pc after the update after I rebooted my pc everything looks good. I am using plasma for 3 days but till now I haven't seen any kwin hang. :)
Comment 10 Rounak Dutta 2022-06-21 09:32:05 UTC
Nope it didn't worked out well. Today I faced the kwin hang again. - https://imgur.com/a/v2k3PnD
Comment 11 Rounak Dutta 2022-06-23 10:10:28 UTC
(In reply to David Edmundson from comment #6)
> Can you confirm if this is an issue with 5.25. There is an important change
> to how we manage kwin.
> 
> 
> The most important line from this log is:
> May 17 15:43:44 archissexy kwin_x11[604]: The X11 connection broke: I/O
> error (code 1)
> 
> So kwin_x11 is trying to exit probably around the same time as the sigterm.
> It then potentially restarts after the sigterm is sent so therefore misses
> it.
> Can you check if "coredumpctl" lists anything for kwin?

I GOT SOMETHING!!!!! 
When I do coredumpctl list I got this - https://paste.rs/9IX
Comment 12 Rounak Dutta 2022-06-23 10:21:11 UTC
Here I found some details about it. Please help !!!!!!!!!!! - http://0x0.st/oSK8.txt
Comment 13 David Edmundson 2022-06-23 10:22:47 UTC
Pasting inline.

                #11 0x00007f1a3a63e838 raise (libc.so.6 + 0x3e838)
                #12 0x00007f1a3a628535 abort (libc.so.6 + 0x28535)
                #13 0x00007f1a3a68245e n/a (libc.so.6 + 0x8245e)
                #14 0x00007f1a3a6980cc n/a (libc.so.6 + 0x980cc)
                #15 0x00007f1a3a698bf4 n/a (libc.so.6 + 0x98bf4)
                #16 0x00007f1a3a69a10b n/a (libc.so.6 + 0x9a10b)
                #17 0x00007f1a3a69c8f3 free (libc.so.6 + 0x9c8f3)
                #18 0x00007f1a3b88897e n/a (libQt5Core.so.5 + 0x28897e)
                #19 0x00007f1a3a6413e7 __cxa_finalize (libc.so.6 + 0x413e7)
                #20 0x00007f1a3b6ca978 n/a (libQt5Core.so.5 + 0xca978)
                #21 0x00007f1a3d08dcfe n/a (ld-linux-x86-64.so.2 + 0x5cfe)
                #22 0x00007f1a3a640ef5 n/a (libc.so.6 + 0x40ef5)
                #23 0x00007f1a3a641070 exit (libc.so.6 + 0x41070)
                #24 0x00007f1a3a8fcbf6 _XDefaultIOError (libX11.so.6 + 0x3fbf6)
                #25 0x00007f1a3a8ffe13 _XIOError (libX11.so.6 + 0x42e13)
                #26 0x00007f1a3a904f54 _XReply (libX11.so.6 + 0x47f54)
                #27 0x00007f1a3a8f8111 XSync (libX11.so.6 + 0x3b111)
                #28 0x00007f1a3a8e0de1 XCloseDisplay (libX11.so.6 + 0x23de1)
                #29 0x00007f1a2c8e3ce6 n/a (KWinX11Platform.so + 0x31ce6)
                #30 0x00007f1a2c8e3fc1 n/a (KWinX11Platform.so + 0x31fc1)
                #31 0x00007f1a2c8e401d n/a (KWinX11Platform.so + 0x3201d)
                #32 0x00007f1a2c8dcc07 n/a (KWinX11Platform.so + 0x2ac07)
                #33 0x00007f1a2c8dcedd n/a (KWinX11Platform.so + 0x2aedd)
                #34 0x00007f1a3cb8fd00 _ZN4KWin10Compositor4stopEv (libkwin.so.5 + 0x18fd00)
                #35 0x00007f1a3cb91c1a _ZN4KWin13X11CompositorD2Ev (libkwin.so.5 + 0x191c1a)
                #36 0x00007f1a3cb91c5e _ZN4KWin13X11CompositorD0Ev (libkwin.so.5 + 0x191c5e)
                #37 0x00005559612b4b23 n/a (kwin_x11 + 0x2fb23)
                #38 0x00005559612b2df1 n/a (kwin_x11 + 0x2ddf1)
                #39 0x00007f1a3a629290 n/a (libc.so.6 + 0x29290)
                #40 0x00007f1a3a62934a __libc_start_main (libc.so.6 + 0x2934a)

Debug symbols would help here. 
Especially frame 18
Comment 14 Rounak Dutta 2022-06-23 10:39:40 UTC
(In reply to David Edmundson from comment #13)

> Debug symbols would help here. 
> Especially frame 18

What is debug symbols ?
I asked people in the arch forums. They said that it is a bug with the aurora engine - https://bbs.archlinux.org/viewtopic.php?id=277470
Comment 15 Rounak Dutta 2022-06-23 10:46:40 UTC
Here is the coredump file I generated which tells everything in details - https://paste.rs/m0K
Comment 16 Rounak Dutta 2022-07-20 18:26:51 UTC
(In reply to Rounak Dutta from comment #14)
> (In reply to David Edmundson from comment #13)
> 
> > Debug symbols would help here. 
> > Especially frame 18
> 
> What is debug symbols ?
> I asked people in the arch forums. They said that it is a bug with the
> aurora engine - https://bbs.archlinux.org/viewtopic.php?id=277470

Sorry for the very late reply. Today my python crashed and here are debuginfo symbols -
http://0x0.st/oj-7.txt
https://pastebin.com/ZQDsE0hh
https://paste.rs/enG
Comment 17 Rounak Dutta 2022-07-20 18:27:50 UTC
Here are my shutdown logs for more info - http://0x0.st/oj-d.txt