ilarik / kanki-irodsclient

Cross-Platform iRODS GUI Client
BSD 3-Clause "New" or "Revised" License
20 stars 9 forks source link

Strange lockup related to mounting #9

Open petergil opened 7 years ago

petergil commented 7 years ago

There is a strange lockup happening when doing things related to mounting and receiving an error.

There appears to be some lock that is not released properly somewhere which messes with (re-)rendering the file list.

Steps to reproduce:

  1. Open kanki
  2. Attempt to mount a path that does not exist (/foo works, for instance), and receive a
    Mount collection error
    Read collection failed
    Status: -310000
  3. Attempt to complete a second irods operation
  4. Interface locks and program needs to be killed

Here is a stack trace, on commit 59be946 on linux, when attempting to mount /foo for a second time. Trying to expand a collection, and trying to upload a directory both give roughly equivalent stack traces.

(gdb) attach 5191
Attaching to process 5191
[New LWP 5192]
[New LWP 5193]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
__lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
135     ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or directory.
(gdb) bt
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007fa6c459eab5 in __GI___pthread_mutex_lock (mutex=0x7fa69c002ec0)
    at ../nptl/pthread_mutex_lock.c:80
#2  0x00000000004a843a in boost::posix::pthread_mutex_lock (m=0x7fa69c002ec0)
    at /usr/include/boost/thread/pthread/mutex.hpp:62
#3  boost::mutex::lock (this=0x7fa69c002ec0) at /usr/include/boost/thread/pthread/mutex.hpp:116
#4  0x00000000004a79f0 in Kanki::RodsConnection::mutexLock (this=0x7fa69c002ec0)
    at /home/petergil/programming/kanki-irodsclient/src/rodsconnection.cpp:506
#5  0x00000000004a6784 in Kanki::RodsConnection::readColl (this=0x7fa69c002ec0, 
    collPath="/foo", collObjs=0x7ffd33726dd0)
    at /home/petergil/programming/kanki-irodsclient/src/rodsconnection.cpp:232
#6  0x00000000004c59bb in RodsMainWindow::mountPath (this=0x7ffd33727d60)
    at /home/petergil/programming/kanki-irodsclient/src/rodsmainwindow.cpp:262
#7  0x00000000004ca258 in RodsMainWindow::on_actionMount_triggered (this=0x7ffd33727d60)
    at /home/petergil/programming/kanki-irodsclient/src/rodsmainwindow.cpp:972
#8  0x00000000004f13ee in RodsMainWindow::qt_static_metacall (_o=0x7ffd33727d60, 
    _c=QMetaObject::InvokeMetaMethod, _id=40, _a=0x7ffd33726ff0)
    at /home/petergil/programming/kanki-irodsclient/build/src/moc_rodsmainwindow.cpp:311
#9  0x00000000004f173a in RodsMainWindow::qt_metacall (this=0x7ffd33727d60, 
    _c=QMetaObject::InvokeMetaMethod, _id=40, _a=0x7ffd33726ff0)
    at /home/petergil/programming/kanki-irodsclient/build/src/moc_rodsmainwindow.cpp:369
#10 0x00007fa6c2b47680 in QMetaObject::activate(QObject*, int, int, void**) ()
   from /usr/lib64/libQt5Core.so.5
#11 0x00007fa6c33ab422 in QAction::triggered(bool) () from /usr/lib64/libQt5Widgets.so.5
#12 0x00007fa6c33ae1bd in QAction::activate(QAction::ActionEvent) ()
   from /usr/lib64/libQt5Widgets.so.5
#13 0x00007fa6c34995dd in ?? () from /usr/lib64/libQt5Widgets.so.5
#14 0x00007fa6c3499804 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib64/libQt5Widgets.so.5
#15 0x00007fa6c356c72a in QToolButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib64/libQt5Widgets.so.5
#16 0x00007fa6c33fba68 in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#17 0x00007fa6c356c809 in QToolButton::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#18 0x00007fa6c33b598c in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib64/libQt5Widgets.so.5
#19 0x00007fa6c33ba82c in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib64/libQt5Widgets.so.5
#20 0x00007fa6c2b20100 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib64/libQt5Core.so.5
#21 0x00007fa6c33b9601 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib64/libQt5Widgets.so.5
#22 0x00007fa6c34185e6 in ?? () from /usr/lib64/libQt5Widgets.so.5
#23 0x00007fa6c341acc3 in ?? () from /usr/lib64/libQt5Widgets.so.5
#24 0x00007fa6c33b598c in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib64/libQt5Widgets.so.5
#25 0x00007fa6c33ba0b0 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib64/libQt5Widgets.so.5
#26 0x00007fa6c2b20100 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib64/libQt5Core.so.5
#27 0x00007fa6c2e5026b in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib64/libQt5Gui.so.5
#28 0x00007fa6c2e51f75 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib64/libQt5Gui.so.5
#29 0x00007fa6c2e327e3 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Gui.so.5
#30 0x00007fa6ba490940 in ?? () from /usr/lib64/libQt5XcbQpa.so.5
#31 0x00007fa6c05afd2d in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#32 0x00007fa6c05b0010 in ?? () from /usr/lib64/libglib-2.0.so.0
#33 0x00007fa6c05b00bc in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#34 0x00007fa6c2b6c837 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#35 0x00007fa6c2b1ec9a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/libQt5Core.so.5
#36 0x00007fa6c2b2675c in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#37 0x00000000004a51c7 in main (argc=1, argv=0x7ffd33727f08)
    at /home/petergil/programming/kanki-irodsclient/src/main.cpp:31
petergil commented 7 years ago

This is the stack trace after trying to upload a directory after failing to mount a path.

The upload seems to work until the last file finishes but before the upload dialog closes, when the interface locks.

(gdb) attach 12888
Attaching to process 12888
[New LWP 12889]
[New LWP 12890]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
bt__lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
135     ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or directory.
(gdb) bt
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007f25ddad0ab5 in __GI___pthread_mutex_lock (mutex=0x7f25b8002ec0)
    at ../nptl/pthread_mutex_lock.c:80
#2  0x00000000004a843a in boost::posix::pthread_mutex_lock (m=0x7f25b8002ec0)
    at /usr/include/boost/thread/pthread/mutex.hpp:62
#3  boost::mutex::lock (this=0x7f25b8002ec0) at /usr/include/boost/thread/pthread/mutex.hpp:116
#4  0x00000000004a79f0 in Kanki::RodsConnection::mutexLock (this=0x7f25b8002ec0)
    at /home/petergil/programming/kanki-irodsclient/src/rodsconnection.cpp:506
#5  0x00000000004a6784 in Kanki::RodsConnection::readColl (this=0x7f25b8002ec0, 
    collPath="/rds.snic.se/home/petergil/foo", collObjs=0x2ecb8a0)
    at /home/petergil/programming/kanki-irodsclient/src/rodsconnection.cpp:232
#6  0x00000000004e7c48 in RodsObjTreeModel::refreshAtIndex (this=0x2a70520, parent=...)
    at /home/petergil/programming/kanki-irodsclient/src/rodsobjtreemodel.cpp:410
#7  0x00000000004e8474 in RodsObjTreeModel::refreshAtPath (this=0x2a70520, path=...)
    at /home/petergil/programming/kanki-irodsclient/src/rodsobjtreemodel.cpp:484
#8  0x00000000004d5513 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QString>, void, void (RodsObjTreeModel::*)(QString)>::call (f=
    (void (RodsObjTreeModel::*)(RodsObjTreeModel * const, QString)) 0x4e8008 <RodsObjTreeModel::refreshAtPath(QString)>, o=0x2a70520, arg=0x7f25b8002d70)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:501
#9  0x00000000004d48cd in QtPrivate::FunctionPointer<void (RodsObjTreeModel::*)(QString)>::call<QtPrivate::List<QString>, void> (f=
    (void (RodsObjTreeModel::*)(RodsObjTreeModel * const, QString)) 0x4e8008 <RodsObjTreeModel::refreshAtPath(QString)>, o=0x2a70520, arg=0x7f25b8002d70)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:520
#10 0x00000000004d3dd9 in QtPrivate::QSlotObject<void (RodsObjTreeModel::*)(QString), QtPrivate::List<QString>, void>::impl (which=1, this_=0x2f74c20, r=0x2a70520, a=0x7f25b8002d70, ret=0x0)
    at /usr/include/qt5/QtCore/qobject_impl.h:143
#11 0x00007f25dc07a67a in QObject::event(QEvent*) () from /usr/lib64/libQt5Core.so.5
#12 0x00007f25dc8e798c in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib64/libQt5Widgets.so.5
#13 0x00007f25dc8ec0b0 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib64/libQt5Widgets.so.5
#14 0x00007f25dc052100 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /usr/lib64/libQt5Core.so.5
#15 0x00007f25dc054333 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQt5Core.so.5
#16 0x00007f25dc09e7c3 in ?? () from /usr/lib64/libQt5Core.so.5
#17 0x00007f25d9ae1d2d in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#18 0x00007f25d9ae2010 in ?? () from /usr/lib64/libglib-2.0.so.0
#19 0x00007f25d9ae20bc in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#20 0x00007f25dc09e837 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#21 0x00007f25dc050c9a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib64/libQt5Core.so.5
#22 0x00007f25dc05875c in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#23 0x00000000004a51c7 in main (argc=1, argv=0x7ffeb8735978)
    at /home/petergil/programming/kanki-irodsclient/src/main.cpp:31

As far as can be seen with ils the collection that was uploaded into is empty:

$ ils foo
/rds.snic.se/home/petergil/foo:
  C- /rds.snic.se/home/petergil/foo/
$

However when looking in kanki after a restart there appears to be a bunch of subcollections, regardless of how many subdirectories there were that were uploaded.

screenshot_20161109_005200

(this is a separate bug, probably in irods as well, but just documenting it here for now)