Bug 469908

Summary: Kwin crashes in std::default_delete<KWin::EffectWindowImpl> on applying rules
Product: [Plasma] kwin Reporter: Holger <private_lock>
Component: rulesAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: crash CC: hans.tovetjarn, isma.af, nate, plasma-bugs
Priority: NOR    
Version: 5.27.4   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screenshot of rules
stacktrace of the crash
New crash information added by DrKonqi

Description Holger 2023-05-17 18:57:49 UTC
Created attachment 159042 [details]
Screenshot of rules

SUMMARY

I want my Firefox maximized in both directions and without decorations.

STEPS TO REPRODUCE
1. Create window rule for Firefox as in the screenshot
2. Open Firefox: no decorations, but maximized is not enforced properly
3. Open rule definition, e.g. toggle "decorations enforced to no"
4. Hit apply

OBSERVED RESULT
Kwin crashes and some different window is on top. The Panels and window decorations for other windows reload and you are on desktop one. The Settings-dialog is gone.

EXPECTED RESULT
don't crash

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 23.04
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.2.0-20-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4600
Manufacturer: Micro-Star International Co., Ltd.
Product Name: GE70 2OC\2OD\2OE
System Version: REV:1.0

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-05-17 19:10:12 UTC
If something crashed, we need a backtrace of it so we can figure out what's going on. Can you please attach a backtrace of the crash using the coredumpctl command-line program, as detailed in https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl?

Thanks!
Comment 2 Holger 2023-05-20 19:28:27 UTC
Created attachment 159147 [details]
stacktrace of the crash

Thanks for the link - that was helpful, though it downloaded 720 GB of debug symbols.

In addition, I found, I can also crash KWin by forcing a negative (x,y) position, e.g. to "hide" the window decoration by moving them out over the upper left corner off the screen. The setting is stored, but the dialog became invisible - likely it is shifted far off outside the screen and I cannot see it anymore (other than that it darkens the parent and blocks all input) - luckily I could close it by Escape.

A position, that will shift some of the dialog out to the lower right is fine though. Only the upper left corner must stay on screen, while moving a window manually off screen by META+LMB-drag works nicely.
Comment 3 Nate Graham 2023-05-22 18:00:14 UTC
> 720 GB of debug symbols
Wow, I really hope there's a typo there!

Regardless, pasting the backtrace inline for searchability:

(gdb) bt
#0  __GI___pthread_sigmask (how=1, newmask=<optimized out>, oldmask=0x0) at ./nptl/pthread_sigmask.c:43
#1  0x00007f6ef463c6ad in __GI___sigprocmask (how=<optimized out>, set=<optimized out>, oset=<optimized out>) at ../sysdeps/unix/sysv/linux/sigprocmask.c:25
#2  0x00007f6ef786afcf in KCrash::setCrashHandler (handler=handler@entry=0x0) at ./src/kcrash.cpp:414
#3  0x00007f6ef786d4fb in KCrash::defaultCrashHandler (sig=11) at ./src/kcrash.cpp:625
#4  <signal handler called>
#5  0x00007f6ef74eb1b5 in std::default_delete<KWin::EffectWindowImpl>::operator() (__ptr=0x5579ee610f50, this=<optimized out>) at /usr/include/c++/12/bits/unique_ptr.h:89
#6  std::__uniq_ptr_impl<KWin::EffectWindowImpl, std::default_delete<KWin::EffectWindowImpl> >::reset (__p=0x0, this=0x5579eed26b78) at /usr/include/c++/12/bits/unique_ptr.h:203
#7  std::unique_ptr<KWin::EffectWindowImpl, std::default_delete<KWin::EffectWindowImpl> >::reset (__p=0x0, this=0x5579eed26b78) at /usr/include/c++/12/bits/unique_ptr.h:501
#8  KWin::Window::finishCompositing (this=0x5579eed26a50, releaseReason=<optimized out>) at /usr/src/kwin-4:5.27.4-0ubuntu1/src/window.cpp:370
#9  0x00007f6ef73bf7c5 in KWin::X11Window::finishCompositing (releaseReason=KWin::ReleaseReason::Release, this=0x5579eed26a50) at /usr/src/kwin-4:5.27.4-0ubuntu1/src/x11window.cpp:1491
#10 KWin::Compositor::stop (this=0x5579ee345990) at /usr/src/kwin-4:5.27.4-0ubuntu1/src/composite.cpp:523
#11 KWin::Compositor::stop (this=0x5579ee345990) at /usr/src/kwin-4:5.27.4-0ubuntu1/src/composite.cpp:505
#12 0x00007f6ef73b83e7 in KWin::Compositor::reinitialize (this=0x5579ee345990) at /usr/src/kwin-4:5.27.4-0ubuntu1/src/composite.cpp:628
#13 0x00007f6ef5af39af in QtPrivate::QSlotObjectBase::call (a=0x7ffc24235170, r=0x5579ee345990, this=0x5579ee547830) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#14 doActivate<false> (sender=0x5579ee2cc850, signal_index=61, argv=0x7ffc24235170) at kernel/qobject.cpp:3923
#15 0x00007f6ef750a812 in KWin::Workspace::slotReconfigure (this=0x5579ee4a2340) at /usr/src/kwin-4:5.27.4-0ubuntu1/src/workspace.cpp:1017
#16 0x00007f6ef5af39af in QtPrivate::QSlotObjectBase::call (a=0x7ffc24235310, r=0x5579ee4a2340, this=0x5579ee77e360) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#17 doActivate<false> (sender=0x5579ee4a2480, signal_index=3, argv=0x7ffc24235310) at kernel/qobject.cpp:3923
#18 0x00007f6ef5aeca47 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f6ef5d5a2e0 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffc24235310) at kernel/qobject.cpp:3983
#19 0x00007f6ef5af798e in QTimer::timeout (this=<optimized out>, _t1=...) at .moc/moc_qtimer.cpp:205
#20 0x00007f6ef5ae7bf5 in QObject::event (this=0x5579ee4a2480, e=0x7ffc24235460) at kernel/qobject.cpp:1369
#21 0x00007f6ef4f6bf92 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5579ee4a2480, e=0x7ffc24235460) at kernel/qapplication.cpp:3640
#22 0x00007f6ef5abae38 in QCoreApplication::notifyInternal2 (receiver=0x5579ee4a2480, event=0x7ffc24235460) at kernel/qcoreapplication.cpp:1064
#23 0x00007f6ef5abb012 in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#24 0x00007f6ef5b14201 in QTimerInfoList::activateTimers (this=0x5579ee0da480) at kernel/qtimerinfo_unix.cpp:643
#25 0x00007f6ef5b14aec in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:183
#26 0x00007f6ef326149d in g_main_dispatch (context=0x7f6ee8000ee0) at ../../../glib/gmain.c:3460
#27 g_main_context_dispatch (context=0x7f6ee8000ee0) at ../../../glib/gmain.c:4200
#28 0x00007f6ef32bc178 in g_main_context_iterate.constprop.0 (context=0x7f6ee8000ee0, block=<optimized out>, dispatch=1, self=<optimized out>) at ../../../glib/gmain.c:4276
#29 0x00007f6ef32601b0 in g_main_context_iteration (context=0x7f6ee8000ee0, may_block=1) at ../../../glib/gmain.c:4343
#30 0x00007f6ef5b14e7a in QEventDispatcherGlib::processEvents (this=0x5579ee0d9c90, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#31 0x00007f6ef5ab97cb in QEventLoop::exec (this=this@entry=0x7ffc242356a0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#32 0x00007f6ef5ac1c1a in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#33 0x00007f6ef5f35db0 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1863
#34 0x00007f6ef4f6bf09 in QApplication::exec () at kernel/qapplication.cpp:2832
#35 0x00005579ec924b65 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/kwin-4:5.27.4-0ubuntu1/src/main_x11.cpp:447
(gdb)
Comment 4 Holger 2023-05-23 22:02:59 UTC
Hihi ... you're right - my harddrive is not that big, it has to be 720 MiB not GB ;-)
Comment 5 Vlad Zahorodnii 2023-05-26 10:19:45 UTC

*** This bug has been marked as a duplicate of bug 466380 ***
Comment 6 totte 2024-02-12 10:23:27 UTC
Created attachment 165769 [details]
New crash information added by DrKonqi

kwin_x11 (5.27.10) using Qt 5.15.12

Applying Window Rules where I match window classes and force position to specific activities causes KWin to crash (twice, seemingly – two notifications are displayed).

-- Backtrace (Reduced):
#6  0x00007f511c8f0235 in std::default_delete<KWin::EffectWindowImpl>::operator()(KWin::EffectWindowImpl*) const (__ptr=0x559c7264b4a0, this=<optimized out>) at /usr/include/c++/13/bits/unique_ptr.h:99
#7  std::__uniq_ptr_impl<KWin::EffectWindowImpl, std::default_delete<KWin::EffectWindowImpl> >::reset(KWin::EffectWindowImpl*) (__p=0x0, this=0x559c731bcf38) at /usr/include/c++/13/bits/unique_ptr.h:211
#8  std::unique_ptr<KWin::EffectWindowImpl, std::default_delete<KWin::EffectWindowImpl> >::reset(KWin::EffectWindowImpl*) (__p=0x0, this=0x559c731bcf38) at /usr/include/c++/13/bits/unique_ptr.h:509
#9  KWin::Window::finishCompositing(KWin::ReleaseReason) (this=0x559c731bce10, releaseReason=<optimized out>) at /usr/src/debug/kwin-5.27.10/src/window.cpp:370
#10 0x00007f511c7c6b75 in KWin::X11Window::finishCompositing(KWin::ReleaseReason) (releaseReason=KWin::ReleaseReason::Release, this=0x559c731bce10) at /usr/src/debug/kwin-5.27.10/src/x11window.cpp:1491