On Fri, 23 Sep 2016, David Drysdale wrote:

I can't reproduce the problem, so could you try doing a non-valgrind debug build and seeing what pops out in the debugger (e.g. libtool --mode=execute gdb ./arestest)? The stack makes it look like a null pointer is being passed down, only it's for a C++ reference rather than a pointer so that seems odd...

I did that too, but I'm completely lost at that point:

$ gdb ./.libs/arestest
(gdb) run

[cut]

[----------] 112 tests from AddressFamilies/MockChannelTest
[ RUN      ] AddressFamilies/MockChannelTest.Basic/0

Program received signal SIGSEGV, Segmentation fault.
testing::internal::FunctionMockerBase<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)>::InvokeWith(std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> const&) (args=std::tuple containing = {...},
    this=0x7a6428) at gmock-1.7.0/include/gmock/gmock-spec-builders.h:1530
1530            this->UntypedInvokeWith(&args))->GetValueAndDelete();
(gdb)

It always stops there, consistently.

(gdb) list
1525      // arguments.  This function can be safely called from multiple
1526      // threads concurrently.
1527      Result InvokeWith(const ArgumentTuple& args)
1528            GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
1529        return static_cast<const ResultHolder*>(
1530            this->UntypedInvokeWith(&args))->GetValueAndDelete();
1531      }
1532
1533      // Adds and returns a default action spec for this mock function.
1534      OnCallSpec<F>& AddNewOnCallSpec(

(gdb) bt
#0 testing::internal::FunctionMockerBase<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
const&, int)>::InvokeWith(std::tuple<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, int> const&) (args=std::tuple containing = {...},
    this=0x7a6428) at gmock-1.7.0/include/gmock/gmock-spec-builders.h:1530
#1 testing::internal::FunctionMocker<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)>::Invoke(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) (a2=1, a1="www.google.com", this=0x7a6428)
    at gmock-1.7.0/include/gmock/gmock-generated-function-mockers.h:118
#2 ares::test::MockServer::OnRequest (gmock_a2=1, gmock_a1=..., this=0x7a6428,
    this@entry=0x7fffffffc4d0) at ares-test.h:133
#3 ares::test::MockServer::ProcessRequest (this=this@entry=0x7a6428, fd=fd@entry=4, addr=addr@entry=0x7fffffffce30, addrlen=16, qid=qid@entry=40528, name="www.google.com", rrtype=1)
    at ares-test.cc:319
#4 0x00000000004173ad in ares::test::MockServer::ProcessFD (this=0x7a6428, fd=fd@entry=4)
    at ares-test.cc:306
#5 0x00000000004174bb in ares::test::MockChannelOptsTest::ProcessFD (this=<optimized out>, fd=4)
    at ares-test.cc:471
#6 0x00000000004164c3 in std::function<void (int)>::operator()(int) const (__args#0=<optimized out>,
    this=0x7fffffffd8d0) at /usr/include/c++/6/functional:2136
#7 ares::test::ProcessWork(ares_channeldata*, std::function<std::set<int, std::less<int>, std::allocator<int> > ()>, std::function<void (int)>) (channel=0x7a6d80, get_extrafds=..., process_extra=...)
    at ares-test.cc:77
#8 0x0000000000416742 in ares::test::MockChannelOptsTest::Process (this=this@entry=0x7a6090)
    at ares-test.cc:479
#9 0x00000000004a30fa in ares::test::MockChannelTest_Basic_Test::TestBody (this=0x7a6090)
    at ares-test-mock.cc:46
#10 0x0000000000515094 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (location=0x536b1a "the test body", method=<optimized out>, object=<optimized out>)
    at gmock-1.7.0/gtest/src/gtest.cc:2078


Any idea what I should try there?

--

 / daniel.haxx.se

Reply via email to