Bug 381870 - Freeze in KWin::checkGLError on startup
Summary: Freeze in KWin::checkGLError on startup
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: scene-opengl (show other bugs)
Version: 5.10.3
Platform: Neon Linux
: VHI critical
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: drkonqi
: 381767 381834 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-07-01 16:22 UTC by alex
Modified: 2017-07-11 20:24 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.10.3.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alex 2017-07-01 16:22:53 UTC
Application: kwin_x11 (5.10.3)

Qt Version: 5.9.0
Frameworks Version: 5.35.0
Operating System: Linux 4.8.0-58-generic x86_64
Distribution: KDE neon User Edition 5.10

-- Information about the crash:
- What I was doing when the application crashed:

I'm just clicking mouse right button.
I saw this bug in 5.8, 5.9 KDE Plasma. And now in 5.10.3

The crash can be reproduced sometimes.

-- Backtrace:
Application: KWin (kwin_x11), signal: Aborted
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
[Current thread is 1 (Thread 0x7f1b18351900 (LWP 11908))]

Thread 6 (Thread 0x7f1a64c56700 (LWP 15135)):
[KCrash Handler]
#6  0x00007f1b17d6e428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#7  0x00007f1b17d7002a in __GI_abort () at abort.c:89
#8  0x00007f1b159ff5b1 in qt_message_fatal (context=..., message=<synthetic pointer>) at global/qlogging.cpp:1690
#9  QMessageLogger::fatal (this=<optimized out>, msg=<optimized out>) at global/qlogging.cpp:796
#10 0x00007f1afae5ae23 in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/org.kde.kwin.platforms/KWinX11Platform.so
#11 0x00007f1b15c103f6 in QtPrivate::QSlotObjectBase::call (a=0x7f1a64c55820, r=0x146e300, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:101
#12 QMetaObject::activate (sender=sender@entry=0x146e300, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7f1a64c55820) at kernel/qobject.cpp:3749
#13 0x00007f1b15c109d7 in QMetaObject::activate (sender=sender@entry=0x146e300, m=m@entry=0x7f1b15ea1700 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7f1a64c55820) at kernel/qobject.cpp:3628
#14 0x00007f1b15c897c7 in QTimer::timeout (this=this@entry=0x146e300, _t1=...) at .moc/moc_qtimer.cpp:201
#15 0x00007f1b15c1c8e8 in QTimer::timerEvent (this=0x146e300, e=<optimized out>) at kernel/qtimer.cpp:255
#16 0x00007f1b15c110c3 in QObject::event (this=0x146e300, e=<optimized out>) at kernel/qobject.cpp:1268
#17 0x00007f1b165533fc in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x146e300, e=0x7f1a64c55b10) at kernel/qapplication.cpp:3717
#18 0x00007f1b1655ae07 in QApplication::notify (this=0x7ffe9df3fae0, receiver=0x146e300, e=0x7f1a64c55b10) at kernel/qapplication.cpp:3476
#19 0x00007f1b15be4128 in QCoreApplication::notifyInternal2 (receiver=0x146e300, event=event@entry=0x7f1a64c55b10) at kernel/qcoreapplication.cpp:1018
#20 0x00007f1b15c376fe in QCoreApplication::sendEvent (event=0x7f1a64c55b10, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#21 QTimerInfoList::activateTimers (this=this@entry=0x7f1a5c000980) at kernel/qtimerinfo_unix.cpp:643
#22 0x00007f1b15c3449c in QEventDispatcherUNIXPrivate::activateTimers (this=this@entry=0x7f1a5c0008e0) at kernel/qeventdispatcher_unix.cpp:249
#23 0x00007f1b15c35692 in QEventDispatcherUNIX::processEvents (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:514
#24 0x00007f1b15be230a in QEventLoop::exec (this=this@entry=0x7f1a64c55cc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#25 0x00007f1b15a11af4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:515
#26 0x00007f1b15a16509 in QThreadPrivate::start (arg=0x1385af0) at thread/qthread_unix.cpp:368
#27 0x00007f1b11a106ba in start_thread (arg=0x7f1a64c56700) at pthread_create.c:333
#28 0x00007f1b17e403dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7f1aeb7ff700 (LWP 11917)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f1b14d8d784 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#2  0x00007f1b14d8d7c9 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#3  0x00007f1b11a106ba in start_thread (arg=0x7f1aeb7ff700) at pthread_create.c:333
#4  0x00007f1b17e403dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7f1af8d7d700 (LWP 11916)):
#0  0x00007f1b17e347d1 in __GI_ppoll (fds=fds@entry=0x7f1af0000ac8, nfds=nfds@entry=1, timeout=<optimized out>, timeout@entry=0x0, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:50
#1  0x00007f1b15c33dc1 in ppoll (__ss=<optimized out>, __timeout=<optimized out>, __nfds=<optimized out>, __fds=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/poll2.h:77
#2  qt_ppoll (timeout_ts=0x0, nfds=1, fds=0x7f1af0000ac8) at kernel/qcore_unix.cpp:81
#3  qt_safe_poll (fds=0x7f1af0000ac8, nfds=1, timeout_ts=timeout_ts@entry=0x0) at kernel/qcore_unix.cpp:102
#4  0x00007f1b15c35422 in QEventDispatcherUNIX::processEvents (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:500
#5  0x00007f1b15be230a in QEventLoop::exec (this=this@entry=0x7f1af8d7cca0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#6  0x00007f1b15a11af4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:515
#7  0x00007f1b10b04075 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#8  0x00007f1b15a16509 in QThreadPrivate::start (arg=0x106ab30) at thread/qthread_unix.cpp:368
#9  0x00007f1b11a106ba in start_thread (arg=0x7f1af8d7d700) at pthread_create.c:333
#10 0x00007f1b17e403dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7f1afb880700 (LWP 11912)):
#0  0x00007f1b17e347d1 in __GI_ppoll (fds=fds@entry=0x7f1af400ee28, nfds=nfds@entry=1, timeout=<optimized out>, timeout@entry=0x0, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:50
#1  0x00007f1b15c33dc1 in ppoll (__ss=<optimized out>, __timeout=<optimized out>, __nfds=<optimized out>, __fds=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/poll2.h:77
#2  qt_ppoll (timeout_ts=0x0, nfds=1, fds=0x7f1af400ee28) at kernel/qcore_unix.cpp:81
#3  qt_safe_poll (fds=0x7f1af400ee28, nfds=1, timeout_ts=timeout_ts@entry=0x0) at kernel/qcore_unix.cpp:102
#4  0x00007f1b15c35422 in QEventDispatcherUNIX::processEvents (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:500
#5  0x00007f1b15be230a in QEventLoop::exec (this=this@entry=0x7f1afb87fc90, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#6  0x00007f1b15a11af4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:515
#7  0x00007f1b1846eb75 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#8  0x00007f1b15a16509 in QThreadPrivate::start (arg=0x7f1b184e4da0) at thread/qthread_unix.cpp:368
#9  0x00007f1b11a106ba in start_thread (arg=0x7f1afb880700) at pthread_create.c:333
#10 0x00007f1b17e403dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7f1b016e8700 (LWP 11910)):
#0  0x00007f1b17e3470d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f1b16f4ac62 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f1b16f4c8d7 in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f1b027e41f9 in QXcbEventReader::run (this=0xf44e00) at qxcbconnection.cpp:1322
#4  0x00007f1b15a16509 in QThreadPrivate::start (arg=0xf44e00) at thread/qthread_unix.cpp:368
#5  0x00007f1b11a106ba in start_thread (arg=0x7f1b016e8700) at pthread_create.c:333
#6  0x00007f1b17e403dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f1b18351900 (LWP 11908)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f1a675e6475 in ?? () from /usr/lib/nvidia-375/libGLX_nvidia.so.0
#2  0x00007f1a675e6173 in ?? () from /usr/lib/nvidia-375/libGLX_nvidia.so.0
#3  0x00007f1a666a1a6b in ?? () from /usr/lib/nvidia-375/libnvidia-glcore.so.375.66
#4  0x00007f1a6659b2b1 in ?? () from /usr/lib/nvidia-375/libnvidia-glcore.so.375.66
#5  0x00007f1a6622cdb4 in ?? () from /usr/lib/nvidia-375/libnvidia-glcore.so.375.66
#6  0x00007f1b115b3321 in KWin::checkGLError(char const*) () from /usr/lib/x86_64-linux-gnu/libkwinglutils.so.11
#7  0x00007f1b179b9920 in ?? () from /usr/lib/x86_64-linux-gnu/libkwin.so.5
#8  0x00007f1b179b9d26 in KWin::SceneOpenGL::createScene(QObject*) () from /usr/lib/x86_64-linux-gnu/libkwin.so.5
#9  0x00007f1b179911ff in KWin::Compositor::slotCompositingOptionsInitialized() () from /usr/lib/x86_64-linux-gnu/libkwin.so.5
#10 0x00007f1b17991be0 in KWin::Compositor::setup() () from /usr/lib/x86_64-linux-gnu/libkwin.so.5
#11 0x00007f1b15c11109 in QObject::event (this=0x10129d0, e=<optimized out>) at kernel/qobject.cpp:1246
#12 0x00007f1b165533fc in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x10129d0, e=0x1393d90) at kernel/qapplication.cpp:3717
#13 0x00007f1b1655ae07 in QApplication::notify (this=0x7ffe9df3fae0, receiver=0x10129d0, e=0x1393d90) at kernel/qapplication.cpp:3476
#14 0x00007f1b15be4128 in QCoreApplication::notifyInternal2 (receiver=0x10129d0, event=event@entry=0x1393d90) at kernel/qcoreapplication.cpp:1018
#15 0x00007f1b15be662b in QCoreApplication::sendEvent (event=0x1393d90, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#16 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0xf1bae0) at kernel/qcoreapplication.cpp:1678
#17 0x00007f1b15c35247 in QEventDispatcherUNIX::processEvents (this=0xf73e70, flags=flags@entry=...) at kernel/qeventdispatcher_unix.cpp:466
#18 0x00007f1b02842e0d in QUnixEventDispatcherQPA::processEvents (this=<optimized out>, flags=...) at qunixeventdispatcher.cpp:68
#19 0x00007f1b15be230a in QEventLoop::exec (this=this@entry=0x7ffe9df3f9c0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#20 0x00007f1b15beadb4 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1291
#21 0x00007f1b18112174 in kdemain () from /usr/lib/x86_64-linux-gnu/libkdeinit5_kwin_x11.so
#22 0x00007f1b17d59830 in __libc_start_main (main=0x400710, argc=3, argv=0x7ffe9df3fc78, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe9df3fc68) at ../csu/libc-start.c:291
#23 0x0000000000400749 in _start ()

The reporter indicates this bug may be a duplicate of or related to bug 355096.

Possible duplicates by query: bug 381767, bug 377996, bug 374422, bug 368847, bug 364721.

Reported using DrKonqi
Comment 1 Martin Flöser 2017-07-01 16:34:37 UTC

*** This bug has been marked as a duplicate of bug 381767 ***
Comment 2 Martin Flöser 2017-07-03 15:45:27 UTC
Git commit aefb5f4dd9d41aa7377d56ece203089c73aefe07 by Martin Gräßlin.
Committed on 01/07/2017 at 17:28.
Pushed by graesslin into branch 'Plasma/5.10'.

Prevent endless loop in checkGLError due to GL_CONTEXT_LOST

Summary:
The GL_CONTEXT_LOST flag is not reset when calling glGetError. This of
course bites with: "Thus, glGetError should always be called in a loop,
until it returns GL_NO_ERROR, if all error flags are to be reset."
(see https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetError.xhtml)

As KWin calls checkGLError from init call it can result in a freeze of
KWin. This is a regression reported multiple times since the release of
5.10.3 which enabled GLX_NV_robustness_video_memory_purge extension.

Please note that I am not able to test this change. I do not have an
NVIDIA card and are not hiting the problem. I have no way to simulate
the code. I do not know whether the change will fix the problem, it is
based on what others do. Inspiration for this change is mostly from
mutter: https://git.gnome.org/browse/mutter/commit/?id=d4d2bf0f6c1737256b921c4f1dedd3a95138cab9
FIXED-IN: 5.10.3.1

Test Plan: See above, I can only compile check the change

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6464

M  +8    -0    libkwineffects/kwinglutils.cpp

https://commits.kde.org/kwin/aefb5f4dd9d41aa7377d56ece203089c73aefe07
Comment 3 Martin Flöser 2017-07-03 15:58:07 UTC
*** Bug 381767 has been marked as a duplicate of this bug. ***
Comment 4 Martin Flöser 2017-07-04 04:28:32 UTC
*** Bug 381834 has been marked as a duplicate of this bug. ***