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

QProcess dead lock on kernel-4.18.0-358

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P1: Critical
    • None
    • 5.15.2
    • Core: I/O
    • None
    • Linux/X11

    Description

      My GUI Application is freezed by a dead lock in QProcess with kernel 4.18.0-358.el8.x86_64, no problem with others kernels such as revisions 4.18.0-348.el8.x86_64 or 4.18.0-338.el8.x86_64.

      I have reproduced the bug with a simple use case : a GUI application with only a push button to start a QProcess to tail a code file.

      The pstack shows the lock after button click :

      Thread 1 (Thread 0x7fa1903101c0 (LWP 1335)):
      #0 0x00007fa18d7498cd in syscall () from /lib64/libc.so.6
      #1 0x00007fa18eaf7f1c in forkfd_wait4 () from /lib64/libQt5Core.so.5
      #2 0x00007fa18eadbf24 in QProcessPrivate::waitForDeadChild() () from /lib64/libQt5Core.so.5
      #3 0x00007fa18ead5fea in QProcessPrivate::_q_processDied() () from /lib64/libQt5Core.so.5
      #4 0x00007fa18ead62e9 in QProcess::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /lib64/libQt5Core.so.5
      #5 0x00007fa18eb80bb0 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
      #6 0x00007fa18eb8354a in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () from /lib64/libQt5Core.so.5
      #7 0x00007fa18eb83d35 in QSocketNotifier::event(QEvent*) () from /lib64/libQt5Core.so.5
      #8 0x00007fa18f9dc1e2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
      #9 0x00007fa18f9e2f90 in QApplication::notify(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
      #10 0x00007fa18eb4d6f2 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
      #11 0x00007fa18eba2597 in socketNotifierSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5Core.so.5
      #12 0x00007fa189f5d95d in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
      #13 0x00007fa189f5dd18 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
      #14 0x00007fa189f5ddb0 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
      #15 0x00007fa18eba1c64 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
      #16 0x00007fa18eb4c3eb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
      #17 0x00007fa18eb54844 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
      #18 0x0000000000402b82 in main ()
      

      MainWindows.cpp :

      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      MainWindow::MainWindow(QWidget *parent)
       : QMainWindow(parent), ui(new Ui::MainWindow)
      {
       ui->setupUi(this);
      }
      MainWindow::~MainWindow()
      {
       delete ui;
      }
      void MainWindow::on_pushButton_clicked()
      {
       QStringList arguments;
       arguments << "-f" << "-n5000" << qApp->applicationDirPath() + "/main.cpp";
       process.start("tail", arguments);
      }
      

      Find attached a project to reproduce this bug.

      Attachments

        1. qprocess_freeze.tar
          10 kB
        2. qprocess_without_gui.tar
          10 kB
        3. qtbug-100174_strace_348.txt
          6 kB
        4. qtbug-100174_strace_358.txt
          4 kB
        5. qtbug-100174.tar.gz
          13 kB
        6. qtbug-100174-2_strace_348.txt
          6 kB
        7. qtbug-100174-2_strace_358.txt
          4 kB
        8. qtbug-100174-2.tar.gz
          13 kB
        9. qtbug-100174-3_strace_348.txt
          6 kB
        10. qtbug-100174-3_strace_358.txt
          4 kB
        11. qtbug-100174-3.tar.gz
          13 kB
        12. qtbug-100174-4_strace_348.txt
          17 kB
        13. qtbug-100174-4_strace_358.txt
          15 kB
        14. qtbug-100174-4.tar.gz
          14 kB
        15. strace_348_no_bug.txt
          43 kB
        16. strace_358_bug.txt
          42 kB

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              yoann_dev yoann_dev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes