Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProcess waitForFinished crashed
Forum Updated to NodeBB v4.3 + New Features

QProcess waitForFinished crashed

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 501 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    terryGGG
    wrote on last edited by
    #1

    My program crashed. After I dump the exe and Qt5Core.qt_crash.png dll I found it was crashed at QProcess.waitForFinished.
    Here is my code, I use Qprocess to execute a command and wait it finished.
    It doesn't crash every time, the crash possibility may lower than 0.1%.

    ```
    

    QProcess cmd = new QProcess(this);
    cmd->start("some command");
    cmd->waitForStarted();
    cmd->waitForFinished(-1);

    JonBJ 1 Reply Last reply
    0
    • T terryGGG

      My program crashed. After I dump the exe and Qt5Core.qt_crash.png dll I found it was crashed at QProcess.waitForFinished.
      Here is my code, I use Qprocess to execute a command and wait it finished.
      It doesn't crash every time, the crash possibility may lower than 0.1%.

      ```
      

      QProcess cmd = new QProcess(this);
      cmd->start("some command");
      cmd->waitForStarted();
      cmd->waitForFinished(-1);

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @terryGGG

      It doesn't crash every time, the crash possibility may lower than 0.1%.

      I don't think anyone will be able to solve this for you from what you show. And you do not say what version of Qt you are using, which might be relevant.

      Write yourself a standalone program, as minimal as possible [~20 lines?], which just does your code, 10,000 times in a loop. Make the command something simple & harmless, say dir or echo hello. Does it crash? Does it matter what the command is?

      If you do get a crash: get rid of both

      cmd->waitForStarted();
      cmd->waitForFinished(-1);
      

      and replace with the QProcess signal/slots equivalent, so no waitFor...() calls, which can be "dodgy", especially potentially under Windows. Does that crash?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved