Mir

Valgrind failure on mir_acceptance_tests - leak on incoming buffer in Requests::free_buffer(int)

Bug #1628794 reported by Daniel van Vugt
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
High
Daniel van Vugt
mir (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Valgrind failure on mir_acceptance_tests - leak in mir::client::BufferVault::wire_transfer_inbound(int)

It's happened twice now. Yesterday on kdub's branch and today on mine:

05:20:36 9: ==2515== 80 (32 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 20 of 37
05:20:36 9: ==2515== at 0x4C2D1AF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
05:20:36 9: ==2515== by 0x54C74F2: NewCallback<mir::protobuf::Void *> (callback.h:412)
05:20:36 9: ==2515== by 0x54C74F2: (anonymous namespace)::Requests::free_buffer(int) (buffer_stream.cpp:274)
05:20:36 9: ==2515== by 0x54CDB88: free_buffer (buffer_vault.cpp:111)
05:20:36 9: ==2515== by 0x54CDB88: mir::client::BufferVault::wire_transfer_inbound(int) (buffer_vault.cpp:265)
05:20:36 9: ==2515== by 0x54D11DD: operator() (functional:2136)
05:20:36 9: ==2515== by 0x54D11DD: mir::client::AtomicCallback<>::operator()() const (atomic_callback.h:56)
05:20:36 9: ==2515== by 0x54E1128: mir::client::rpc::MirProtobufRpcChannel::process_event_sequence(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (mir_protobuf_rpc_channel.cpp:341)
05:20:36 9: ==2515== by 0x54E2208: mir::client::rpc::MirProtobufRpcChannel::on_data_available() (mir_protobuf_rpc_channel.cpp:470)
05:20:36 9: ==2515== by 0x54E68AD: operator()<std::shared_ptr<mir::client::rpc::StreamTransport::Observer> > (stream_socket_transport.cpp:40)
05:20:36 9: ==2515== by 0x54E68AD: std::_Function_handler<void (std::shared_ptr<mir::client::rpc::StreamTransport::Observer> const&), mir::client::rpc::TransportObservers::on_data_available()::$_0>::_M_invoke(std::_Any_data const&, std::shared_ptr<mir::client::rpc::StreamTransport::Observer> const&) (functional:1740)
05:20:36 9: ==2515== by 0x54E6B7F: operator() (functional:2136)
05:20:36 9: ==2515== by 0x54E6B7F: mir::ThreadSafeList<std::shared_ptr<mir::client::rpc::StreamTransport::Observer> >::for_each(std::function<void (std::shared_ptr<mir::client::rpc::StreamTransport::Observer> const&)> const&) (thread_safe_list.h:80)
05:20:36 9: ==2515== by 0x54E679D: on_data_available (stream_socket_transport.cpp:40)
05:20:36 9: ==2515== by 0x54E679D: mir::client::rpc::StreamSocketTransport::dispatch(unsigned int) (stream_socket_transport.cpp:208)
05:20:36 9: ==2515== by 0x5B700E3: mir::dispatch::MultiplexingDispatchable::dispatch(unsigned int) (multiplexing_dispatchable.cpp:210)
05:20:36 9: ==2515== by 0x5B700E3: mir::dispatch::MultiplexingDispatchable::dispatch(unsigned int) (multiplexing_dispatchable.cpp:210)
05:20:36 9: ==2515== by 0x5B726B6: (anonymous namespace)::dispatch_loop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<mir::dispatch::ThreadedDispatcher::ThreadShutdownRequestHandler>, std::shared_ptr<mir::dispatch::Dispatchable>, std::function<void ()> const&) (threaded_dispatcher.cpp:211)
05:20:36 9: ==2515== by 0x5B7684E: void std::_Bind_simple<void (*(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mir::dispatch::ThreadedDispatcher::ThreadShutdownRequestHandler>, std::shared_ptr<mir::dispatch::MultiplexingDispatchable>, std::function<void ()>))(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<mir::dispatch::ThreadedDispatcher::ThreadShutdownRequestHandler>, std::shared_ptr<mir::dispatch::Dispatchable>, std::function<void ()> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) (functional:1399)
05:20:36 9: ==2515== by 0x695350E: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
05:20:36 9: ==2515== by 0x6E3E709: start_thread (pthread_create.c:333)
05:20:36 9: ==2515== by 0x715D0FE: clone (clone.S:105)
05:20:36 9: ==2515==
05:20:36 9: ==2515== 80 (32 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 21 of 37
05:20:36 9: ==2515== at 0x4C2D1AF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
05:20:36 9: ==2515== by 0x54C7363: NewCallback<mir::protobuf::Void *> (callback.h:412)
05:20:36 9: ==2515== by 0x54C7363: (anonymous namespace)::Requests::allocate_buffer(mir::geometry::Size, MirPixelFormat, int) (buffer_stream.cpp:262)
05:20:36 9: ==2515== by 0x54CDBE8: alloc_buffer (buffer_vault.cpp:106)
05:20:36 9: ==2515== by 0x54CDBE8: mir::client::BufferVault::wire_transfer_inbound(int) (buffer_vault.cpp:267)
05:20:36 9: ==2515== by 0x54D11DD: operator() (functional:2136)
05:20:36 9: ==2515== by 0x54D11DD: mir::client::AtomicCallback<>::operator()() const (atomic_callback.h:56)
05:20:36 9: ==2515== by 0x54E1128: mir::client::rpc::MirProtobufRpcChannel::process_event_sequence(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (mir_protobuf_rpc_channel.cpp:341)
05:20:36 9: ==2515== by 0x54E2208: mir::client::rpc::MirProtobufRpcChannel::on_data_available() (mir_protobuf_rpc_channel.cpp:470)
05:20:36 9: ==2515== by 0x54E68AD: operator()<std::shared_ptr<mir::client::rpc::StreamTransport::Observer> > (stream_socket_transport.cpp:40)
05:20:36 9: ==2515== by 0x54E68AD: std::_Function_handler<void (std::shared_ptr<mir::client::rpc::StreamTransport::Observer> const&), mir::client::rpc::TransportObservers::on_data_available()::$_0>::_M_invoke(std::_Any_data const&, std::shared_ptr<mir::client::rpc::StreamTransport::Observer> const&) (functional:1740)
05:20:36 9: ==2515== by 0x54E6B7F: operator() (functional:2136)
05:20:36 9: ==2515== by 0x54E6B7F: mir::ThreadSafeList<std::shared_ptr<mir::client::rpc::StreamTransport::Observer> >::for_each(std::function<void (std::shared_ptr<mir::client::rpc::StreamTransport::Observer> const&)> const&) (thread_safe_list.h:80)
05:20:36 9: ==2515== by 0x54E679D: on_data_available (stream_socket_transport.cpp:40)
05:20:36 9: ==2515== by 0x54E679D: mir::client::rpc::StreamSocketTransport::dispatch(unsigned int) (stream_socket_transport.cpp:208)
05:20:36 9: ==2515== by 0x5B700E3: mir::dispatch::MultiplexingDispatchable::dispatch(unsigned int) (multiplexing_dispatchable.cpp:210)
05:20:36 9: ==2515== by 0x5B700E3: mir::dispatch::MultiplexingDispatchable::dispatch(unsigned int) (multiplexing_dispatchable.cpp:210)
05:20:36 9: ==2515== by 0x5B726B6: (anonymous namespace)::dispatch_loop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<mir::dispatch::ThreadedDispatcher::ThreadShutdownRequestHandler>, std::shared_ptr<mir::dispatch::Dispatchable>, std::function<void ()> const&) (threaded_dispatcher.cpp:211)
05:20:36 9: ==2515== by 0x5B7684E: void std::_Bind_simple<void (*(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<mir::dispatch::ThreadedDispatcher::ThreadShutdownRequestHandler>, std::shared_ptr<mir::dispatch::MultiplexingDispatchable>, std::function<void ()>))(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<mir::dispatch::ThreadedDispatcher::ThreadShutdownRequestHandler>, std::shared_ptr<mir::dispatch::Dispatchable>, std::function<void ()> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) (functional:1399)
05:20:36 9: ==2515== by 0x695350E: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
05:20:36 9: ==2515== by 0x6E3E709: start_thread (pthread_create.c:333)
05:20:36 9: ==2515== by 0x715D0FE: clone (clone.S:105)
05:20:36 9: ==2515==
05:20:36 9: ==2515== LEAK SUMMARY:
05:20:36 9: ==2515== definitely lost: 64 bytes in 2 blocks
05:20:36 9: ==2515== indirectly lost: 96 bytes in 2 blocks
05:20:36 9: ==2515== possibly lost: 0 bytes in 0 blocks
05:20:36 9: ==2515== still reachable: 26,125 bytes in 34 blocks
05:20:36 9: ==2515== suppressed: 0 bytes in 0 blocks
05:20:36 9: ==2515== Reachable blocks (those to which a pointer was found) are not shown.
05:20:36 9: ==2515== To see them, rerun with: --leak-check=full --show-leak-kinds=all
05:20:36 9: ==2515==
05:20:36 9: ==2515== For counts of detected and suppressed errors, rerun with: -v
05:20:36 9: ==2515== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
05:20:36 9/32 Test #9: mir_acceptance_tests ..............................***Failed 164.56 sec

https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2341/consoleFull
https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2363/consoleFull

Tags: testsfail

Related branches

Changed in mir:
milestone: none → 0.25.0
status: New → Confirmed
tags: added: ci-blocker
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

We've landed a lot rather rapidly this week. Is this a regression caused by one of those?

Changed in mir:
assignee: nobody → Alexandros Frantzis (afrantzis)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Can't reproduce locally.

Changed in mir:
assignee: Alexandros Frantzis (afrantzis) → nobody
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
tags: removed: ci-blocker
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Valgrind failure on mir_acceptance_tests - leak on incoming buffer in Requests::free_buffer(int) (buffer_stream.cpp:274)
summary: - Valgrind failure on mir_acceptance_tests - leak in
- mir::client::BufferVault::wire_transfer_inbound(int)
+ Valgrind failure on mir_acceptance_tests - leak on incoming buffer in
+ Requests::free_buffer(int) (buffer_stream.cpp:274)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

And again:

07:43:24 11: ==21085== 192 (64 direct, 128 indirect) bytes in 2 blocks are definitely lost in loss record 24 of 36
07:43:24 11: ==21085== at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
07:43:24 11: ==21085== by 0x41269F2: google::protobuf::Closure* google::protobuf::NewCallback<mir::protobuf::Void*>(void (*)(mir::protobuf::Void*), mir::protobuf::Void*) (common.h:1030)
07:43:24 11: ==21085== by 0x4121780: (anonymous namespace)::Requests::free_buffer(int) (buffer_stream.cpp:89)
07:43:24 11: ==21085== by 0x412C080: mir::client::BufferVault::free_buffer(int) (buffer_vault.cpp:111)
07:43:24 11: ==21085== by 0x412D1A2: mir::client::BufferVault::wire_transfer_inbound(int) (buffer_vault.cpp:265)
07:43:24 11: ==21085== by 0x412BA87: (anonymous namespace)::incoming_buffer(MirBuffer*, void*) (buffer_vault.cpp:54)
07:43:24 11: ==21085== by 0x4135B2C: mir::client::Buffer::Buffer(void (*)(MirBuffer*, void*), void*, int, std::shared_ptr<mir::client::ClientBuffer> const&, MirConnection*, MirBufferUsage)::{lambda()#1}::operator()() const (buffer.cpp:33)
07:43:24 11: ==21085== by 0x4136589: std::_Function_handler<void (), mir::client::Buffer::Buffer(void (*)(MirBuffer*, void*), void*, int, std::shared_ptr<mir::client::ClientBuffer> const&, MirConnection*, MirBufferUsage)::{lambda()#1}>::_M_invoke(std::_Any_data const&) (functional:1871)
07:43:24 11: ==21085== by 0x409508F: std::function<void ()>::operator()() const (functional:2267)
07:43:24 11: ==21085== by 0x4136B78: mir::client::AtomicCallback<>::operator()() const (atomic_callback.h:56)

https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2680/consoleFull

summary: Valgrind failure on mir_acceptance_tests - leak on incoming buffer in
- Requests::free_buffer(int) (buffer_stream.cpp:274)
+ Requests::free_buffer(int)
Changed in mir:
milestone: 0.25.0 → 0.26.0
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in mir:
assignee: nobody → Daniel van Vugt (vanvugt)
status: Confirmed → In Progress
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.26.0

Changed in mir:
status: In Progress → Fix Committed
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :
Changed in mir:
status: Fix Committed → Triaged
Changed in mir:
assignee: Daniel van Vugt (vanvugt) → Cemil Azizoglu (cemil-azizoglu)
Changed in mir:
status: Triaged → In Progress
Revision history for this message
Chris Halse Rogers (raof) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in mir:
milestone: 0.26.0 → none
assignee: Cemil Azizoglu (cemil-azizoglu) → nobody
status: In Progress → Triaged
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I think I probably fixed this in lp:~vanvugt/mir/fix-1653658

Changed in mir:
milestone: none → 0.26.0
assignee: nobody → Daniel van Vugt (vanvugt)
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (7.2 KiB)

This bug was fixed in the package mir - 0.26.0+17.04.20170126.3-0ubuntu1

---------------
mir (0.26.0+17.04.20170126.3-0ubuntu1) zesty; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.26.0 (https://launchpad.net/mir/+milestone/0.26.0)
    - ABI summary:
      . mirclient ABI unchanged at 9
      . mirserver ABI bumped to 43
      . mircommon ABI unchanged at 7
      . mirplatform ABI unchanged at 14
      . mirprotobuf ABI unchanged at 3
      . mirplatformgraphics ABI unchanged at 11
      . mirclientplatform ABI unchanged at 5
      . mirinputplatform ABI unchanged at 6
      . mircore ABI unchanged at 1
    - Enhancements:
      . New/improved toolkit APIs: MirInputConfig and related functions,
        MirWindow and related functions, DisplayConfig and related functions,
        MirScreencastSpec and related functions,
      . Support for configuring input configuration
      . Introduce toolkit extension mechanism for platform specific APIs.
      . Toolkit extensions for: mesa_drm_auth, set_gbm_device and
        window_coordinate_translation
      . Screencasting to a specific MirBuffer.
      . Add DisplayConfigurationController::base_configuration() so downstreams
        can get the base configuration. (Weirdly they can already set it.).
      . x11 platform: allow adjustable scale parameter.
      . Added EDID support: client API, server logging and in mirout.
      . mirout: Add newer attributes only available in the new display
        config API: scaling factor, subpixel arrangement and form factor.
      . mirout: Log the orientation and logical size of each output too.
      . Replace the mir::Server-overridable Reports with Observers.
      . Add xkbcommon to mirclient.pc Requires.private.
      . Deprecate legacy toolkit APIs that will be removed in Mir 1.0
      . Introduced 'client-side vsync', which dramatically reduces latency
        from the client to the screen (particularly for nested servers like
        Unity8).
    - Bugs fixed:
      . [performance] Restore support for better-than-triple buffering by
        default. (LP: #1240909)
      . Frame rate is artificially low on Diamondville Intel Atom systems due
        to aggressive power management (LP: #1388490)
      . [testsfail] failure in CI in
        AndroidInputReceiverSetup.slow_raw_input_doesnt_cause_frameskipping
        (LP: #1394369)
      . [trusted prompt sessions] Can't open two prompt sessions at the same
        time (LP: #1494197)
      . Changing scale, formFactor or DPI in display configuration causes
        renderer teardown/recreate unnecessarily (LP: #1556142)
      . [testsfail] ApplicationNotRespondingDetection.failure_to_pong_is_
        noticed (LP: #1570327)
      . CI failure in TestClientInput.receives_one_touch_event_per_frame
        (LP: #1570698)
      . Mir-on-X mouse input is jerky/stuttery compared to Mir-on-KMS
        (LP: #1576600)
      . [regression] Two fingers in mir_proving_server now resizes/moves app
        windows (two finger apps unusable) (LP: #1586311)
      . Pointer/cursor input lag in unity8 session (LP: #1591328)
      . PointerConfinement.test_we_update_our_confined_region_on_a_resize
      ...

Read more...

Changed in mir (Ubuntu):
status: New → Fix Released
Changed in mir:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.