https://bugs.kde.org/show_bug.cgi?id=465326

Oded Arbel <o...@geek.co.il> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WAITINGFORINFO              |---
          Component|generic-performance         |Clipboard
             Status|NEEDSINFO                   |REPORTED

--- Comment #9 from Oded Arbel <o...@geek.co.il> ---
I believe the issue is that klipper is having a real hard time managing images
in the clipboard history (I had to screenshot followed by copy and paste a lot
last week), to the point of crashing plasmashell (which begs the question, BTW,
why is it running on plasmashell's main thread - it used to be a standalone
application). I tried to clear the clipboard history using the clipboard panel
widget's "clear" button, after which plasmashell froze for some minutes (!!)
with this trace:

---8<---
Thread 1 (Thread 0x7f86339a19c0 (LWP 885456) "plasmashell"):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f8637ecea65 in QtLinuxFutex::_q_futex(int*, int, int, unsigned long
long, int*, int) (val3=0, addr2=0x0, val2=0, val=3, op=0, addr=0x5601db2ee2f8)
at thread/qfutex_p.h:114
#2  QtLinuxFutex::futexWait<QBasicAtomicPointer<QMutexData>
>(QBasicAtomicPointer<QMutexData>&, QBasicAtomicPointer<QMutexData>::Type)
(expectedValue=0x3, futex=...) at thread/qfutex_p.h:133
#3  lockInternal_helper<false> (timeout=-1, elapsedTimer=0x0, d_ptr=...) at
thread/qmutex_linux.cpp:142
#4  QBasicMutex::lockInternal() (this=0x5601db2ee2f8) at
thread/qmutex_linux.cpp:159
#5  0x00007f8637eced73 in QBasicMutex::lock() (this=0x5601db2ee2f8) at
thread/qmutex.h:84
#6  QRecursiveMutexPrivate::lock(int) (this=0x5601db2ee2e0,
timeout=timeout@entry=-1) at thread/qmutex.cpp:780
#7  0x00007f8637ecec69 in QMutex::lock() (this=this@entry=0x5601db2eed00) at
thread/qmutex.cpp:235
#8  0x00007f858e6a1f67 in QMutexLocker::QMutexLocker(QBasicMutex*)
(m=0x5601db2eed00, this=<synthetic pointer>) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qmutex.h:257
#9  QMutexLocker::QMutexLocker(QRecursiveMutex*) (m=0x5601db2eed00,
this=<synthetic pointer>) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qmutex.h:262
#10 HistoryModel::clear() (this=0x5601db2eece0) at
./klipper/historymodel.cpp:26
#11 0x00007f858e69e1fd in History::slotClear() (this=<optimized out>) at
./klipper/history.cpp:113
#12 0x00007f858e68fe85 in Klipper::slotAskClearHistory() (this=0x5601dbe262a0)
at ./klipper/klipper.h:83
#13 0x00007f858e680ef9 in ClipboardJob::start() (this=0x5601e3718180) at
./klipper/clipboardjob.cpp:38
#14 0x00007f86380e9ade in QObject::event(QEvent*) (this=0x5601e3718180,
e=0x5601e3711ff0) at kernel/qobject.cpp:1347
#15 0x00007f8638d6c793 in QApplicationPrivate::notify_helper(QObject*, QEvent*)
(this=<optimized out>, receiver=0x5601e3718180, e=0x5601e3711ff0) at
kernel/qapplication.cpp:3640
#16 0x00007f86380bc07a in QCoreApplication::notifyInternal2(QObject*, QEvent*)
(receiver=0x5601e3718180, event=0x5601e3711ff0) at
kernel/qcoreapplication.cpp:1064
#17 0x00007f86380bf167 in QCoreApplicationPrivate::sendPostedEvents(QObject*,
int, QThreadData*) (receiver=0x0, event_type=0, data=0x5601d95baec0) at
kernel/qcoreapplication.cpp:1821
#18 0x00007f8638116487 in postEventSourceDispatch(GSource*, GSourceFunc,
gpointer) (s=0x5601d95fcce0) at kernel/qeventdispatcher_glib.cpp:277
#19 0x00007f8636bec569 in g_main_dispatch (context=0x7f862c005010) at
../../../glib/gmain.c:3444
#20 g_main_context_dispatch (context=0x7f862c005010) at
../../../glib/gmain.c:4162
#21 0x00007f8636c413c8 in g_main_context_iterate.constprop.0
(context=0x7f862c005010, block=<optimized out>, dispatch=1, self=<optimized
out>) at ../../../glib/gmain.c:4238
#22 0x00007f8636be9d20 in g_main_context_iteration (context=0x7f862c005010,
may_block=1) at ../../../glib/gmain.c:4303
#23 0x00007f8638115ad8 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
(this=0x5601d960f1c0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#24 0x00007f86380ba99b in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
(this=this@entry=0x7fff31294ef0, flags=..., flags@entry=...) at
../../include/QtCore/../../src/corelib/global/qflags.h:69
#25 0x00007f86380c2f34 in QCoreApplication::exec() () at
../../include/QtCore/../../src/corelib/global/qflags.h:121
#26 0x00007f86385364d0 in QGuiApplication::exec() () at
kernel/qguiapplication.cpp:1870
#27 0x00007f8638d6c709 in QApplication::exec() () at
kernel/qapplication.cpp:2832
#28 0x00005601d79e2a8b in main(int, char**) (argc=<optimized out>,
argv=<optimized out>) at ./shell/main.cpp:235
---8<---

and then crashed with the same 'std::bad_alloc' uncaught exception (while the
main thread is still stuck on the above trace).

After restarting, I can still see plasmashell freezing on
HistoryModel::insert() for long stretches of time. I removed
~/.local/share/klipper/history2.lst and SIGKILLed plasmashell, and now it is
behaving much better, as well as a lot of klipper problems I had are now no
longer exhibiting.

I need to run it a bit longer to make sure, but even copying and pasting images
seem to work fine now.

I have the copy of the klipper history file that was apparently giving me
grief, if someone wants to try to analyze this. Putting the old history back
in, it works for a bit until I select one of the copied images in the clipboard
history menu, at which point I get this in the log:

Feb 09 13:37:23 vesho plasmashell[895012]: org.kde.klipper: Setting selection
to < "▨ 1,610x1,329 32bpp" >
Feb 09 13:37:23 vesho plasmashell[895012]: org.kde.klipper: Setting clipboard
to < "▨ 1,610x1,329 32bpp" >

Then we get frozen again at:

Thread 1 (Thread 0x7f7f541ba9c0 (LWP 893746) "plasmashell"):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f7f586cea65 in QtLinuxFutex::_q_futex(int*, int, int, unsigned long
long, int*, int) (val3=0, addr2=0x0, val2=0, val=3, op=0, addr=0x561762001048)
at thread/qfutex_p.h:114
#2  QtLinuxFutex::futexWait<QBasicAtomicPointer<QMutexData>
>(QBasicAtomicPointer<QMutexData>&, QBasicAtomicPointer<QMutexData>::Type)
(expectedValue=0x3, futex=...) at thread/qfutex_p.h:133
#3  lockInternal_helper<false> (timeout=-1, elapsedTimer=0x0, d_ptr=...) at
thread/qmutex_linux.cpp:142
#4  QBasicMutex::lockInternal() (this=0x561762001048) at
thread/qmutex_linux.cpp:159
#5  0x00007f7f586ced73 in QBasicMutex::lock() (this=0x561762001048) at
thread/qmutex.h:84
#6  QRecursiveMutexPrivate::lock(int) (this=0x561762001030,
timeout=timeout@entry=-1) at thread/qmutex.cpp:780
#7  0x00007f7f586cec69 in QMutex::lock() (this=this@entry=0x561762001480) at
thread/qmutex.cpp:235
#8  0x00007f7eb0319c80 in QMutexLocker::QMutexLocker(QBasicMutex*)
(m=0x561762001480, this=<synthetic pointer>) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qmutex.h:257
#9  QMutexLocker::QMutexLocker(QRecursiveMutex*) (m=0x561762001480,
this=<synthetic pointer>) at
/usr/include/x86_64-linux-gnu/qt5/QtCore/qmutex.h:262
#10 HistoryModel::moveToTop(int) (this=0x561762001460, row=row@entry=1) at
./klipper/historymodel.cpp:201
#11 0x00007f7eb0319dfc in HistoryModel::moveToTop(int) (row=1, this=<optimized
out>) at ./klipper/historymodel.cpp:194
#12 0x00007f7eb0315253 in History::slotMoveToTop(QByteArray const&)
(this=this@entry=0x561762001380, uuid=...) at ./klipper/history.cpp:137
#13 0x00007f7eb031530c in History::slotMoveToTop(QAction*)
(this=0x561762001380, action=<optimized out>) at ./klipper/history.cpp:122
#14 0x00007f7f588f4108 in doActivate<false>(QObject*, int, void**)
(sender=0x561761fcccf0, signal_index=9, argv=0x7fff4bc8a790) at
kernel/qobject.cpp:3935
#15 0x00007f7f588ed177 in QMetaObject::activate(QObject*, QMetaObject const*,
int, void**) (sender=sender@entry=0x561761fcccf0, m=m@entry=0x7f7f59aa2ae0
<QMenu::staticMetaObject>, local_signal_index=local_signal_index@entry=2,
argv=argv@entry=0x7fff4bc8a790) at kernel/qobject.cpp:3983
#16 0x00007f7f596f3026 in QMenu::triggered(QAction*)
(this=this@entry=0x561761fcccf0, _t1=<optimized out>, _t1@entry=0x5617675ed3e0)
at .moc/moc_qmenu.cpp:283
#17 0x00007f7f596fcbcb in QMenuPrivate::_q_actionTriggered()
(this=0x561761f6d6b0) at widgets/qmenu.cpp:1486
#18 0x00007f7f588f4108 in doActivate<false>(QObject*, int, void**)
(sender=0x5617675ed3e0, signal_index=4, argv=0x7fff4bc8a920) at
kernel/qobject.cpp:3935
#19 0x00007f7f588ed177 in QMetaObject::activate(QObject*, QMetaObject const*,
int, void**) (sender=sender@entry=0x5617675ed3e0, m=m@entry=0x7f7f59a95d40
<QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1,
argv=argv@entry=0x7fff4bc8a920) at kernel/qobject.cpp:3983
#20 0x00007f7f59565c56 in QAction::triggered(bool)
(this=this@entry=0x5617675ed3e0, _t1=<optimized out>) at
.moc/moc_qaction.cpp:376
#21 0x00007f7f5956894c in QAction::activate(QAction::ActionEvent)
(this=0x5617675ed3e0, event=<optimized out>) at kernel/qaction.cpp:1161
#22 0x00007f7f596f4a52 in
QMenuPrivate::activateCausedStack(QVector<QPointer<QWidget> > const&, QAction*,
QAction::ActionEvent, bool) (this=this@entry=0x561761f6d6b0, causedStack=...,
action=action@entry=0x5617675ed3e0, action_e=action_e@entry=QAction::Trigger,
self=self@entry=true) at widgets/qmenu.cpp:1384
#23 0x00007f7f596fc629 in QMenuPrivate::activateAction(QAction*,
QAction::ActionEvent, bool) (this=0x561761f6d6b0, action=0x5617675ed3e0,
action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1461
#24 0x00007f7f596ff2ba in QMenu::keyPressEvent(QKeyEvent*) (this=<optimized
out>, e=<optimized out>) at widgets/qmenu.cpp:3440
#25 0x00007f7eb031c03b in KlipperPopup::keyPressEvent(QKeyEvent*)
(this=0x561761fcccf0, e=0x7fff4bc8afc0) at ./klipper/klipperpopup.cpp:251
#26 0x00007f7f595b0808 in QWidget::event(QEvent*) (this=0x561761fcccf0,
event=0x7fff4bc8afc0) at kernel/qwidget.cpp:8704
#27 0x00007f7f5956c793 in QApplicationPrivate::notify_helper(QObject*, QEvent*)
(this=this@entry=0x56175fca8160, receiver=receiver@entry=0x561761fcccf0,
e=e@entry=0x7fff4bc8afc0) at kernel/qapplication.cpp:3640
#28 0x00007f7f5957450e in QApplication::notify(QObject*, QEvent*)
(this=<optimized out>, receiver=0x561761fcccf0, e=0x7fff4bc8afc0) at
kernel/qapplication.cpp:3002
#29 0x00007f7f588bc07a in QCoreApplication::notifyInternal2(QObject*, QEvent*)
(receiver=0x561761fcccf0, event=0x7fff4bc8afc0) at
kernel/qcoreapplication.cpp:1064
#30 0x00007f7f595cc4ff in QWidgetWindow::event(QEvent*) (this=0x561761ff3490,
event=0x7fff4bc8afc0) at kernel/qwidgetwindow.cpp:293
#31 0x00007f7f5956c793 in QApplicationPrivate::notify_helper(QObject*, QEvent*)
(this=<optimized out>, receiver=0x561761ff3490, e=0x7fff4bc8afc0) at
kernel/qapplication.cpp:3640
#32 0x00007f7f588bc07a in QCoreApplication::notifyInternal2(QObject*, QEvent*)
(receiver=0x561761ff3490, event=0x7fff4bc8afc0) at
kernel/qcoreapplication.cpp:1064
#33 0x00007f7f58d3ebea in
QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*)
(e=0x56176911e4d0) at kernel/qguiapplication.cpp:2417
#34 0x00007f7f58d16a5c in
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
(flags=...) at kernel/qwindowsysteminterface.cpp:1169
#35 0x00007f7f5a15f664 in userEventSourceDispatch(_GSource*, int (*)(void*),
void*) () at /lib/x86_64-linux-gnu/libQt5WaylandClient.so.5
#36 0x00007f7f573f7569 in g_main_dispatch (context=0x7f7f4c005010) at
../../../glib/gmain.c:3444
#37 g_main_context_dispatch (context=0x7f7f4c005010) at
../../../glib/gmain.c:4162
#38 0x00007f7f5744c3c8 in g_main_context_iterate.constprop.0
(context=0x7f7f4c005010, block=<optimized out>, dispatch=1, self=<optimized
out>) at ../../../glib/gmain.c:4238
#39 0x00007f7f573f4d20 in g_main_context_iteration (context=0x7f7f4c005010,
may_block=1) at ../../../glib/gmain.c:4303
#40 0x00007f7f58915ad8 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
(this=0x56175fcc8b80, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#41 0x00007f7f588ba99b in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
(this=this@entry=0x7fff4bc8b250, flags=..., flags@entry=...) at
../../include/QtCore/../../src/corelib/global/qflags.h:69
#42 0x00007f7f588c2f34 in QCoreApplication::exec() () at
../../include/QtCore/../../src/corelib/global/qflags.h:121
#43 0x00007f7f58d364d0 in QGuiApplication::exec() () at
kernel/qguiapplication.cpp:1870
#44 0x00007f7f5956c709 in QApplication::exec() () at
kernel/qapplication.cpp:2832
#45 0x000056175f138a8b in main(int, char**) (argc=<optimized out>,
argv=<optimized out>) at ./shell/main.cpp:235

for definitely more than 5 minutes and then crash:

Feb 09 13:35:41 vesho plasmashell[893746]: QBuffer::writeData: Memory
allocation error
Feb 09 13:35:41 vesho plasmashell[893746]: QBuffer::writeData: Memory
allocation error
Feb 09 13:35:41 vesho plasmashell[893746]: libpng error: Write Error
Feb 09 13:35:41 vesho plasmashell[893746]: Qt Concurrent has caught an
exception thrown from a worker thread.
                                           This is not supported, exceptions
thrown in worker threads must be
                                           caught before control returns to Qt
Concurrent.
Feb 09 13:35:41 vesho plasmashell[893746]: terminate called after throwing an
instance of 'std::bad_alloc'
Feb 09 13:35:41 vesho plasmashell[893746]:   what():  std::bad_alloc

I think the origin of the problem is a screenshot I copied in which some of the
area being copied was outside of any panel in my non-rectangular screen setup
(I have a vertical screen next to a horizontal screen), and I have managed to
paste (what I believe to be) the problematic image to GIMP and save it - if
anyone is interested. I tried to reproduce the problem by copying similarly set
up windows but have yet to succeed.

The PNG errors probably originate from this trace, but I can't be sure:

---8<---
Thread 16 (Thread 0x7f7f032d16c0 (LWP 893777) "Thread (pooled)"):
#0  0x00007f7f57275336 in png_write_row () at
/lib/x86_64-linux-gnu/libpng16.so.16
#1  0x00007f7f5727689f in png_write_rows () at
/lib/x86_64-linux-gnu/libpng16.so.16
#2  0x00007f7f58e0041f in QPNGImageWriter::writeImage(QImage const&, int,
QString const&, int, int) (this=0x7f7f032d08f0, image=..., compression_in=-1,
description=..., off_x_in=<optimized out>, off_y_in=<optimized out>) at
image/qpnghandler.cpp:1174
#3  0x00007f7f58e00e0d in QPNGImageWriter::writeImage(QImage const&, int,
QString const&) (description=..., compression=-1, img=..., this=0x7f7f032d08f0)
at image/qpnghandler.cpp:181
#4  write_png_image (description=..., gamma=0, quality=-1, compression=-1,
device=<optimized out>, image=...) at image/qpnghandler.cpp:1203
#5  QPngHandler::write(QImage const&) (this=<optimized out>, image=...) at
image/qpnghandler.cpp:1250
#6  0x00007f7f58db9b15 in QImageWriter::write(QImage const&)
(this=this@entry=0x7f7f032d09c8, image=...) at image/qimagewriter.cpp:785
#7  0x00007f7f58d8dff1 in operator<<(QDataStream&, QImage const&) (s=...,
image=...) at image/qimage.cpp:3800
#8  0x00007f7eb031db95 in HistoryImageItem::write(QDataStream&) const
(this=0x561762007350, stream=<optimized out>) at
./klipper/historyimageitem.cpp:44
#9  0x00007f7eb03040b9 in operator<<(QDataStream&, HistoryItem const*)
(rhs=<optimized out>, lhs=...) at ./klipper/historyitem.h:119
#10 Klipper::saveHistory(bool) (this=0x7f7f44009a10, empty=<optimized out>) at
./klipper/klipper.cpp:528
#11 0x00007f7eb030856f in non-virtual thunk to
QtConcurrent::RunFunctionTask<void>::run() () at
/usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/dataengine/plasma_engine_clipboard.so
#12 0x00007f7f586d19b2 in QThreadPoolThread::run() (this=0x561760ecbf80) at
thread/qthreadpool.cpp:100
#13 0x00007f7f586ce703 in QThreadPrivate::start(void*) (arg=0x561760ecbf80) at
thread/qthread_unix.cpp:330
#14 0x00007f7f57e90402 in start_thread (arg=<optimized out>) at
./nptl/pthread_create.c:442
#15 0x00007f7f57f1f590 in clone3 () at
../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
---8<---

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to