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

Race condition in libevent poll implementation causes crash

    Details

    • Sprint:
      Mesosphere Sprint 29

      Description

      The issue first arose in MESOS-3271, but can be reproduced every time by using the mentioned environment and running:

      sudo ./bin/mesos-tests.sh --gtest_filter="MemoryPressureMesosTest.CGROUPS_ROOT_SlaveRecovery" --gtest_repeat=1000
      

      The problem can be traced back to libevent_poll.cpp. If the event is triggered and the the future associated with the event is discarded, the situation arises in which pollCallback() starts executing just early enough to finish before pollDiscard() executes. If that happens, pollCallback() deletes the poll object and pollDiscard() is left with a dangling pointer which crashes when it executes the line event_active(ev, EV_READ, 0);.

        Issue Links

          Activity

          Hide
          arojas Alexander Rojas added a comment -

          r/43799/: Removed race condition from libevent based poll implementation.

          Show
          arojas Alexander Rojas added a comment - r/43799/ : Removed race condition from libevent based poll implementation.
          Hide
          jvanremoortere Joris Van Remoortere added a comment -
          commit 16aa038949741f4dc6bf43423dc0340f869605ce
          Author: Alexander Rojas <alexander@mesosphere.io>
          Date:   Fri Feb 26 17:17:50 2016 -0800
          
              Removed race condition from libevent based poll implementation.
              
              Under certains circumstances, the future returned by poll is discarded
              right after the event is triggered, this causes the event callback to be
              called before the discard callback which results in an abort signal
              being raised by the libevent library.
              
              Review: https://reviews.apache.org/r/43799/
          
          Show
          jvanremoortere Joris Van Remoortere added a comment - commit 16aa038949741f4dc6bf43423dc0340f869605ce Author: Alexander Rojas <alexander@mesosphere.io> Date: Fri Feb 26 17:17:50 2016 -0800 Removed race condition from libevent based poll implementation. Under certains circumstances, the future returned by poll is discarded right after the event is triggered, this causes the event callback to be called before the discard callback which results in an abort signal being raised by the libevent library. Review: https: //reviews.apache.org/r/43799/

            People

            • Assignee:
              arojas Alexander Rojas
              Reporter:
              arojas Alexander Rojas
              Shepherd:
              Joris Van Remoortere
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development

                  Agile