Bug 432570

Summary: kwin_x11 crash randomly in KWin::SceneOpenGL::createScene()
Product: [Plasma] kwin Reporter: Alexander <oberkut>
Component: scene-openglAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: crash CC: andysem, bluescreenavenger, bs.blackscout.bs, freenico2020, gregory.duhamel, grosser.meister.morti, joshua.rich, migroslinx, nate, oberkut, pub, vladmak04
Priority: HI Keywords: drkonqi
Version: 5.20.5   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=426435
Latest Commit: Version Fixed In:
Attachments: attachment-32390-0.html
attachment-9948-0.html
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi

Description Alexander 2021-02-06 12:47:54 UTC
Application: kwin_x11 (5.20.5)

Qt Version: 5.15.2
Frameworks Version: 5.78.0
Operating System: Linux 5.10.12-1-default x86_64
Windowing system: X11
Distribution: "openSUSE Tumbleweed"

-- Information about the crash:
- Unusual behavior I noticed:
KDE Frameworks 5.78.0,
Qt 5.15.2 
xcb.
Random crash kwin_x11

The crash can be reproduced every time.

-- Backtrace:
Application: KWin (kwin_x11), signal: Segmentation fault

[KCrash Handler]
#4  0x00007fef31632c8d in KWin::SceneOpenGL::createScene(QObject*) (parent=<optimized out>) at /usr/src/debug/kwin5-5.20.5-2.1.x86_64/plugins/scenes/opengl/scene_opengl.cpp:454
#5  0x00007fef31641a19 in KWin::OpenGLFactory::create(QObject*) const (this=<optimized out>, parent=0x56293c31dcb0) at /usr/src/debug/kwin5-5.20.5-2.1.x86_64/plugins/scenes/opengl/scene_opengl.cpp:2757
#6  0x00007fef480f9b33 in KWin::Compositor::setupStart() (this=0x56293c31dcb0) at /usr/src/debug/kwin5-5.20.5-2.1.x86_64/composite.cpp:246
#7  0x00007fef480fa385 in KWin::Compositor::setupStart() (this=this@entry=0x56293c31dcb0) at /usr/src/debug/kwin5-5.20.5-2.1.x86_64/composite.cpp:296
#8  0x00007fef480fd11a in KWin::X11Compositor::start() (this=0x56293c31dcb0) at /usr/src/debug/kwin5-5.20.5-2.1.x86_64/composite.cpp:961
#9  0x00007fef480faf73 in KWin::Compositor::reinitialize() (this=0x56293c31dcb0) at /usr/src/debug/kwin5-5.20.5-2.1.x86_64/composite.cpp:525
#10 0x00007fef46cf28c6 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fffd22ce890, r=0x56293c31dcb0, this=0x56293c48f6f0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#11 doActivate<false>(QObject*, int, void**) (sender=0x56293c44ac30, signal_index=4, argv=0x7fffd22ce890) at kernel/qobject.cpp:3886
#12 0x00007fef46ce8311 in QObject::event(QEvent*) (this=0x56293c44ac30, e=0x56293c8ef8c0) at kernel/qobject.cpp:1314
#13 0x00007fef4786c50f in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x56293c44ac30, e=0x56293c8ef8c0) at kernel/qapplication.cpp:3632
#14 0x00007fef46cbc2ea in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x56293c44ac30, event=0x56293c8ef8c0) at kernel/qcoreapplication.cpp:1063
#15 0x00007fef46cbed21 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x56293c04cef0) at kernel/qcoreapplication.cpp:1817
#16 0x00007fef46d10d0a in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x56293c139b80, flags=...) at kernel/qeventdispatcher_unix.cpp:468
#17 0x00007fef40ced38e in QXcbUnixEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x56293c139b80, flags=...) at qxcbeventdispatcher.cpp:60
#18 0x00007fef46cbacab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffd22cebe0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#19 0x00007fef46cc2f20 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#20 0x00007fef4711c1bc in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1867
#21 0x00007fef4786c485 in QApplication::exec() () at kernel/qapplication.cpp:2824
#22 0x000056293a903f9b in main(int, char**) (argc=<optimized out>, argv=0x7fffd22cee68) at /usr/src/debug/kwin5-5.20.5-2.1.x86_64/main_x11.cpp:484
[Inferior 1 (process 2031) detached]

Possible duplicates by query: bug 431863, bug 431529, bug 429383, bug 426435, bug 418260.

Reported using DrKonqi
Comment 1 Nate Graham 2021-02-09 17:44:57 UTC
*** Bug 432496 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2021-02-09 17:46:01 UTC
*** Bug 432574 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2021-02-09 17:47:08 UTC
*** Bug 363499 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2021-02-09 17:47:37 UTC
*** Bug 418260 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2021-02-09 17:47:41 UTC
*** Bug 431529 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2021-02-09 17:48:02 UTC
*** Bug 431863 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2021-02-09 17:49:43 UTC
*** Bug 427636 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2021-02-09 17:50:22 UTC
Raising priority due to number of duplicates.
Comment 9 Vlad Zahorodnii 2021-02-11 14:03:08 UTC
This bug is unactionable because of lack of a reliable way to reproduce the crash.  I don't really see why kwin would crash at delete backend;
Comment 10 Lastique 2021-02-11 14:50:15 UTC
(In reply to Vlad Zahorodnii from comment #9)
> This bug is unactionable because of lack of a reliable way to reproduce the
> crash.  I don't really see why kwin would crash at delete backend;

There are various repro cases in the duplicate bugs.
Comment 11 RalphB 2021-02-11 15:10:23 UTC
My bug is very easy to reproduce (using latest NVidia driver, 4K screen):

Open Settings -> Display and Monitor -> Compositor, then set Rendering backend to OpenGL 3.1 or OpenGL 2.0.  Immediate crash.
Comment 12 Alexander 2021-02-11 15:21:47 UTC
My bug is very easy to reproduce:

1. Open Settings -> Display and Monitor -> Compositor, then set Rendering backend to OpenGL 3.1 or OpenGL 2.0.
2. Enable checkbox "Enable compositor on startup"
2. Apply
3.Reboot system
4.Login in kde.
5.Wait 1-10 minutes
6.BUG
Comment 13 bluescreenavenger 2021-02-13 23:39:42 UTC
I get a near instant crash in the DRM backend on QEMU's QXL card. This is my 32 bit build though...
Comment 14 Alexander 2021-02-16 16:15:52 UTC
Looks like I solved this problem:
1. End kde session (if running).
2. You need to remove ~/.config/kwinrc
3. Log in to kde.
4. Everything kwin no longer crashes
(This is works for me)
Comment 15 Nico 2021-02-16 17:34:42 UTC
Created attachment 135728 [details]
attachment-32390-0.html

I believe that removing ~/.config/kwinrc only deletes the KDE configuration.
The file gets recreated as soon as i create any desktop effects or add a
virtual desktop, etc...
But i will see if it makes any difference.
Worth a try.
________________________________
From: Alexander <bugzilla_noreply@kde.org>
Sent: Tuesday, February 16, 2021 5:15 PM
To: freenico2020@hotmail.com <freenico2020@hotmail.com>
Subject: [kwin] [Bug 432570] kwin_x11 crash randomly in KWin::SceneOpenGL::createScene()

https://bugs.kde.org/show_bug.cgi?id=432570

--- Comment #14 from Alexander <oberkut@gmail.com> ---
Looks like I solved this problem:
1. End kde session (if running).
2. You need to remove ~/.config/kwinrc
3. Log in to kde.
4. Everything kwin no longer crashes
(This is works for me)

--
You are receiving this mail because:
You are on the CC list for the bug.
Comment 16 RalphB 2021-02-16 17:37:29 UTC
Confirmed!  Alexander, you're a genius!
Comment 17 Nico 2021-02-16 20:40:19 UTC
Created attachment 135736 [details]
attachment-9948-0.html

No dice!
After deleting ~/.config/kwinrc i noticed that it was recreated as soon as i added another virtual desktop and, about 1hr after (not even editing videos or watching movies) system crashed.
System crashes are not seen both with OpenGL and Xrender (whereas, Xrender was avoiding these up to kernel 5.10.11).
Still dancing the Slack prayer dance for a kernel fix
________________________________
From: RalphB <bugzilla_noreply@kde.org>
Sent: Tuesday, February 16, 2021 6:37 PM
To: freenico2020@hotmail.com <freenico2020@hotmail.com>
Subject: [kwin] [Bug 432570] kwin_x11 crash randomly in KWin::SceneOpenGL::createScene()

https://bugs.kde.org/show_bug.cgi?id=432570

--- Comment #16 from RalphB <pub@endlos.net> ---
Confirmed!  Alexander, you're a genius!

--
You are receiving this mail because:
You are on the CC list for the bug.
Comment 18 RalphB 2021-02-16 20:59:34 UTC
Nico, you need to stop your graphical session before deleting the file, or at least reboot after deleting and before re-creating it.
Comment 19 bluescreenavenger 2021-04-11 15:57:27 UTC
is 432574 really a duplicate of this?
432574 happens on startup on virtual hardware, unless I pass LIBGL_ALWAYS_SOFTWARE
the crash is not random
Comment 20 bluescreenavenger 2021-04-28 22:05:58 UTC
*** Bug 432574 has been marked as a duplicate of this bug. ***
Comment 21 Nate Graham 2021-05-03 20:03:48 UTC
*** Bug 436495 has been marked as a duplicate of this bug. ***
Comment 22 Miguel 2021-09-21 14:41:03 UTC
Created attachment 141768 [details]
New crash information added by DrKonqi

kwin_x11 (5.20.5) using Qt 5.15.2

- What I was doing when the application crashed:

I removed an USB DAC and the crash happened suddenly.

-- Backtrace (Reduced):
#5  0x00007f2614134eae in KWin::SceneOpenGL::createScene (parent=parent@entry=0x7f2610005710) at ./plugins/scenes/opengl/scene_opengl.cpp:454
#6  0x00007f2614135789 in KWin::OpenGLFactory::create (this=<optimized out>, parent=0x7f2610005710) at ./plugins/scenes/opengl/scene_opengl.cpp:2757
#7  0x00007f261f98cbb1 in KWin::Compositor::setupStart (this=0x7f2610005710) at ./composite.cpp:246
#8  0x00007f261f98d963 in KWin::X11Compositor::start (this=0x7f2610005710) at ./composite.cpp:961
#9  0x00007f261f98b7f5 in KWin::Compositor::reinitialize (this=0x7f2610005710) at ./composite.cpp:525
Comment 23 Vlad Zahorodnii 2022-01-19 19:24:15 UTC
There was a bug in createScene() with regards to the ownership of the render backend, which was fixed a release or so ago. Please reopen this bug report if the crash is still present.
Comment 24 Mathias Panzenböck 2022-02-27 21:31:44 UTC
Created attachment 147176 [details]
New crash information added by DrKonqi

kwin_x11 (5.20.5) using Qt 5.15.2

- What I was doing when the application crashed:
I watched a YouTube video in Firefox.

- Unusual behavior I noticed:
Image froze, no keyboard inputs registered anymore, but audio continued. I switched to a text terminal and back (Ctrl+Alt+F2 then Ctrl+Alt+F1) at which point kwin crashed, restarted and the UI was useable again, though compositing was deactivated.

-- Backtrace (Reduced):
#5  0x00007f559ed1b564 in KWin::SceneOpenGL::createScene(QObject*) () at /usr/lib64/qt5/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#6  0x00007f559ed2a41d in KWin::OpenGLFactory::create(QObject*) const () at /usr/lib64/qt5/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#8  0x00007f55bd11903e in KWin::X11Compositor::start() () at /lib64/libkwin.so.5
#9  0x00007f55bd116e57 in KWin::Compositor::reinitialize() () at /lib64/libkwin.so.5
#10 0x00007f55bbde3386 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5
Comment 25 Mathias Panzenböck 2022-03-19 02:12:33 UTC
Created attachment 147588 [details]
New crash information added by DrKonqi

kwin_x11 (5.20.5) using Qt 5.15.2

- What I was doing when the application crashed:

I was watching a video on Amazon Prime in Firefox in fullscreen (screen is 1920x1080, video is lower resolution because Amazon doesn't give us full HD under Linux). Was watching for about 47 minutes already when the issue occured. First the screen froze, then it went out of fullscreen and the video resumed, but kwin restarted without composite.

-- Backtrace (Reduced):
#5  0x00007fca20275564 in KWin::SceneOpenGL::createScene(QObject*) () at /usr/lib64/qt5/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#6  0x00007fca2028441d in KWin::OpenGLFactory::create(QObject*) const () at /usr/lib64/qt5/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#8  0x00007fca37db703e in KWin::X11Compositor::start() () at /lib64/libkwin.so.5
#9  0x00007fca37db4e57 in KWin::Compositor::reinitialize() () at /lib64/libkwin.so.5
#10 0x00007fca36a81386 in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt5Core.so.5