[Merge] lp:~gary-wzl77/net-cpp/dual_landing_support into lp:net-cpp

James Henstridge james.henstridge at canonical.com
Wed Aug 17 08:21:38 UTC 2016


Review: Needs Fixing

It looks like this isn't binary compatible yet.  I did the following:

1. pulled this branch and built it using RelWithDebInfo build type.

2. Grabbed the latest package version and did likewise:

    dget https://launchpad.net/ubuntu/+archive/primary/+files/net-cpp_2.0.0-0ubuntu2.dsc

I modified the top-level CMakeLists.txt to disable -Werror rather than trying to fix the warnings that have already been addressed in this branch.

3. replaced the libnet-cpp.so.2 in my net-cpp-2.0.0 build tree with a symlink to the library in dual_landing_support, and then ran the tests.

The result was http_streaming_client_test segfaulting.

I rebuilt both libraries with "-fvisibility=hidden" removed from the compile flags to see if I could get better information from abigail, which gave me the following diff: http://paste.ubuntu.com/23063717/

So this is showing all the virtuals from StreamingClient have been offset by two in the vtable in the new version of the library.  I'm kind of surprised this didn't show up when we checked it back on Friday, so this might be a limitation in Abigail.

I think the only way we can work around this is to make the two new methods on Client into normal non-virtual methods.  Their implementation would effectively do manual dynamic dispatch.  Something like:

std::shared_ptr<http::Request> http::Client::post(const http::Request::Configuration& configuration, std::istream& payload, std::size_t size)
{
    auto *curl_client = dynamic_cast<http::impl::curl::Client*>(this);
    if (curl_client)
    {
        return curl_client->post(configuration, payload, size);
    }
    throw some_exception(...);
}

It'd probably be best to put these thunks in a separate file to the other methods from client.cpp, and add a FIXME noting the problem.

-- 
https://code.launchpad.net/~gary-wzl77/net-cpp/dual_landing_support/+merge/302671
Your team Ubuntu Phablet Team is subscribed to branch lp:net-cpp.



More information about the Ubuntu-reviews mailing list