Result of running the following in an example program where simply not having a central widget causes the activation of KCommandBar to crash the application: gdb ./build/kxmlguiwindowexample -batch -ex "set debuginfod enabled on" -ex "set logging file kxmlguiwindowlog.txt" -ex "set logging on" -ex "run" -ex "thread apply all backtrace" -ex "quit" [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7ffff11ff6c0 (LWP 1760)] [New Thread 0x7fffebfff6c0 (LWP 1765)] [New Thread 0x7fffe37fe6c0 (LWP 1766)] [New Thread 0x7fffe994d6c0 (LWP 1796)] [New Thread 0x7fffe914c6c0 (LWP 1797)] [New Thread 0x7fffe894b6c0 (LWP 1798)] [New Thread 0x7fffe3fff6c0 (LWP 1799)] [New Thread 0x7fffe2ffd6c0 (LWP 1800)] [New Thread 0x7fffe27fc6c0 (LWP 1801)] [Thread 0x7fffe27fc6c0 (LWP 1801) exited] [Thread 0x7fffe2ffd6c0 (LWP 1800) exited] Thread 1 "kxmlguiwindowex" received signal SIGSEGV, Segmentation fault. QWidget::pos (this=0x0) at kernel/qwidget.cpp:3413 3413 QPoint result = data->crect.topLeft(); Thread 8 (Thread 0x7fffe3fff6c0 (LWP 1799) "kxmlguiwin:sh2"): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x4e8218) at futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x4e8218, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87 #2 0x00007ffff509008f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x4e8218, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139 #3 0x00007ffff5092cd0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x4e81c8, cond=0x4e81f0) at pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x4e81f0, mutex=0x4e81c8) at pthread_cond_wait.c:618 #5 0x00007fffe9cbaa5b in cnd_wait (mtx=0x4e81c8, cond=0x4e81f0) at ../src/c11/impl/threads_posix.c:135 #6 util_queue_thread_func (input=input@entry=0x4e9690) at ../src/util/u_queue.c:287 #7 0x00007fffe9d03f27 in impl_thrd_routine (p=<optimized out>) at ../src/c11/impl/threads_posix.c:67 #8 0x00007ffff509398d in start_thread (arg=<optimized out>) at pthread_create.c:442 #9 0x00007ffff511a380 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 7 (Thread 0x7fffe894b6c0 (LWP 1798) "kxmlguiwin:sh1"): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x4e8218) at futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x4e8218, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87 #2 0x00007ffff509008f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x4e8218, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139 #3 0x00007ffff5092cd0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x4e81c8, cond=0x4e81f0) at pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x4e81f0, mutex=0x4e81c8) at pthread_cond_wait.c:618 #5 0x00007fffe9cbaa5b in cnd_wait (mtx=0x4e81c8, cond=0x4e81f0) at ../src/c11/impl/threads_posix.c:135 #6 util_queue_thread_func (input=input@entry=0x4e9220) at ../src/util/u_queue.c:287 #7 0x00007fffe9d03f27 in impl_thrd_routine (p=<optimized out>) at ../src/c11/impl/threads_posix.c:67 #8 0x00007ffff509398d in start_thread (arg=<optimized out>) at pthread_create.c:442 #9 0x00007ffff511a380 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 6 (Thread 0x7fffe914c6c0 (LWP 1797) "kxmlguiwin:sh0"): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x4e8218) at futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x4e8218, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87 #2 0x00007ffff509008f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x4e8218, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139 #3 0x00007ffff5092cd0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x4e81c8, cond=0x4e81f0) at pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x4e81f0, mutex=0x4e81c8) at pthread_cond_wait.c:618 #5 0x00007fffe9cbaa5b in cnd_wait (mtx=0x4e81c8, cond=0x4e81f0) at ../src/c11/impl/threads_posix.c:135 #6 util_queue_thread_func (input=input@entry=0x4e94e0) at ../src/util/u_queue.c:287 #7 0x00007fffe9d03f27 in impl_thrd_routine (p=<optimized out>) at ../src/c11/impl/threads_posix.c:67 #8 0x00007ffff509398d in start_thread (arg=<optimized out>) at pthread_create.c:442 #9 0x00007ffff511a380 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 5 (Thread 0x7fffe994d6c0 (LWP 1796) "kxmlgui:disk$0"): #0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x4e4f18) at futex-internal.c:57 #1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x4e4f18, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87 #2 0x00007ffff509008f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x4e4f18, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139 #3 0x00007ffff5092cd0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x4e4ec8, cond=0x4e4ef0) at pthread_cond_wait.c:503 #4 ___pthread_cond_wait (cond=0x4e4ef0, mutex=0x4e4ec8) at pthread_cond_wait.c:618 #5 0x00007fffe9cbaa5b in cnd_wait (mtx=0x4e4ec8, cond=0x4e4ef0) at ../src/c11/impl/threads_posix.c:135 #6 util_queue_thread_func (input=input@entry=0x4e9500) at ../src/util/u_queue.c:287 #7 0x00007fffe9d03f27 in impl_thrd_routine (p=<optimized out>) at ../src/c11/impl/threads_posix.c:67 #8 0x00007ffff509398d in start_thread (arg=<optimized out>) at pthread_create.c:442 #9 0x00007ffff511a380 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 4 (Thread 0x7fffe37fe6c0 (LWP 1766) "WaylandEventThr"): #0 0x00007ffff510bb7f in __GI___poll (fds=fds@entry=0x7fffe37fdbf0, nfds=nfds@entry=2, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007ffff3a46c56 in poll (__timeout=-1, __nfds=2, __fds=0x7fffe37fdbf0) at /usr/include/bits/poll2.h:39 #2 QtWaylandClient::EventThread::run (this=0x468500) at qwaylanddisplay.cpp:208 #3 0x00007ffff56f5e3d in QThreadPrivate::start (arg=0x468500) at thread/qthread_unix.cpp:330 #4 0x00007ffff509398d in start_thread (arg=<optimized out>) at pthread_create.c:442 #5 0x00007ffff511a380 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 3 (Thread 0x7fffebfff6c0 (LWP 1765) "WaylandEventThr"): #0 0x00007ffff510bb7f in __GI___poll (fds=fds@entry=0x7fffebffebf0, nfds=nfds@entry=2, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007ffff3a46c56 in poll (__timeout=-1, __nfds=2, __fds=0x7fffebffebf0) at /usr/include/bits/poll2.h:39 #2 QtWaylandClient::EventThread::run (this=0x46c680) at qwaylanddisplay.cpp:208 #3 0x00007ffff56f5e3d in QThreadPrivate::start (arg=0x46c680) at thread/qthread_unix.cpp:330 #4 0x00007ffff509398d in start_thread (arg=<optimized out>) at pthread_create.c:442 #5 0x00007ffff511a380 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 2 (Thread 0x7ffff11ff6c0 (LWP 1760) "QDBusConnection"): #0 0x00007ffff510bb7f in __GI___poll (fds=0x7fffec0053c0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007ffff3e6adbe in g_main_context_poll (priority=<optimized out>, n_fds=2, fds=0x7fffec0053c0, timeout=<optimized out>, context=0x7fffec001cf0) at ../glib/gmain.c:4543 #2 g_main_context_iterate (context=context@entry=0x7fffec001cf0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4233 #3 0x00007ffff3e6aedc in g_main_context_iteration (context=0x7fffec001cf0, may_block=1) at ../glib/gmain.c:4303 #4 0x00007ffff5933b56 in QEventDispatcherGlib::processEvents (this=0x7fffec000b70, flags=...) at kernel/qeventdispatcher_glib.cpp:423 #5 0x00007ffff58dab9b in QEventLoop::exec (this=this@entry=0x7ffff11febd0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69 #6 0x00007ffff56f4c47 in QThread::exec (this=this@entry=0x7ffff70aa060 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121 #7 0x00007ffff7031277 in QDBusConnectionManager::run (this=0x7ffff70aa060 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:179 #8 0x00007ffff56f5e3d in QThreadPrivate::start (arg=0x7ffff70aa060 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:330 #9 0x00007ffff509398d in start_thread (arg=<optimized out>) at pthread_create.c:442 #10 0x00007ffff511a380 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Thread 1 (Thread 0x7ffff3491e40 (LWP 1749) "kxmlguiwindowex"): #0 QWidget::pos (this=0x0) at kernel/qwidget.cpp:3413 #1 0x00007ffff7448b0d in KCommandBar::show (this=this@entry=0x7fffffffca00) at /usr/src/debug/kconfigwidgets-5.101.0/src/kcommandbar.cpp:617 #2 0x00007ffff7451ef5 in KCommandBar::setActions (this=this@entry=0x7fffffffca00, actions=...) at /usr/src/debug/kconfigwidgets-5.101.0/src/kcommandbar.cpp:607 #3 0x00007ffff7b676bb in operator() (__closure=<optimized out>) at /usr/src/debug/kxmlgui-5.101.0/src/kxmlguiwindow.cpp:103 #4 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KXmlGuiWindow::KXmlGuiWindow(QWidget*, Qt::WindowFlags)::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:146 #5 QtPrivate::Functor<KXmlGuiWindow::KXmlGuiWindow(QWidget*, Qt::WindowFlags)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:256 #6 QtPrivate::QFunctorSlotObject<KXmlGuiWindow::KXmlGuiWindow(QWidget*, Qt::WindowFlags)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:443 #7 0x00007ffff59132cd in QtPrivate::QSlotObjectBase::call (a=0x7fffffffcb50, r=0x55a730, this=0x56f450) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398 #8 doActivate<false> (sender=0x59f5f0, signal_index=4, argv=0x7fffffffcb50) at kernel/qobject.cpp:3919 #9 0x00007ffff590c74f in QMetaObject::activate (sender=sender@entry=0x59f5f0, m=m@entry=0x7ffff6ab8d20 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffcb50) at kernel/qobject.cpp:3979 #10 0x00007ffff659ebb2 in QAction::triggered (this=this@entry=0x59f5f0, _t1=<optimized out>) at .moc/moc_qaction.cpp:376 #11 0x00007ffff65a16fb in QAction::activate (this=0x59f5f0, event=<optimized out>) at kernel/qaction.cpp:1161 #12 0x00007ffff67261f2 in QMenuPrivate::activateCausedStack (this=this@entry=0x861340, causedStack=..., action=action@entry=0x59f5f0, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1384 #13 0x00007ffff672e054 in QMenuPrivate::activateAction (this=0x861340, action=0x59f5f0, action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1461 #14 0x00007ffff65e6c38 in QWidget::event (this=0x67a040, event=0x7fffffffd130) at kernel/qwidget.cpp:9043 #15 0x00007ffff65a53fe in QApplicationPrivate::notify_helper (this=this@entry=0x443240, receiver=receiver@entry=0x67a040, e=e@entry=0x7fffffffd130) at kernel/qapplication.cpp:3637 #16 0x00007ffff65ad922 in QApplication::notify (this=<optimized out>, receiver=0x67a040, e=<optimized out>) at kernel/qapplication.cpp:3081 #17 0x00007ffff58dc128 in QCoreApplication::notifyInternal2 (receiver=0x67a040, event=0x7fffffffd130) at kernel/qcoreapplication.cpp:1064 #18 0x00007ffff65aba9e in QApplicationPrivate::sendMouseEvent (receiver=0x67a040, event=event@entry=0x7fffffffd130, alienWidget=<optimized out>, nativeWidget=0x67a040, buttonDown=buttonDown@entry=0x7ffff6af0330 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2619 #19 0x00007ffff65ffea5 in QWidgetWindow::handleMouseEvent (this=0x694e90, event=0x7fffffffd3e0) at kernel/qwidgetwindow.cpp:580 #20 0x00007ffff6602fb0 in QWidgetWindow::event (this=0x694e90, event=0x7fffffffd3e0) at kernel/qwidgetwindow.cpp:300 #21 0x00007ffff65a53fe in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x694e90, e=0x7fffffffd3e0) at kernel/qapplication.cpp:3637 #22 0x00007ffff58dc128 in QCoreApplication::notifyInternal2 (receiver=0x694e90, event=0x7fffffffd3e0) at kernel/qcoreapplication.cpp:1064 #23 0x00007ffff5d7b9ad in QGuiApplicationPrivate::processMouseEvent (e=0x7fffe4004fc0) at kernel/qguiapplication.cpp:2285 #24 0x00007ffff5d4f37c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169 #25 0x00007ffff3a7d1e0 in userEventSourceDispatch (source=<optimized out>) at qeventdispatcher_glib.cpp:74 #26 0x00007ffff3e6aa90 in g_main_dispatch (context=0x7fffec005010) at ../glib/gmain.c:3444 #27 g_main_context_dispatch (context=context@entry=0x7fffec005010) at ../glib/gmain.c:4162 #28 0x00007ffff3e6ae48 in g_main_context_iterate (context=context@entry=0x7fffec005010, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4238 #29 0x00007ffff3e6aedc in g_main_context_iteration (context=0x7fffec005010, may_block=1) at ../glib/gmain.c:4303 #30 0x00007ffff5933b56 in QEventDispatcherGlib::processEvents (this=0x46c5c0, flags=...) at kernel/qeventdispatcher_glib.cpp:423 #31 0x00007ffff58dab9b in QEventLoop::exec (this=this@entry=0x7fffffffd710, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69 #32 0x00007ffff58e2d06 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121 #33 0x0000000000405509 in main () A debugging session is active. Inferior 1 [process 1749] will be killed. Quit anyway? (y or n) [answered Y; input not from terminal]
Git commit ba1d8deb4642791d4506cef498de5944e63bdf5c by Waqar Ahmed. Committed on 12/01/2023 at 08:41. Pushed by waqar into branch 'master'. kcommandbar: Fix no central widget crashes app M +1 -0 autotests/CMakeLists.txt A +31 -0 autotests/kcmdbartest.cpp [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)] M +2 -1 src/kcommandbar.cpp https://invent.kde.org/frameworks/kconfigwidgets/commit/ba1d8deb4642791d4506cef498de5944e63bdf5c
Git commit 3c71ffa72148d9bdfe97b87d33e983333ed53283 by Waqar Ahmed. Committed on 12/01/2023 at 08:52. Pushed by waqar into branch 'kf5'. kcommandbar: Fix no central widget crashes app (cherry picked from commit ba1d8deb4642791d4506cef498de5944e63bdf5c) M +1 -0 autotests/CMakeLists.txt A +31 -0 autotests/kcmdbartest.cpp [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)] M +2 -1 src/kcommandbar.cpp https://invent.kde.org/frameworks/kconfigwidgets/commit/3c71ffa72148d9bdfe97b87d33e983333ed53283
Git commit 5683433935290bc0da3052285dd14f1db652f22e by Eugene Popov. Committed on 14/05/2023 at 15:20. Pushed by cullmann into branch 'master'. KCommandBar: improve positioning This MR is a better way to fix the positioning of the command bar when there is no central widget. Also, this commit improves the positioning of the command bar in applications that use QDockWidget (like Kdenlive). M +60 -21 src/kcommandbar.cpp https://invent.kde.org/frameworks/kconfigwidgets/commit/5683433935290bc0da3052285dd14f1db652f22e