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

Tests will dereference stack allocated agent objects upon assertion/expectation failure.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0
    • None
    • Mesosphere Sprint 28, Mesosphere Sprint 29, Mesosphere Sprint 30, Mesosphere Sprint 31
    • 5

    Description

      Tests that use the StartSlave test helper are generally fragile when the test fails an assert/expect in the middle of the test. This is because the StartSlave helper takes raw pointer arguments, which may be stack-allocated.

      In case of an assert failure, the test immediately exits (destroying stack allocated objects) and proceeds onto test cleanup. The test cleanup may dereference some of these destroyed objects, leading to a test crash like:

      [18:27:36][Step 8/8] F0204 18:27:35.981302 23085 logging.cpp:64] RAW: Pure virtual method called
      [18:27:36][Step 8/8]     @     0x7f7077055e1c  google::LogMessage::Fail()
      [18:27:36][Step 8/8]     @     0x7f707705ba6f  google::RawLog__()
      [18:27:36][Step 8/8]     @     0x7f70760f76c9  __cxa_pure_virtual
      [18:27:36][Step 8/8]     @           0xa9423c  mesos::internal::tests::Cluster::Slaves::shutdown()
      [18:27:36][Step 8/8]     @          0x1074e45  mesos::internal::tests::MesosTest::ShutdownSlaves()
      [18:27:36][Step 8/8]     @          0x1074de4  mesos::internal::tests::MesosTest::Shutdown()
      [18:27:36][Step 8/8]     @          0x1070ec7  mesos::internal::tests::MesosTest::TearDown()
      

      The StartSlave helper should take shared_ptr arguments instead.
      This also means that we can remove the Shutdown helper from most of these tests.

      Attachments

        Issue Links

          Activity

            People

              kaysoky Joseph Wu
              kaysoky Joseph Wu
              Michael Park Michael Park
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: