[ 
https://issues.apache.org/jira/browse/MESOS-8096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16604170#comment-16604170
 ] 

Alexander Rukletsov edited comment on MESOS-8096 at 9/25/18 12:23 PM:
----------------------------------------------------------------------

Might be related to this issue, from {{clang-analyzer}}, courtesy of [~mcypark]:
{noformat}
src/scheduler/scheduler.cpp:911:5: warning: Call to virtual function during 
destruction will not dispatch to derived class 
[clang-analyzer-optin.cplusplus.VirtualCall]
    stop();
    ^
{noformat}
Likely a hypothetical control flow starting from 
{{src/tests/http_fault_tolerance_tests.cpp:872}}
{noformat}
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1272:5:
 warning: Use of memory after it is freed [clang-analyzer-cplusplus.NewDelete]
    return function_mocker_->AddNewExpectation(
    ^
/tmp/SRC/src/tests/http_fault_tolerance_tests.cpp:872:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(*scheduler, connected(_))
  ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1845:32:
 note: expanded from macro 'EXPECT_CALL'
#define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)
                               ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1844:5:
 note: expanded from macro 'GMOCK_EXPECT_CALL_IMPL_'
    ((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call)
    ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1272:12:
 note: Calling 'FunctionMockerBase::AddNewExpectation'
    return function_mocker_->AddNewExpectation(
           ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1609:9:
 note: Memory is allocated
        new TypedExpectation<F>(this, file, line, source_text, m);
        ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1615:9:
 note: Assuming 'implicit_sequence' is equal to NULL
    if (implicit_sequence != NULL) {
        ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1615:5:
 note: Taking false branch
    if (implicit_sequence != NULL) {
    ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1619:13:
 note: Calling '~linked_ptr'
    return *expectation;
            ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h:153:19:
 note: Calling 'linked_ptr::depart'
  ~linked_ptr() { depart(); }
                  ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h:205:5:
 note: Taking true branch
    if (link_.depart()) delete value_;
    ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h:205:25:
 note: Memory is released
    if (link_.depart()) delete value_;
                        ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h:153:19:
 note: Returning; memory was released
  ~linked_ptr() { depart(); }
                  ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1619:13:
 note: Returning from '~linked_ptr'
    return *expectation;
            ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1272:12:
 note: Returning; memory was released
    return function_mocker_->AddNewExpectation(
           ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1272:5:
 note: Use of memory after it is freed
    return function_mocker_->AddNewExpectation(
    ^
{noformat}
There are what seems to be equivalent output for the following places:
{noformat}
/tmp/SRC/src/tests/uri_fetcher_tests.cpp:140:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(server, test(_))
  ^
{noformat}
{noformat}
/tmp/SRC/src/tests/default_executor_tests.cpp:2042:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(*scheduler, connected(_))
  ^
{noformat}
{noformat}
/tmp/SRC/src/tests/scheduler_tests.cpp:2037:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(*scheduler, connected(_))
  ^
{noformat}
{noformat}
/tmp/SRC/src/tests/fetcher_tests.cpp:535:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(*http.process, test(_))
  ^
{noformat}
Of all the {{EXPECT_CALL}} s in the codebase, these are the only instances that 
are pointed out. It is still unclear that there's an issue here, but it seems 
worth checking out, especially since these files are known-flaky.


was (Author: alexr):
Might be related to this issue, from {{clang-analyzer}}, courtesy [~mcypark]:
{noformat}
src/scheduler/scheduler.cpp:911:5: warning: Call to virtual function during 
destruction will not dispatch to derived class 
[clang-analyzer-optin.cplusplus.VirtualCall]
    stop();
    ^
{noformat}
Likely a hypothetical control flow starting from 
{{src/tests/http_fault_tolerance_tests.cpp:872}}
{noformat}
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1272:5:
 warning: Use of memory after it is freed [clang-analyzer-cplusplus.NewDelete]
    return function_mocker_->AddNewExpectation(
    ^
/tmp/SRC/src/tests/http_fault_tolerance_tests.cpp:872:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(*scheduler, connected(_))
  ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1845:32:
 note: expanded from macro 'EXPECT_CALL'
#define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)
                               ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1844:5:
 note: expanded from macro 'GMOCK_EXPECT_CALL_IMPL_'
    ((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call)
    ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1272:12:
 note: Calling 'FunctionMockerBase::AddNewExpectation'
    return function_mocker_->AddNewExpectation(
           ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1609:9:
 note: Memory is allocated
        new TypedExpectation<F>(this, file, line, source_text, m);
        ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1615:9:
 note: Assuming 'implicit_sequence' is equal to NULL
    if (implicit_sequence != NULL) {
        ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1615:5:
 note: Taking false branch
    if (implicit_sequence != NULL) {
    ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1619:13:
 note: Calling '~linked_ptr'
    return *expectation;
            ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h:153:19:
 note: Calling 'linked_ptr::depart'
  ~linked_ptr() { depart(); }
                  ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h:205:5:
 note: Taking true branch
    if (link_.depart()) delete value_;
    ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h:205:25:
 note: Memory is released
    if (link_.depart()) delete value_;
                        ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googletest/include/gtest/internal/gtest-linked_ptr.h:153:19:
 note: Returning; memory was released
  ~linked_ptr() { depart(); }
                  ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1619:13:
 note: Returning from '~linked_ptr'
    return *expectation;
            ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1272:12:
 note: Returning; memory was released
    return function_mocker_->AddNewExpectation(
           ^
/BUILD/3rdparty/googletest-1.8.0/src/googletest-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1272:5:
 note: Use of memory after it is freed
    return function_mocker_->AddNewExpectation(
    ^
{noformat}
There are what seems to be equivalent output for the following places:
{noformat}
/tmp/SRC/src/tests/uri_fetcher_tests.cpp:140:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(server, test(_))
  ^
{noformat}
{noformat}
/tmp/SRC/src/tests/default_executor_tests.cpp:2042:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(*scheduler, connected(_))
  ^
{noformat}
{noformat}
/tmp/SRC/src/tests/scheduler_tests.cpp:2037:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(*scheduler, connected(_))
  ^
{noformat}
{noformat}
/tmp/SRC/src/tests/fetcher_tests.cpp:535:3: note: Calling 
'MockSpec::InternalExpectedAt'
  EXPECT_CALL(*http.process, test(_))
  ^
{noformat}
Of all the {{EXPECT_CALL}} s in the codebase, these are the only instances that 
are pointed out. It is still unclear that there's an issue here, but it seems 
worth checking out, especially since these files are known-flaky.

> Enqueueing events in MockHTTPScheduler can lead to segfaults.
> -------------------------------------------------------------
>
>                 Key: MESOS-8096
>                 URL: https://issues.apache.org/jira/browse/MESOS-8096
>             Project: Mesos
>          Issue Type: Bug
>          Components: scheduler driver, test
>         Environment: Fedora 23, Ubuntu 14.04, Ubuntu 16
>            Reporter: Alexander Rukletsov
>            Assignee: Alexander Rukletsov
>            Priority: Major
>              Labels: flaky-test, mesosphere
>         Attachments: AsyncExecutorProcess-badrun-1.txt, 
> AsyncExecutorProcess-badrun-2.txt, AsyncExecutorProcess-badrun-3.txt, 
> mesos-8096-1.txt, mesos-8096-2.txt, mesos-8096-3.txt, 
> scheduler-shutdown-invalid-driver-2.txt, scheduler-shutdown-invalid-driver.txt
>
>
> Various tests segfault due to a yet unknown reason. Comparing logs (attached) 
> hints that the problem might be in the scheduler's event queue.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to