Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-209

A race bug in ProcessManager::spawn in libprocess.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.9.0
    • 0.10.0
    • c++ api
    • All platforms.

    Description

      This is a race bug found in ProcessManager::spawn in libprocess. Below is the description of this bug.

      ------------------------------------------------------------------------------------------------------
      UPID ProcessManager::spawn(ProcessBase* process, bool manage)
      {
      ...

      // Use the garbage collector if requested.
      if (manage)

      { dispatch(gc, &GarbageCollector::manage<ProcessBase>, process); }

      // Add process to the run queue (so 'initialize' will get invoked).
      enqueue(process);

      VLOG(2) << "Spawned process " << process->self();

      return process->self();
      }
      ------------------------------------------------------------------------------------------------------

      If a user spawns a process which is very short and sets 'manage' to true. It is likely that the pointer 'process' becomes a dangling pointer after enqueue(..) is called. As a result, a random segfault will be thrown when 'process->self()' is called.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jieyu Jie Yu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified