Description
Describe the bug
Plugin detection leads to a segfault. I suspect that this is because the default locations searched for plugins (/usr/local/lib
, /usr/local/lib64
, /usr/lib
, /usr/lib64
) contain duplicates, because /usr/lib64
is a symlink to /usr/lib
on my distro.
To Reproduce
I don't have any specific instructions on how to reproduce this bug, general interaction with the Plugins tab in Settings seems to give me the segfault. Here is a video recording showcasing the bug:
ksnip.mp4
I switch between system installed version of ksnip-plugin-ocr
and a locally built one (which includes debugging symbols). The /home/meator/git/ksnip-plugin-ocr/dest/lib64
directory referenced in the video contains only libksnip-plugin-ocr.so
.
The video also shows general buggines in the Plugins tab (the tab not opening when selected, plugin detection taking a few seconds, which freezes the GUI thread etc.).
Backtrace:
#0 0x0000555555694525 in QtSharedPointer::CustomDeleter<QObject, QtSharedPointer::NormalDeleter>::execute (this=0x55555592b460)
at /usr/include/qt5/QtCore/qsharedpointer_impl.h:193
#1 0x000055555569421f in QtSharedPointer::ExternalRefCountWithCustomDeleter<QObject, QtSharedPointer::NormalDeleter>::deleter (self=0x55555592b450)
at /usr/include/qt5/QtCore/qsharedpointer_impl.h:211
#2 0x00005555555a4125 in QtSharedPointer::ExternalRefCountData::destroy (this=0x55555592b450) at /usr/include/qt5/QtCore/qsharedpointer_impl.h:149
#3 0x000055555561e8fe in QSharedPointer<QObject>::deref (dd=0x55555592b450) at /usr/include/qt5/QtCore/qsharedpointer_impl.h:464
#4 0x000055555561e8c4 in QSharedPointer<QObject>::deref (this=0x7fffffffc1e0) at /usr/include/qt5/QtCore/qsharedpointer_impl.h:459
#5 0x000055555561e06c in QSharedPointer<QObject>::~QSharedPointer (this=0x7fffffffc1e0, __in_chrg=<optimized out>) at /usr/include/qt5/QtCore/qsharedpointer_impl.h:316
#6 0x0000555555693bc2 in QSharedPointer<QObject>::operator= (this=0x555555921840, other=...) at /usr/include/qt5/QtCore/qsharedpointer_impl.h:339
#7 0x0000555555693302 in PluginManager::loadPlugins (this=0x555555896cd0) at /home/meator/git/ksnip/src/plugins/PluginManager.cpp:46
#8 0x0000555555694706 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (PluginManager::*)()>::call(void (PluginManager::*)(), PluginManager*, void**) (f=(void (PluginManager::*)(PluginManager * const)) 0x5555556930fa <PluginManager::loadPlugins()>, o=0x555555896cd0, arg=0x7fffffffc410)
at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
#9 0x0000555555694503 in QtPrivate::FunctionPointer<void (PluginManager::*)()>::call<QtPrivate::List<>, void>(void (PluginManager::*)(), PluginManager*, void**) (
f=(void (PluginManager::*)(PluginManager * const)) 0x5555556930fa <PluginManager::loadPlugins()>, o=0x555555896cd0, arg=0x7fffffffc410)
at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
#10 0x0000555555694131 in QtPrivate::QSlotObject<void (PluginManager::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (
which=1, this_=0x555555892e50, r=0x555555896cd0, a=0x7fffffffc410, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:418
#11 0x00007ffff66fda32 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc410, r=0x555555896cd0, this=0x555555892e50)
at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#12 doActivate<false> (sender=0x5555558949b0, signal_index=6, argv=0x7fffffffc410) at kernel/qobject.cpp:3925
#13 0x000055555559884b in IConfig::pluginsChanged (this=0x5555558949b0) at /home/meator/git/ksnip/build/src/ksnip_autogen/JHW4MCT4YA/moc_IConfig.cpp:207
#14 0x00005555555b844c in Config::setPluginInfos (this=0x5555558949b0, pluginInfos=...) at /home/meator/git/ksnip/src/backend/config/Config.cpp:1449
#15 0x000055555566fd96 in PluginsSettings::saveSettings (this=0x555556809230) at /home/meator/git/ksnip/src/gui/settingsDialog/plugins/PluginsSettings.cpp:44
#16 0x000055555565be48 in SettingsDialog::saveSettings (this=0x7fffffffd390) at /home/meator/git/ksnip/src/gui/settingsDialog/SettingsDialog.cpp:105
#17 0x000055555565e192 in SettingsDialog::okClicked (this=0x7fffffffd390) at /home/meator/git/ksnip/src/gui/settingsDialog/SettingsDialog.cpp:219
#18 0x000055555565f884 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (SettingsDialog::*)()>::call(void (SettingsDialog::*)(), SettingsDialog*, void**) (f=(void (SettingsDialog::*)(SettingsDialog * const)) 0x55555565e17a <SettingsDialog::okClicked()>, o=0x7fffffffd390, arg=0x7fffffffc720)
at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
#19 0x000055555565f72c in QtPrivate::FunctionPointer<void (SettingsDialog::*)()>::call<QtPrivate::List<>, void>(void (SettingsDialog::*)(), SettingsDialog*, void**) (
f=(void (SettingsDialog::*)(SettingsDialog * const)) 0x55555565e17a <SettingsDialog::okClicked()>, o=0x7fffffffd390, arg=0x7fffffffc720)
at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
#20 0x000055555565f4d9 in QtPrivate::QSlotObject<void (SettingsDialog::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (
which=1, this_=0x555556456190, r=0x7fffffffd390, a=0x7fffffffc720, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:418
#21 0x00007ffff66fda32 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc720, r=0x7fffffffd390, this=0x555556456190)
at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#22 doActivate<false> (sender=0x555555f87100, signal_index=9, argv=0x7fffffffc720) at kernel/qobject.cpp:3925
#23 0x00007ffff66f65bf in QMetaObject::activate (sender=sender@entry=0x555555f87100, m=m@entry=0x7ffff787fb80 <QAbstractButton::staticMetaObject>,
local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7fffffffc720) at kernel/qobject.cpp:3985
#24 0x00007ffff7454bf2 in QAbstractButton::clicked (this=this@entry=0x555555f87100, _t1=<optimized out>) at .moc/moc_qabstractbutton.cpp:308
#25 0x00007ffff7454e5a in QAbstractButtonPrivate::emitClicked (this=0x55555614bb70) at widgets/qabstractbutton.cpp:416
#26 0x00007ffff7456977 in QAbstractButtonPrivate::click (this=0x55555614bb70) at widgets/qabstractbutton.cpp:409
#27 0x00007ffff7456b87 in QAbstractButton::mouseReleaseEvent (this=0x555555f87100, e=0x7fffffffccb0) at widgets/qabstractbutton.cpp:1045
#28 0x00007ffff73a4da8 in QWidget::event (this=0x555555f87100, event=0x7fffffffccb0) at kernel/qwidget.cpp:9045
#29 0x00007ffff7362d5e in QApplicationPrivate::notify_helper (this=this@entry=0x5555557c3770, receiver=receiver@entry=0x555555f87100, e=e@entry=0x7fffffffccb0)
at kernel/qapplication.cpp:3640
#30 0x00007ffff736b1fd in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7fffffffccb0) at kernel/qapplication.cpp:3084
#31 0x00007ffff66c50f8 in QCoreApplication::notifyInternal2 (receiver=0x555555f87100, event=0x7fffffffccb0) at kernel/qcoreapplication.cpp:1064
#32 0x00007ffff66c52ce in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#33 0x00007ffff73694ee in QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x555555f87100, event=event@entry=0x7fffffffccb0, alienWidget=<optimized out>,
nativeWidget=0x7fffffffd390, buttonDown=buttonDown@entry=0x7ffff78a9330 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
at kernel/qapplication.cpp:2622
#34 0x00007ffff73bd8fd in QWidgetWindow::handleMouseEvent (this=this@entry=0x555555ee1f50, event=event@entry=0x7fffffffcf60) at kernel/qwidgetwindow.cpp:684
#35 0x00007ffff73c0c4f in QWidgetWindow::event (this=0x555555ee1f50, event=0x7fffffffcf60) at kernel/qwidgetwindow.cpp:300
#36 0x00007ffff7362d5e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x555555ee1f50, e=0x7fffffffcf60) at kernel/qapplication.cpp:3640
#37 0x00007ffff66c50f8 in QCoreApplication::notifyInternal2 (receiver=0x555555ee1f50, event=0x7fffffffcf60) at kernel/qcoreapplication.cpp:1064
#38 0x00007ffff66c52ce in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#39 0x00007ffff6b40fab in QGuiApplicationPrivate::processMouseEvent (e=0x555555e38380) at kernel/qguiapplication.cpp:2285
#40 0x00007ffff6b13dcc in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#41 0x00007ffff451b7da in xcbSourceDispatch (source=<optimized out>) at ./qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:105
#42 0x00007ffff5110ff4 in g_main_dispatch (context=context@entry=0x7fffec000ed0) at ../glib/gmain.c:3357
#43 0x00007ffff51140f7 in g_main_context_dispatch_unlocked (context=0x7fffec000ed0) at ../glib/gmain.c:4208
#44 g_main_context_iterate_unlocked (context=context@entry=0x7fffec000ed0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4273
#45 0x00007ffff51147dc in g_main_context_iteration (context=0x7fffec000ed0, may_block=1) at ../glib/gmain.c:4338
#46 0x00007ffff671e9e6 in QEventDispatcherGlib::processEvents (this=0x55555589ab50, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#47 0x00007ffff66c3b8b in QEventLoop::exec (this=this@entry=0x7fffffffd2b0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#48 0x00007ffff756cdd7 in QDialog::exec (this=0x7fffffffd390) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#49 0x000055555562fd0b in operator() (__closure=0x7fffffffd590) at /home/meator/git/ksnip/src/gui/MainWindow.cpp:690
#50 0x0000555555631d58 in std::__invoke_impl<void, MainWindow::showSettingsDialog()::<lambda()>&>(std::__invoke_other, struct {...} &) (__f=...)
at /usr/include/c++/13.2/bits/invoke.h:61
#51 0x000055555563172e in std::__invoke_r<void, MainWindow::showSettingsDialog()::<lambda()>&>(struct {...} &) (__fn=...) at /usr/include/c++/13.2/bits/invoke.h:111
#52 0x00005555556312db in std::_Function_handler<void(), MainWindow::showSettingsDialog()::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
at /usr/include/c++/13.2/bits/std_function.h:290
#53 0x0000555555634c8e in std::function<void()>::operator() (this=0x7fffffffd590) at /usr/include/c++/13.2/bits/std_function.h:591
#54 0x000055555562fb2a in MainWindow::showDialog (this=0x55555592d7b0, showDialogMethod=...) at /home/meator/git/ksnip/src/gui/MainWindow.cpp:674
#55 0x000055555562fe52 in MainWindow::showSettingsDialog (this=0x55555592d7b0) at /home/meator/git/ksnip/src/gui/MainWindow.cpp:680
#56 0x0000555555638b10 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (MainWindow::*)()>::call(void (MainWindow::*)(), MainWindow*, void**) (f=(void (MainWindow::*)(MainWindow * const)) 0x55555562fe08 <MainWindow::showSettingsDialog()>, o=0x55555592d7b0, arg=0x7fffffffd780)
at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
#57 0x0000555555637fe8 in QtPrivate::FunctionPointer<void (MainWindow::*)()>::call<QtPrivate::List<>, void>(void (MainWindow::*)(), MainWindow*, void**) (
f=(void (MainWindow::*)(MainWindow * const)) 0x55555562fe08 <MainWindow::showSettingsDialog()>, o=0x55555592d7b0, arg=0x7fffffffd780)
at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
#58 0x00005555556365a7 in QtPrivate::QSlotObject<void (MainWindow::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (
which=1, this_=0x555555f63e10, r=0x55555592d7b0, a=0x7fffffffd780, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:418
#59 0x00007ffff66fda32 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffd780, r=0x55555592d7b0, this=0x555555f63e10)
at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#60 doActivate<false> (sender=0x555555958300, signal_index=4, argv=0x7fffffffd780) at kernel/qobject.cpp:3925
#61 0x00007ffff66f65bf in QMetaObject::activate (sender=sender@entry=0x555555958300, m=m@entry=0x7ffff787a5c0 <QAction::staticMetaObject>,
local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffd780) at kernel/qobject.cpp:3985
#62 0x00007ffff735c4f2 in QAction::triggered (this=this@entry=0x555555958300, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#63 0x00007ffff735f14f in QAction::activate (this=0x555555958300, event=<optimized out>) at kernel/qaction.cpp:1161
#64 0x00007ffff74e4732 in QMenuPrivate::activateCausedStack (this=this@entry=0x5555560473d0, causedStack=..., action=action@entry=0x555555958300,
action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1384
#65 0x00007ffff74ec503 in QMenuPrivate::activateAction (this=0x5555560473d0, action=0x555555958300, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1461
#66 0x00007ffff73a4da8 in QWidget::event (this=0x5555559dd880, event=0x7fffffffdd70) at kernel/qwidget.cpp:9045
#67 0x00007ffff7362d5e in QApplicationPrivate::notify_helper (this=this@entry=0x5555557c3770, receiver=receiver@entry=0x5555559dd880, e=e@entry=0x7fffffffdd70)
at kernel/qapplication.cpp:3640
#68 0x00007ffff736b1fd in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7fffffffdd70) at kernel/qapplication.cpp:3084
#69 0x00007ffff66c50f8 in QCoreApplication::notifyInternal2 (receiver=0x5555559dd880, event=0x7fffffffdd70) at kernel/qcoreapplication.cpp:1064
#70 0x00007ffff66c52ce in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#71 0x00007ffff73694ee in QApplicationPrivate::sendMouseEvent (receiver=0x5555559dd880, event=event@entry=0x7fffffffdd70, alienWidget=<optimized out>,
nativeWidget=0x5555559dd880, buttonDown=buttonDown@entry=0x7ffff78a9330 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
at kernel/qapplication.cpp:2622
#72 0x00007ffff73be3ca in QWidgetWindow::handleMouseEvent (this=this@entry=0x555555896840, event=event@entry=0x7fffffffe020) at kernel/qwidgetwindow.cpp:580
#73 0x00007ffff73c0c4f in QWidgetWindow::event (this=0x555555896840, event=0x7fffffffe020) at kernel/qwidgetwindow.cpp:300
#74 0x00007ffff7362d5e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x555555896840, e=0x7fffffffe020) at kernel/qapplication.cpp:3640
#75 0x00007ffff66c50f8 in QCoreApplication::notifyInternal2 (receiver=0x555555896840, event=0x7fffffffe020) at kernel/qcoreapplication.cpp:1064
#76 0x00007ffff66c52ce in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#77 0x00007ffff6b40fab in QGuiApplicationPrivate::processMouseEvent (e=0x5555560f7ea0) at kernel/qguiapplication.cpp:2285
#78 0x00007ffff6b13dcc in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#79 0x00007ffff451b7da in xcbSourceDispatch (source=<optimized out>) at ./qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:105
#80 0x00007ffff5110ff4 in g_main_dispatch (context=context@entry=0x7fffec000ed0) at ../glib/gmain.c:3357
#81 0x00007ffff51140f7 in g_main_context_dispatch_unlocked (context=0x7fffec000ed0) at ../glib/gmain.c:4208
#82 g_main_context_iterate_unlocked (context=context@entry=0x7fffec000ed0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4273
#83 0x00007ffff51147dc in g_main_context_iteration (context=0x7fffec000ed0, may_block=1) at ../glib/gmain.c:4338
#84 0x00007ffff671e9e6 in QEventDispatcherGlib::processEvents (this=0x55555589ab50, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#85 0x00007ffff66c3b8b in QEventLoop::exec (this=this@entry=0x7fffffffe370, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#86 0x00007ffff66cc020 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#87 0x00005555555dc657 in StandAloneBootstrapper::startKsnip (this=0x5555558937f0, app=...) at /home/meator/git/ksnip/src/bootstrapper/StandAloneBootstrapper.cpp:207
#88 0x00005555555dba4e in StandAloneBootstrapper::start (this=0x5555558937f0, app=...) at /home/meator/git/ksnip/src/bootstrapper/StandAloneBootstrapper.cpp:49
#89 0x00005555555e0e59 in SingleInstanceServerBootstrapper::start (this=0x5555558937f0, app=...)
at /home/meator/git/ksnip/src/bootstrapper/singleInstance/SingleInstanceServerBootstrapper.cpp:37
#90 0x00005555555a921b in main (argc=1, argv=0x7fffffffe5b8) at /home/meator/git/ksnip/src/main.cpp:50
Full backtrace: full-backtrace.txt
Desktop:
- OS: Linux
- Distribution in case of Linux: Void Linux
- Window System in case of Linux: X11
- ksnip version: all backtraces and the accompanying video were taken with ksnip cff5650 (current HEAD); this bug is also reproducible with
1.10.1
; I am using thecontinuous
version ofksnip-plugin-ocr
- How did you install ksnip: distro's package manager