Bug 419625 - System settings crashed when playing with Display configuration in QQuickWindow::MouseGrabbItem
Summary: System settings crashed when playing with Display configuration in QQuickWin...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_kscreen (show other bugs)
Version: 5.18.4
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords: drkonqi
: 411794 412367 416991 417410 420331 425927 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-04-04 10:29 UTC by Sebastian
Modified: 2022-02-20 13:37 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.19.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian 2020-04-04 10:29:30 UTC
Application: systemsettings5 (5.18.4)
 (Compiled from sources)
Qt Version: 5.14.1
Frameworks Version: 5.68.0
Operating System: Linux 5.4.18-gentoo x86_64
Windowing system: X11
Distribution: "Gentoo Base System release 2.7"

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

Plaing around with Display configuration but i have DisplayLink device, crash happend after DisplayLinkaManager start(throught systemctl) and after changing display layout.

-- Backtrace:
Application: System Settings (systemsettings5), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7feff1273840 (LWP 9145))]

Thread 6 (Thread 0x7fefe6ffd700 (LWP 9152)):
#0  0x00007feff440c557 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fefed176c3b in  () at /usr/lib64/dri/i965_dri.so
#2  0x00007fefed176977 in  () at /usr/lib64/dri/i965_dri.so
#3  0x00007feff4405ea7 in start_thread () at /lib64/libpthread.so.0
#4  0x00007feff5810acf in clone () at /lib64/libc.so.6

Thread 5 (Thread 0x7fefe77fe700 (LWP 9151)):
#0  0x00007feff440c557 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fefed176c3b in  () at /usr/lib64/dri/i965_dri.so
#2  0x00007fefed176977 in  () at /usr/lib64/dri/i965_dri.so
#3  0x00007feff4405ea7 in start_thread () at /lib64/libpthread.so.0
#4  0x00007feff5810acf in clone () at /lib64/libc.so.6

Thread 4 (Thread 0x7fefe7fff700 (LWP 9150)):
#0  0x00007feff440c557 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fefed176c3b in  () at /usr/lib64/dri/i965_dri.so
#2  0x00007fefed176977 in  () at /usr/lib64/dri/i965_dri.so
#3  0x00007feff4405ea7 in start_thread () at /lib64/libpthread.so.0
#4  0x00007feff5810acf in clone () at /lib64/libc.so.6

Thread 3 (Thread 0x7fefec910700 (LWP 9149)):
#0  0x00007feff440c557 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007fefed176c3b in  () at /usr/lib64/dri/i965_dri.so
#2  0x00007fefed176977 in  () at /usr/lib64/dri/i965_dri.so
#3  0x00007feff4405ea7 in start_thread () at /lib64/libpthread.so.0
#4  0x00007feff5810acf in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7fefef453700 (LWP 9148)):
#0  0x00007feff3a052e4 in g_source_ref () at /usr/lib64/libglib-2.0.so.0
#1  0x00007feff3a06cce in g_main_context_prepare () at /usr/lib64/libglib-2.0.so.0
#2  0x00007feff3a0785b in  () at /usr/lib64/libglib-2.0.so.0
#3  0x00007feff3a07a4f in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#4  0x00007feff5e3d40b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#5  0x00007feff5de4e1b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#6  0x00007feff5c0fe7e in QThread::exec() () at /usr/lib64/libQt5Core.so.5
#7  0x00007feff60dcff7 in  () at /usr/lib64/libQt5DBus.so.5
#8  0x00007feff5c10f48 in  () at /usr/lib64/libQt5Core.so.5
#9  0x00007feff4405ea7 in start_thread () at /lib64/libpthread.so.0
#10 0x00007feff5810acf in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7feff1273840 (LWP 9145)):
[KCrash Handler]
#6  0x00007feff51be241 in QQuickWindow::mouseGrabberItem() const () at /usr/lib64/libQt5Quick.so.5
#7  0x00007feff51c09ca in QQuickWindowPrivate::removeGrabber(QQuickItem*, bool, bool) () at /usr/lib64/libQt5Quick.so.5
#8  0x00007feff51a942f in QQuickItemPrivate::derefWindow() () at /usr/lib64/libQt5Quick.so.5
#9  0x00007feff51aacee in QQuickItem::~QQuickItem() () at /usr/lib64/libQt5Quick.so.5
#10 0x00007feff51d1dbe in  () at /usr/lib64/libQt5Quick.so.5
#11 0x00007feff5e12b4f in QObject::event(QEvent*) () at /usr/lib64/libQt5Core.so.5
#12 0x00007feff51a6d73 in QQuickItem::event(QEvent*) () at /usr/lib64/libQt5Quick.so.5
#13 0x00007feff69163bf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#14 0x00007feff691de98 in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#15 0x00007feff5de6280 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#16 0x00007feff5de89c4 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib64/libQt5Core.so.5
#17 0x00007feff5e3dd73 in  () at /usr/lib64/libQt5Core.so.5
#18 0x00007feff3a0771d in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#19 0x00007feff3a079b8 in  () at /usr/lib64/libglib-2.0.so.0
#20 0x00007feff3a07a4f in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#21 0x00007feff5e3d3f0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#22 0x00007feff5de4e1b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#23 0x00007feff5decb12 in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5
#24 0x0000559d8c483684 in  ()
#25 0x00007feff573bdeb in __libc_start_main () at /lib64/libc.so.6
#26 0x0000559d8c48370a in _start ()
[Inferior 1 (process 9145) detached]

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

Possible duplicates by query: bug 417410, bug 416991, bug 413698, bug 412367, bug 411794.

Reported using DrKonqi
Comment 1 David Edmundson 2020-04-04 12:19:47 UTC
*** Bug 411794 has been marked as a duplicate of this bug. ***
Comment 2 David Edmundson 2020-04-04 12:20:12 UTC
A comment I don't want to get lost:

 Oleg Solovyov 2020-03-13 15:26:58 UTC

the problem appears when upgrading kscreen from 5.16.5 to 5.17.0

I've done further investigation and found the following:
in kcm/package/contents/ui/Output.qml:231, when I remove maskSource from OpacityMask item, the problem vanishes (tag v5.17.0)

Problem appears after commit 6309d33
Comment 3 David Edmundson 2020-04-04 12:20:31 UTC
*** Bug 416991 has been marked as a duplicate of this bug. ***
Comment 4 David Edmundson 2020-04-04 12:20:38 UTC
*** Bug 417410 has been marked as a duplicate of this bug. ***
Comment 5 David Edmundson 2020-04-04 12:20:50 UTC
*** Bug 412367 has been marked as a duplicate of this bug. ***
Comment 6 David Edmundson 2020-04-04 12:23:14 UTC
The opacity mask here is weird, the mask source is it's own parent. 
That's unusual at least.
Comment 7 David Edmundson 2020-05-01 14:11:36 UTC
*** Bug 420331 has been marked as a duplicate of this bug. ***
Comment 8 David Edmundson 2020-05-01 14:12:49 UTC
I have reliable steps to reproduce the crash:

open system settings

make a change

switch to another module

click discard in the prompt
Comment 9 David Edmundson 2020-05-02 21:53:22 UTC
Git commit cfd95e6bff4bfeadf95a7a475693b30ddfe30431 by David Edmundson.
Committed on 02/05/2020 at 21:52.
Pushed by davidedmundson into branch 'master'.

fix(kcm): avoid recursive OpacityMask which leads to teardown crash

Summary:
In the current code OpacityMask's source is the parent which contains
itself, which doesn't make sense. Docs explicitly say this. [1]

This leads to a crash in teardown.

A quick reshuffle fixes it.

[1] https://doc.qt.io/qt-5/qml-qtgraphicaleffects-opacitymask.html#source-prop

Test Plan:
Found reproducible steps (see bug)
No longer crashes

Reviewers: romangg

Reviewed By: romangg

Subscribers: romangg, plasma-devel

Tags: #plasma

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

M  +15   -11   kcm/package/contents/ui/Output.qml

https://commits.kde.org/kscreen/cfd95e6bff4bfeadf95a7a475693b30ddfe30431
Comment 10 Christoph Feck 2020-09-10 10:24:10 UTC
*** Bug 425927 has been marked as a duplicate of this bug. ***