Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-2743

A process spawned by Subprocess::Start() can deadlock

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 0.7.0, 0.7.1, 0.8.0, 0.9.0, 0.9.1, 0.10.0, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.7.1, 1.9.0, 1.10.0
    • Fix Version/s: 1.10.0
    • Component/s: None
    • Labels:
      None

      Description

      A process spawned by Subprocess::Start() deadlocks under the following conditions:

      • The executable to run does not exists and execvp() returns an error.
      • The child process copied over glog's mutex in locked state from the parent.

      As a general note, it's not safe to call non-async-signal-safe functions in the child process between fork() and exec(). Surprisingly, a call to LOG() locks a mutex that may have been copied from the parent's address space in an already locked state, so it is not async-signal-safe and can deadlock the child if called.

        Attachments

          Activity

            People

            • Assignee:
              aserbin Alexey Serbin
              Reporter:
              aserbin Alexey Serbin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: