In an attempt to diagnose this more, I ran the vs-thumb sub-processes
with strace and still managed to reproduce the problem.

Here is the code snippet that runs when we don't hear back from a sub-
process within ten seconds. (Please forgive the filthy code; this is the
result of endless hacking around trying to narrow down the problem.)

    qDebug() << "timeout, state =" << process_.state();
    if (process_.state() != QProcess::NotRunning)
    {
        qDebug() << "killing process" << process_.pid();
        int rc = kill(process_.processId(), SIGKILL);
        assert(rc == 0);
        //process_.kill();
    }
    int status;
    qDebug() << "calling waitpid for process" << process_.pid();
    int rc = waitpid(process_.pid(), &status, 0);
    qDebug() << "waitpid for process" << process_.pid() << "returned";
    qDebug() << "waitpid() returned" << rc;
    error_ = exe_path_.toStdString() + " (pid " + to_string(process_.pid()) + 
") did not return after " +
             to_string(timeout_ms_) + " milliseconds";

So, we call kill(), immediately followed by waitpid(). Here is the trace
I see when the problem happens:

thumbnailer-service: [02:28:39.385] timeout, state = 2
thumbnailer-service: [02:28:39.385] killing process 16965
thumbnailer-service: [02:28:39.386] calling waitpid for process 16965
Changing to state PAUSED
Changing to state PAUSED
thumbnailer-service: [02:29:09.395] waitpid for process 16965 returned
thumbnailer-service: [02:29:09.396] waitpid() returned 16965

(Ignore the two "Changing state" messages; these are from other vs-thumb
processes that are still running.)

Note the time stamps: we sent the kill at 28:39, but waitpid doesn't
return until 30 seconds later.

While things are hanging like this, the process sits as a zombie in the
process table.

I've attached the strace log. The last line shows that the process was
killed (also 30 seconds late), at the time waitpid() returned.

** Attachment added: "vs-thumb.strace.16965"
   
https://bugs.launchpad.net/ubuntu/+source/gstreamer1.0/+bug/1466273/+attachment/4420215/+files/vs-thumb.strace.16965

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1466273

Title:
  gstreamer fails intermittently

To manage notifications about this bug go to:
https://bugs.launchpad.net/thumbnailer/+bug/1466273/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to