Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kwin_x11 crashes when switching virtual desktop #60312

Closed
jluttine opened this issue Apr 27, 2019 · 24 comments
Closed

kwin_x11 crashes when switching virtual desktop #60312

jluttine opened this issue Apr 27, 2019 · 24 comments
Labels
0.kind: regression Something that worked before working no longer 6.topic: qt/kde

Comments

@jluttine
Copy link
Member

Issue description

On current nixos-unstable, KDE isn't working properly. Many animations seem to be somewhat broken, but most importantly, kwin_x11 crashes when switching from one virtual desktop to another if "Show on-screen display when switching" is enabled.

This is what I can see in journalctl logs between two consecutive crashes:

Apr 26 11:38:11 leevi xsession[2802]: KCrash: Application 'kwin_x11' crashing...
Apr 26 11:38:11 leevi xsession[2802]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 178, resource id: 56623111, major code: 20 (GetProperty), minor code: 0
Apr 26 11:38:11 leevi xsession[2802]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 179, resource id: 56623111, major code: 20 (GetProperty), minor code: 0
Apr 26 11:38:11 leevi X[2653]: (II) modeset(0): EDID vendor "LGD", prod id 803
Apr 26 11:38:11 leevi X[2653]: (II) modeset(0): Printing DDC gathered Modelines:
Apr 26 11:38:11 leevi X[2653]: (II) modeset(0): Modeline "1920x1080"x0.0  138.00  1920 1952 1988 2088  1080 1085 1090 1102 -hsync -vsync (66.1 kHz eP)
Apr 26 11:38:11 leevi xsession[2802]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1242, resource id: 56623127, major code: 3 (GetWindowAttributes), minor code: 0
Apr 26 11:38:11 leevi xsession[2802]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1243, resource id: 56623127, major code: 14 (GetGeometry), minor code: 0
Apr 26 11:38:12 leevi xsession[2802]: Application::crashHandler() called with signal 11; recent crashes: 2
Apr 26 11:38:13 leevi xsession[2802]: KCrash: Application 'kwin_x11' crashing...

I don't know if this is an upstream or NixOS issue. I'm trying to find the breaking commit but it takes a lot of time because nix apparently needs to build quite a lot of stuff although I've tried to make as minimal system as possible.

Steps to reproduce

  • Use, for instance, nixpkgs commit 2fed7f2.
  • Use KDE as your desktop manager.
  • System settings -> Desktop behaviour -> Virtual desktops -> Enable "Show on-screen display when switching".

Technical details

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.34, NixOS, 19.09.git.0df8ae8 (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2`
 - nixpkgs: `/etc/nixpkgs`
@jluttine
Copy link
Member Author

Well, I now tried using a bit older commits in nixos-unstable and rebooting to that system, but now KDE is even more broken. System settings -> Virtual desktops says: "The shared library was not found. Possible reasons: An error occurred during your last KDE upgrade leaving an orphaned control module. ...".

So, perhaps it's not a good idea to go back and forth over different KDE versions?

Any other ideas how to find what has broken it?

@jluttine
Copy link
Member Author

I reported upsteam too: https://bugs.kde.org/show_bug.cgi?id=406970

@hedning
Copy link
Contributor

hedning commented Apr 27, 2019

There's this open issue on problems mixing different qt versions from different profiles: #47552. That sounds like the second problem you've encountered.

Not sure about the kwin crash, cc @bkchr

@FRidh FRidh added the 0.kind: regression Something that worked before working no longer label Apr 28, 2019
@jluttine
Copy link
Member Author

I don't have anything installed on my profile:

$ nix-env --list-generations
   2   2019-02-02 16:50:44   (current)
$ nix-env --query

Not sure if it's possible that there is some result symlink hanging around somewhere and that would cause problems.. I've run nix-collect-garbage -d anyway.

@hedning
Copy link
Contributor

hedning commented Apr 28, 2019

Nah, probably something else then.

@winterdeaf
Copy link
Contributor

I had a similar problem - broken animations, and the task switcher (Ctrl-Tab) was making kwin_x11 crash. I solved it by changing the compositor rendering backend (Settings -> Display and monitor -> Compositor) from OpenGL 2.0 to OpenGL 3.1 and back.

Sadly the last update seemed to break many things - I needed to reinstall some kwin_scripts I used, and I still encounter some glitches now and then.

@roconnor-blockstream
Copy link
Contributor

FWIW, I have a similar but different problem where recently kwin_x11 crashes when using Alt-Tab to switch windows. Reverting to an older generation of NixOS is even worse with the older generation having kwin_x11 crash on startup now.

@roconnor-blockstream
Copy link
Contributor

Seems nuking my ~/.cache has helped in my case.

@tbenst
Copy link
Contributor

tbenst commented May 2, 2019

@roconnor-blockstream that fixed my issues as well!

@peterhoeg
Copy link
Member

Getting rid of ~/.cache/kwin is probably enough. @jluttine, can you confirm it's OK on your side?

@bkchr
Copy link
Contributor

bkchr commented May 3, 2019

Hey, sorry for the late reply. The actual solution is to remove all qmlcache dirs in ~/.cache.
find ~/ -name qmlcache -exec rm -rf {} +

I googled a bit and it seems that we probably need to support this removing on updates, especially when updating qt.

@jluttine
Copy link
Member Author

jluttine commented May 4, 2019

Thanks, those fixed my issue! But isn't this an upstream bug then? Kwin (or some KDE component) isn't invalidating its cache properly?

@ambrop72
Copy link
Contributor

It is possible to compile QML modules ahead of time, should solve (or rather work around) caching issues: https://doc.qt.io/qt-5/qtquick-deployment.html

@peterhoeg
Copy link
Member

AOT compilation requires changes to each source package, so while it is definitely preferable to have that, it still doesn't change the fact that we need to handle this case as well.

The other option is to use QML_DISABLE_DISK_CACHE=1 - if somebody has the energy to do some benchmarking, that would be great!

I'm with @jluttine on this being an upstream issue, but I don't think it is perceived as a problem as such - based on what I could find, the Qt project tells people to either disable the cache completely or just delete the cached files.

@mancier
Copy link

mancier commented Jun 24, 2019

I had the same problem! And had cleaned the cache resolved... Thanks

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@solson
Copy link
Member

solson commented Mar 30, 2021

I had a similar issue just now where kwin crashed when using Alt+Tab (the Task Switcher), but only when using certain Task Switcher visualizations. Deleting all .qmlc and .jsc files in ~/.cache fixed the problem for me.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 30, 2021
@peterhoeg
Copy link
Member

How do you feel about preparing a PR @solson that makes the plasma activation script handle that?

@solson
Copy link
Member

solson commented Mar 30, 2021

I might not have time for a few weeks, but is this the place you mean? Looks like it should be pretty easy.

@peterhoeg
Copy link
Member

Yep and yep!

@stale
Copy link

stale bot commented Sep 26, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 26, 2021
@patka-123
Copy link
Contributor

Hello @jluttine and @solson 👋

I was wondering if this issue is still a problem, or if it has been resolved by now. If it has been resolved, would you be able to close this issue?

(I'm going through issues marked as stale to see what can be resolved. If this is still an issue then don't mind me).

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 23, 2023
@jluttine
Copy link
Member Author

@patka-123 I haven't used KDE/kwin for a few years anymore, so can't tell. Perhaps someone else can comment?

@solson
Copy link
Member

solson commented Nov 24, 2023

My issues stemmed from the stale qmlc files, which has been worked around: #197010

I'll close this.

@solson solson closed this as completed Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: regression Something that worked before working no longer 6.topic: qt/kde
Projects
None yet
Development

No branches or pull requests