Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-48529

QMimeDatabase::mimeTypeForFile freezes application when accessing symlink to named pipe

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.0
    • 5.4.2
    • Core: I/O
    • None
    • Debian Sid/KDE 5
    • 72b4f0d4743826ee14ec06bf0ada26418f4a69be

    Description

      When trying to determine the mime type of a symlink pointing to a named pipe, Qt frezes the entire application. Steps to reproduce: create a named pipe, create a symlink to it (for example, just launch Kile in its default configuration and create an new document, you will have .lyxpipe.in and .lyxpipe.out symlinks in your home directory pointing to named pipes). Open any KDE Frameworks 5 application, e.g. KWrite, and hit Ctrl+O. If hidden files are displayed, the entire application freezes. Attaching GDB to kwrite and running a backtrace gives the following:

      #0  0x00007f89fa70d40d in open64 () from /lib/x86_64-linux-gnu/libc.so.6
      #1  0x00007f89f74c2b6c in open64 (__oflag=<optimized out>, __path=0x2190c18 "/home/ilia/test/test") at /usr/include/x86_64-linux-gnu/bits/fcntl2.h:91
      #2  qt_safe_open (mode=438, flags=<optimized out>, pathname=0x2190c18 "/home/ilia/test/test")
          at ../../include/QtCore/5.4.2/QtCore/private/../../../../../src/corelib/kernel/qcore_unix_p.h:166
      #3  QFSFileEnginePrivate::nativeOpen (this=this@entry=0x218eec0, openMode=...) at io/qfsfileengine_unix.cpp:160
      #4  0x00007f89f74b02fd in QFSFileEngine::open (this=0x1d777e0, openMode=...) at io/qfsfileengine.cpp:218
      #5  0x00007f89f7453217 in QFile::open (this=this@entry=0x7ffd817fa560, mode=..., mode@entry=...) at io/qfile.cpp:881
      #6  0x00007f89f75b27cd in QMimeDatabase::mimeTypeForFile (this=this@entry=0x7ffd817fa710, fileInfo=..., mode=mode@entry=QMimeDatabase::MatchDefault) at mimetypes/qmimedatabase.cpp:372
      #7  0x00007f89f75b2b8d in QMimeDatabase::mimeTypeForFile (this=this@entry=0x7ffd817fa710, fileName=..., mode=mode@entry=QMimeDatabase::MatchDefault) at mimetypes/qmimedatabase.cpp:413
      #8  0x00007f89f75b3081 in QMimeDatabase::mimeTypeForUrl (this=0x7ffd817fa710, url=...) at mimetypes/qmimedatabase.cpp:511
      #9  0x00007f89f997c268 in KFileItem::determineMimeType() const () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #10 0x00007f89f6837f20 in KFilePreviewGenerator::Private::resolveMimeType() () from /usr/lib/x86_64-linux-gnu/libKF5KIOFileWidgets.so.5
      #11 0x00007f89f6837fb9 in KFilePreviewGenerator::Private::startMimeTypeResolving() () from /usr/lib/x86_64-linux-gnu/libKF5KIOFileWidgets.so.5
      #12 0x00007f89f68389d8 in KFilePreviewGenerator::Private::updateIcons(KFileItemList const&) () from /usr/lib/x86_64-linux-gnu/libKF5KIOFileWidgets.so.5
      #13 0x00007f89f75672fa in QMetaObject::activate (sender=0x1cf1770, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3717
      #14 0x00007f89f9a03b35 in KCoreDirLister::newItems(KFileItemList const&) () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #15 0x00007f89f9a06ae5 in KCoreDirLister::Private::emitItems() () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #16 0x00007f89f9a14453 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #17 0x00007f89f9a15b70 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #18 0x00007f89f75672fa in QMetaObject::activate (sender=0x2287b80, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3717
      #19 0x00007f89f99c3524 in KIO::ListJob::entries(KIO::Job*, QList<KIO::UDSEntry> const&) () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #20 0x00007f89f99c4a52 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #21 0x00007f89f99c507d in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #22 0x00007f89f75672fa in QMetaObject::activate (sender=0x1daa610, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3717
      #23 0x00007f89f99abc25 in KIO::SlaveInterface::listEntries(QList<KIO::UDSEntry> const&) () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #24 0x00007f89f99aead2 in KIO::SlaveInterface::dispatch(int, QByteArray const&) () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #25 0x00007f89f99ac157 in KIO::SlaveInterface::dispatch() () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #26 0x00007f89f99b0741 in KIO::Slave::gotInput() () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #27 0x00007f89f9a2c835 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #28 0x00007f89f75672fa in QMetaObject::activate (sender=0x1d90440, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3717
      #29 0x00007f89f995de03 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
      #30 0x00007f89f75681c1 in QObject::event (this=0x1d90440, e=<optimized out>) at kernel/qobject.cpp:1245
      #31 0x00007f89f8014b8c in QApplicationPrivate::notify_helper (this=this@entry=0x175c8a0, receiver=receiver@entry=0x1d90440, e=e@entry=0x218fb10) at kernel/qapplication.cpp:3720
      #32 0x00007f89f801a230 in QApplication::notify (this=0x7ffd817fc5b0, receiver=0x1d90440, e=0x218fb10) at kernel/qapplication.cpp:3503
      #33 0x00007f89f7536a8b in QCoreApplication::notifyInternal (this=0x7ffd817fc5b0, receiver=0x1d90440, event=event@entry=0x218fb10) at kernel/qcoreapplication.cpp:935
      #34 0x00007f89f7538bc7 in QCoreApplication::sendEvent (event=0x218fb10, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:228
      ---Type <return> to continue, or q <return> to quit---
      #35 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x1753540) at kernel/qcoreapplication.cpp:1552
      #36 0x00007f89f75390f8 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1410
      #37 0x00007f89f758da23 in postEventSourceDispatch (s=0x1793760) at kernel/qeventdispatcher_glib.cpp:271
      #38 0x00007f89f30c7fe7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #39 0x00007f89f30c8240 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #40 0x00007f89f30c82ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #41 0x00007f89f758de2f in QEventDispatcherGlib::processEvents (this=0x179c100, flags=...) at kernel/qeventdispatcher_glib.cpp:418
      #42 0x00007f89f75342ca in QEventLoop::exec (this=this@entry=0x7ffd817fb7a0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
      #43 0x00007f89f8208e4d in QDialog::exec (this=0x1b28b70) at dialogs/qdialog.cpp:541
      #44 0x00007f89e0fb3c1f in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlatformTheme.so
      #45 0x00007f89f8208d0a in QDialog::exec (this=this@entry=0x7ffd817fb930) at dialogs/qdialog.cpp:537
      #46 0x00007f89f821a818 in QFileDialog::getOpenFileUrls (parent=0x180d480, caption=..., dir=..., filter=..., selectedFilter=0x0, options=..., supportedSchemes=...)
          at dialogs/qfiledialog.cpp:2260
      #47 0x00007f89fa9ed1be in ?? () from /usr/lib/x86_64-linux-gnu/libkdeinit5_kwrite.so
      #48 0x00007f89f75672fa in QMetaObject::activate (sender=sender@entry=0x19e4520, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=1, 
          argv=argv@entry=0x7ffd817fbba0) at kernel/qobject.cpp:3717
      #49 0x00007f89f7567af7 in QMetaObject::activate (sender=sender@entry=0x19e4520, m=m@entry=0x7f89f850bc80 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, 
          argv=argv@entry=0x7ffd817fbba0) at kernel/qobject.cpp:3582
      #50 0x00007f89f800b172 in QAction::triggered (this=this@entry=0x19e4520, _t1=false) at .moc/moc_qaction.cpp:360
      #51 0x00007f89f800d618 in QAction::activate (this=0x19e4520, event=<optimized out>) at kernel/qaction.cpp:1167
      #52 0x00007f89f800dc2f in QAction::event (this=<optimized out>, e=<optimized out>) at kernel/qaction.cpp:1095
      #53 0x00007f89f8014b8c in QApplicationPrivate::notify_helper (this=this@entry=0x175c8a0, receiver=receiver@entry=0x19e4520, e=e@entry=0x7ffd817fbe60) at kernel/qapplication.cpp:3720
      #54 0x00007f89f801a230 in QApplication::notify (this=0x7ffd817fc5b0, receiver=0x19e4520, e=0x7ffd817fbe60) at kernel/qapplication.cpp:3503
      #55 0x00007f89f7536a8b in QCoreApplication::notifyInternal (this=0x7ffd817fc5b0, receiver=0x19e4520, event=event@entry=0x7ffd817fbe60) at kernel/qcoreapplication.cpp:935
      #56 0x00007f89f7a922a8 in QCoreApplication::sendEvent (event=0x7ffd817fbe60, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:228
      #57 QShortcutMap::dispatchEvent (this=this@entry=0x175c980, e=e@entry=0x7ffd817fc0e0) at kernel/qshortcutmap.cpp:681
      #58 0x00007f89f7a923e1 in QShortcutMap::tryShortcutEvent (this=0x175c980, o=<optimized out>, e=e@entry=0x7ffd817fc0e0) at kernel/qshortcutmap.cpp:352
      #59 0x00007f89f801a128 in QApplication::notify (this=0x7ffd817fc5b0, receiver=0x1969220, e=0x7ffd817fc0e0) at kernel/qapplication.cpp:3147
      #60 0x00007f89f7536a8b in QCoreApplication::notifyInternal (this=0x7ffd817fc5b0, receiver=receiver@entry=0x1969220, event=event@entry=0x7ffd817fc0e0) at kernel/qcoreapplication.cpp:935
      #61 0x00007f89f7a66087 in QCoreApplication::sendSpontaneousEvent (event=0x7ffd817fc0e0, receiver=0x1969220) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
      #62 QGuiApplicationPrivate::processKeyEvent (e=0x180bca0) at kernel/qguiapplication.cpp:1871
      #63 0x00007f89f7a6b015 in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0x180bca0) at kernel/qguiapplication.cpp:1579
      #64 0x00007f89f7a50628 in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:572
      #65 0x00007f89e3b24af0 in userEventSourceDispatch (source=<optimized out>) at eventdispatchers/qeventdispatcher_glib.cpp:70
      #66 0x00007f89f30c7fe7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #67 0x00007f89f30c8240 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      ---Type <return> to continue, or q <return> to quit---
      #68 0x00007f89f30c82ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #69 0x00007f89f758de2f in QEventDispatcherGlib::processEvents (this=0x179c100, flags=...) at kernel/qeventdispatcher_glib.cpp:418
      #70 0x00007f89f75342ca in QEventLoop::exec (this=this@entry=0x7ffd817fc3b0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
      #71 0x00007f89f753be3c in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1188
      #72 0x00007f89fa9e8736 in kdemain () from /usr/lib/x86_64-linux-gnu/libkdeinit5_kwrite.so
      #73 0x00007f89fa655b45 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
      #74 0x000000000040074e in _start ()
      

      I'm guessing there's some issue with the EINTR_LOOP macro, but I'm not familiar with Qt internals.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dfaure_kdab David Faure
            iliakats Ilia Kats
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes