Created attachment 113814 [details] gdb backtrace - What I was doing when the application crashed: Every time after resume from screen energy saving mode, plasma is wither non-responsive or just turns on the backlight of monitors without picture showing. Reproducible: Always Steps to Reproduce: 1. From System settings-> power management, set the "Screen energy saving" to 10 mins 2. Leave the screen to go blank and wait around 10 more mins (sometimes more) 3. Move the mouse so screen gets back There are two related bugs reported https://bugs.kde.org/show_bug.cgi?id=364526 https://bugs.kde.org/show_bug.cgi?id=348487
Not convinced the other two are related. Backtrace makes total sense, drmPageFlip/drmHandleEvent is effectively async and our user_data pointer we supply (the DrmOuptut) can get deleted. We can try to make sure we never delete the output when we have a pending flip. Alternatively I once did a clever trick in kwayland of putting a QPointer on the heap and using that as our user data. Kinda safer, kinda just avoiding the problem.
Holding the Output till the pageFlip returned sounds like the more robust solution to me.
One could also hand over a pointer to a struct referencing DrmBackend* backend and DrmOutput* output. Then check if output is still in backend->outputs().
is this connected? https://bugs.kde.org/show_bug.cgi?id=385743
>385743 it is not, sorry.
Git commit a362a67989f1cea4606f9a564d9a51144a51c719 by David Edmundson. Committed on 19/07/2018 at 08:41. Pushed by davidedmundson into branch 'Plasma/5.13'. Don't remove outputs during page flip Summary: To do so leaves a dangling pointer on our pageFlipHandler Test Plan: Wobbled a window whilst plugging a monitor in and out Reviewers: #kwin, graesslin Reviewed By: #kwin, graesslin Subscribers: anthonyfieroni, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D14210 M +1 -1 plugins/platforms/drm/drm_backend.cpp M +17 -0 plugins/platforms/drm/drm_output.cpp M +6 -1 plugins/platforms/drm/drm_output.h https://commits.kde.org/kwin/a362a67989f1cea4606f9a564d9a51144a51c719
Git commit 9f2f6d96577dd4aba878e53259e20bde72d752d1 by David Edmundson. Committed on 18/07/2018 at 15:05. Pushed by davidedmundson into branch 'master'. Don't remove outputs during page flip Summary: To do so leaves a dangling pointer on our pageFlipHandler Test Plan: Wobbled a window whilst plugging a monitor in and out Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D14210 M +1 -1 plugins/platforms/drm/drm_backend.cpp M +17 -0 plugins/platforms/drm/drm_output.cpp M +6 -1 plugins/platforms/drm/drm_output.h https://commits.kde.org/kwin/9f2f6d96577dd4aba878e53259e20bde72d752d1