Bug 495670

Summary: Secondary Monitor causing KWin to assert in std::unique_ptr<KWin::DrmAtomicCommit> on connection/power on
Product: [Plasma] kwin Reporter: rob.tilbury
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: nate, xaver.hugl
Priority: NOR Keywords: drkonqi, multiscreen
Version: 6.2.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.2.3
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description rob.tilbury 2024-11-01 05:04:23 UTC
Application: kwin_wayland (6.2.2)

ApplicationNotResponding [ANR]: false
Qt Version: 6.7.2
Frameworks Version: 6.7.0
Operating System: Linux 6.11.5-200.fsync.fc40.x86_64 x86_64
Windowing System: Wayland
Distribution: Nobara Linux 40 (KDE Plasma)
DrKonqi: 6.2.2 [CoredumpBackend]

-- Information about the crash:
Steps to Reproduce:
1. Boot Computer
If secondary monitor is on, often login screen will not show, only black screen, can change to another terminal window to reboot, login screen shows fine if secondary monitor is off
2: Login without secondary monitor powered on - main screen will show fine, can login and desktop will load correctly. If second monitor then powered on, kwin will crash but recovers - appears to close all open windows e.g. steam, firefox - they both crash but can then be started again (steam will usually need some of its processes terminated from System Monitor

The crash can be reproduced every time.

-- Backtrace (Reduced):
#5  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#6  0x00007fc5e88a86d3 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#7  0x00007fc5e884fc4e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007fc5e8837902 in __GI_abort () at abort.c:79
#9  0x00007fc5e8adabf0 in std::__glibcxx_assert_fail (file=file@entry=0x7fc5ec21d198 "/usr/include/c++/14/bits/stl_vector.h", line=line@entry=1213, function=function@entry=0x7fc5ec224cf8 "constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::front() [with _Tp = std::unique_ptr<KWin::DrmAtomicCommit>; _Alloc = std::allocator<std::unique_ptr<KWin::DrmAtomicCommit> >; re"..., condition=condition@entry=0x7fc5ec2556f4 "!this->empty()") at ../../../../../libstdc++-v3/src/c++11/assert_fail.cc:41


Reported using DrKonqi
Comment 1 rob.tilbury 2024-11-01 05:04:25 UTC
Created attachment 175433 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 Nate Graham 2024-11-01 15:15:35 UTC
Thread 1 (Thread 0x7fc5bca006c0 (LWP 2651)):
[KCrash Handler]
#5  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#6  0x00007fc5e88a86d3 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
#7  0x00007fc5e884fc4e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007fc5e8837902 in __GI_abort () at abort.c:79
#9  0x00007fc5e8adabf0 in std::__glibcxx_assert_fail (file=file@entry=0x7fc5ec21d198 "/usr/include/c++/14/bits/stl_vector.h", line=line@entry=1213, function=function@entry=0x7fc5ec224cf8 "constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::front() [with _Tp = std::unique_ptr<KWin::DrmAtomicCommit>; _Alloc = std::allocator<std::unique_ptr<KWin::DrmAtomicCommit> >; re"..., condition=condition@entry=0x7fc5ec2556f4 "!this->empty()") at ../../../../../libstdc++-v3/src/c++11/assert_fail.cc:41
#10 0x00007fc5ec035a0e in std::vector<std::unique_ptr<KWin::DrmAtomicCommit, std::default_delete<KWin::DrmAtomicCommit> >, std::allocator<std::unique_ptr<KWin::DrmAtomicCommit, std::default_delete<KWin::DrmAtomicCommit> > > >::front (this=<optimized out>) at /usr/include/c++/14/bits/stl_vector.h:1211
#11 std::vector<std::unique_ptr<KWin::DrmAtomicCommit, std::default_delete<KWin::DrmAtomicCommit> >, std::allocator<std::unique_ptr<KWin::DrmAtomicCommit, std::default_delete<KWin::DrmAtomicCommit> > > >::front (this=<optimized out>) at /usr/include/c++/14/bits/stl_vector.h:1211
#12 KWin::DrmCommitThread::submit (this=0x559dd9a6eea0) at /usr/src/debug/kwin-6.2.2-1.fc40.x86_64/src/backends/drm/drm_commit_thread.cpp:110
#13 0x00007fc5ec0389e0 in operator() (__closure=0x559dda8760e8) at /usr/src/debug/kwin-6.2.2-1.fc40.x86_64/src/backends/drm/drm_commit_thread.cpp:101
#14 std::__invoke_impl<void, KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> > (__f=...) at /usr/include/c++/14/bits/invoke.h:61
#15 std::__invoke<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> > (__fn=...) at /usr/include/c++/14/bits/invoke.h:96
#16 std::invoke<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> > (__fn=...) at /usr/include/c++/14/functional:120
#17 operator()<> (__closure=0x559dda8760e8) at /usr/include/qt6/QtCore/qthread.h:125
#18 std::__invoke_impl<void, QThread::create<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> >(KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()>&&)::<lambda(auto:48&& ...)> > (__f=...) at /usr/include/c++/14/bits/invoke.h:61
#19 std::__invoke<QThread::create<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> >(KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()>&&)::<lambda(auto:48&& ...)> > (__fn=...) at /usr/include/c++/14/bits/invoke.h:96
#20 std::thread::_Invoker<std::tuple<QThread::create<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> >(KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()>&&)::<lambda(auto:48&& ...)> > >::_M_invoke<0> (this=0x559dda8760e8) at /usr/include/c++/14/bits/std_thread.h:301
#21 std::thread::_Invoker<std::tuple<QThread::create<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> >(KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()>&&)::<lambda(auto:48&& ...)> > >::operator() (this=0x559dda8760e8) at /usr/include/c++/14/bits/std_thread.h:308
#22 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<QThread::create<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> >(KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()>&&)::<lambda(auto:48&& ...)> > >, void>::operator() (this=<optimized out>) at /usr/include/c++/14/future:1439
#23 std::__invoke_impl<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<QThread::create<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> >(KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()>&&)::<lambda(auto:48&& ...)> > >, void>&> (__f=...) at /usr/include/c++/14/bits/invoke.h:61
#24 std::__invoke_r<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<QThread::create<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> >(KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()>&&)::<lambda(auto:48&& ...)> > >, void>&> (__fn=...) at /usr/include/c++/14/bits/invoke.h:114
#25 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>(), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<QThread::create<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> >(KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()>&&)::<lambda(auto:48&& ...)> > >, void> >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/14/bits/std_function.h:291
#26 0x00007fc5ec032b46 in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()>::operator() (this=<optimized out>) at /usr/include/c++/14/bits/std_function.h:591
#27 std::__future_base::_State_baseV2::_M_do_set (this=0x559dda8760c0, __f=<optimized out>, __did_set=0x7fc5bc9ff957) at /usr/include/c++/14/future:596
#28 0x00007fc5e88aba4b in __pthread_once_slow (once_control=0x559dda8760d8, init_routine=0x7fc5e8ae5f60 <std::__once_proxy()>) at pthread_once.c:116
#29 0x00007fc5e88abab9 in ___pthread_once (once_control=<optimized out>, init_routine=<optimized out>) at pthread_once.c:143
#30 0x00007fc5ec0337af in __gthread_once (__once=0x559dda8760d8, __func=<optimized out>) at /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h:713
#31 std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()>*, bool*> (__once=..., __f=@0x7fc5bc9ff970: (void (std::__future_base::_State_baseV2::*)(class std::__future_base::_State_baseV2 * const, class std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()> *, bool *)) 0x7fc5ec032b10 <std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>) at /usr/include/c++/14/mutex:916
#32 std::__future_base::_State_baseV2::_M_set_result (this=0x559dda8760c0, __res=..., __ignore_failure=true) at /usr/include/c++/14/future:435
#33 std::__future_base::_Deferred_state<std::thread::_Invoker<std::tuple<QThread::create<KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()> >(KWin::DrmCommitThread::DrmCommitThread(KWin::DrmGpu*, const QString&)::<lambda()>&&)::<lambda(auto:48&& ...)> > >, void>::_M_complete_async(void) (this=0x559dda8760c0) at /usr/include/c++/14/future:1712
#34 0x00007fc5e90b8417 in std::__future_base::_State_baseV2::wait (this=0x559dda8760c0) at /usr/include/c++/14/future:357
#35 std::__basic_future<void>::_M_get_result (this=0x559dd9a7c3c0) at /usr/include/c++/14/future:748
#36 std::future<void>::get (this=0x559dd9a7c3c0) at /usr/include/c++/14/future:920
#37 QThreadCreateThread::run (this=0x559dd9a7c3b0) at /usr/src/debug/qt6-qtbase-6.7.2-6.fc40.x86_64/src/corelib/thread/qthread.cpp:1234
#38 0x00007fc5e915473c in operator() (__closure=<optimized out>) at /usr/src/debug/qt6-qtbase-6.7.2-6.fc40.x86_64/src/corelib/thread/qthread_unix.cpp:326
#39 (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=...) at /usr/src/debug/qt6-qtbase-6.7.2-6.fc40.x86_64/src/corelib/thread/qthread_unix.cpp:262
#40 QThreadPrivate::start (arg=0x559dd9a7c3b0) at /usr/src/debug/qt6-qtbase-6.7.2-6.fc40.x86_64/src/corelib/thread/qthread_unix.cpp:285
#41 0x00007fc5e88a66d7 in start_thread (arg=<optimized out>) at pthread_create.c:447
#42 0x00007fc5e892a60c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Comment 3 Zamundaaa 2024-11-01 18:42:52 UTC
This was already fixed with https://invent.kde.org/plasma/kwin/-/commit/7f4e1ca15ba94aded3ea08a43fddf050c9a32d62, for 6.2.3