Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaked during video streaming #3416

Closed
chinlin0924 opened this issue Jun 2, 2020 · 1 comment
Closed

Memory leaked during video streaming #3416

chinlin0924 opened this issue Jun 2, 2020 · 1 comment

Comments

@chinlin0924
Copy link

chinlin0924 commented Jun 2, 2020

Bug Report

Memory leaked during SDL video streaming

Reproduction Steps
  1. Build Core with -DENABLE_SANITIZE=ON
  2. Setup video streaming via pipe and run Core with ASAN_OPTIONS=detect_leaks=1 for memory leak checking
  3. Connect any Navigation/Video Streaming SDL app
  4. Observe the memory usage while video streaming is performed
  5. Terminate Core and check the leaked information from GCC leak sanitizer reports
Expected Behavior

Memory usage shouldn't be increased continually or any memory leaked

Observed Behavior

Memory usage is increased continually even causes the OOM to kill the Core process.

OS & Version Information

*OS/Version: Ubuntu 18.04
*SDL Core Version: 4.5.2

Test Case, Sample Code, and / or Example App

GCC Sanitizer logs:
Direct leak of 80 byte(s) in 2 object(s) allocated from: #0 0x7fe53fa1a532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532) #1 0x25b3843 in protocol_handler::ProtocolHandlerImpl::NotifySessionStarted(protocol_handler::SessionContext const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1494 #2 0x261aae7 in connection_handler::ConnectionHandlerImpl::NotifyServiceStartedResult(unsigned int, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) /sdlcore/src/components/connection_handler/src/connection_handler_impl.cc:536 #3 0x186e58c in application_manager::ApplicationManagerImpl::OnServiceStartedCallback(unsigned long const&, int const&, protocol_handler::ServiceType const&, BsonObject const*) /sdlcore/src/components/application_manager/src/application_manager_impl.cc:1555 #4 0x2619ae3 in connection_handler::ConnectionHandlerImpl::OnSessionStartedCallback(unsigned int, unsigned char, protocol_handler::ServiceType const&, bool, BsonObject const*) /sdlcore/src/components/connection_handler/src/connection_handler_impl.cc:486 #5 0x25b2a54 in protocol_handler::ProtocolHandlerImpl::HandleControlMessageStartSession(utils::SharedPtr<protocol_handler::ProtocolPacket>) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1438 #6 0x25aeb22 in protocol_handler::ProtocolHandlerImpl::HandleControlMessage(utils::SharedPtr<protocol_handler::ProtocolPacket>) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1126 #7 0x25ac80b in protocol_handler::ProtocolHandlerImpl::HandleMessage(utils::SharedPtr<protocol_handler::ProtocolPacket>) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1053 #8 0x25b84ea in protocol_handler::ProtocolHandlerImpl::Handle(protocol_handler::impl::RawFordMessageFromMobile) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1800 #9 0x25df5e2 in threads::MessageLoopThread<utils::PrioritizedQueue<protocol_handler::impl::RawFordMessageFromMobile> >::LoopThreadDelegate::DrainQue() /sdlcore/src/components/include/utils/threads/message_loop_thread.h:203 #10 0x25dea67 in threads::MessageLoopThread<utils::PrioritizedQueue<protocol_handler::impl::RawFordMessageFromMobile> >::LoopThreadDelegate::threadMain() (/sdlcore/build/bin_san/smartDeviceLinkCore+0x25dea67) #11 0x2890965 in threads::Thread::threadFunc(void*) /sdlcore/src/components/utils/src/threads/thread_posix.cc:105 #12 0x7fe53f76b6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9) Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fe53fa1a532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532) #1 0x25b3843 in protocol_handler::ProtocolHandlerImpl::NotifySessionStarted(protocol_handler::SessionContext const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1494 #2 0x261aae7 in connection_handler::ConnectionHandlerImpl::NotifyServiceStartedResult(unsigned int, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) /sdlcore/src/components/connection_handler/src/connection_handler_impl.cc:536 #3 0x186ba1f in application_manager::ApplicationManagerImpl::OnStreamingConfigured(unsigned int, protocol_handler::ServiceType, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) /sdlcore/src/components/application_manager/src/application_manager_impl.cc:1461 #4 0x186a8bd in application_manager::ApplicationManagerImpl::StartNaviService(unsigned int, protocol_handler::ServiceType, BsonObject const*) /sdlcore/src/components/application_manager/src/application_manager_impl.cc:1418 #5 0x186eb9c in application_manager::ApplicationManagerImpl::OnServiceStartedCallback(unsigned long const&, int const&, protocol_handler::ServiceType const&, BsonObject const*) /sdlcore/src/components/application_manager/src/application_manager_impl.cc:1570 #6 0x2619ae3 in connection_handler::ConnectionHandlerImpl::OnSessionStartedCallback(unsigned int, unsigned char, protocol_handler::ServiceType const&, bool, BsonObject const*) /sdlcore/src/components/connection_handler/src/connection_handler_impl.cc:486 #7 0x25b2a54 in protocol_handler::ProtocolHandlerImpl::HandleControlMessageStartSession(utils::SharedPtr<protocol_handler::ProtocolPacket>) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1438 #8 0x25aeb22 in protocol_handler::ProtocolHandlerImpl::HandleControlMessage(utils::SharedPtr<protocol_handler::ProtocolPacket>) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1126 #9 0x25ac80b in protocol_handler::ProtocolHandlerImpl::HandleMessage(utils::SharedPtr<protocol_handler::ProtocolPacket>) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1053 #10 0x25b84ea in protocol_handler::ProtocolHandlerImpl::Handle(protocol_handler::impl::RawFordMessageFromMobile) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1800 #11 0x25df5e2 in threads::MessageLoopThread<utils::PrioritizedQueue<protocol_handler::impl::RawFordMessageFromMobile> >::LoopThreadDelegate::DrainQue() /sdlcore/src/components/include/utils/threads/message_loop_thread.h:203 #12 0x25dea67 in threads::MessageLoopThread<utils::PrioritizedQueue<protocol_handler::impl::RawFordMessageFromMobile> >::LoopThreadDelegate::threadMain() (/sdlcore/build/bin_san/smartDeviceLinkCore+0x25dea67) #13 0x2890965 in threads::Thread::threadFunc(void*) /sdlcore/src/components/utils/src/threads/thread_posix.cc:105 #14 0x7fe53f76b6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9) Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fe53fa1a532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532) #1 0x25b3843 in protocol_handler::ProtocolHandlerImpl::NotifySessionStarted(protocol_handler::SessionContext const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) /sdlcore/src/components/protocol_handler/src/protocol_handler_impl.cc:1494 #2 0x261aae7 in connection_handler::ConnectionHandlerImpl::NotifyServiceStartedResult(unsigned int, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) /sdlcore/src/components/connection_handler/src/connection_handler_impl.cc:536 #3 0x186ba1f in application_manager::ApplicationManagerImpl::OnStreamingConfigured(unsigned int, protocol_handler::ServiceType, bool, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) /sdlcore/src/components/application_manager/src/application_manager_impl.cc:1461 #4 0x29ce1f1 in application_manager::commands::NaviSetVideoConfigRequest::on_event(application_manager::event_engine::Event const&) /sdlcore/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc:118 #5 0x28f790b in application_manager::event_engine::EventDispatcherImpl::raise_event(application_manager::event_engine::Event const&) /sdlcore/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc:70 #6 0x28f6dee in application_manager::event_engine::Event::raise(application_manager::event_engine::EventDispatcher&) /sdlcore/src/components/application_manager/src/event_engine/event.cc:44 #7 0x29cfd6c in application_manager::commands::NaviSetVideoConfigResponse::Run() /sdlcore/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc:50 #8 0x187a50a in application_manager::ApplicationManagerImpl::ManageHMICommand(utils::SharedPtr<NsSmartDeviceLink::NsSmartObjects::SmartObject>) /sdlcore/src/components/application_manager/src/application_manager_impl.cc:2166 #9 0x18868b7 in application_manager::ApplicationManagerImpl::ProcessMessageFromHMI(utils::SharedPtr<application_manager::Message>) /sdlcore/src/components/application_manager/src/application_manager_impl.cc:2672 #10 0x1897c92 in application_manager::ApplicationManagerImpl::Handle(application_manager::impl::MessageFromHmi) /sdlcore/src/components/application_manager/src/application_manager_impl.cc:3349 #11 0x191b71e in threads::MessageLoopThread<utils::PrioritizedQueue<application_manager::impl::MessageFromHmi> >::LoopThreadDelegate::DrainQue() /sdlcore/src/components/include/utils/threads/message_loop_thread.h:203 #12 0x19193cf in threads::MessageLoopThread<utils::PrioritizedQueue<application_manager::impl::MessageFromHmi> >::LoopThreadDelegate::threadMain() (/sdlcore/build/bin_san/smartDeviceLinkCore+0x19193cf) #13 0x2890965 in threads::Thread::threadFunc(void*) /sdlcore/src/components/utils/src/threads/thread_posix.cc:105 #14 0x7fe53f76b6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)

@chinlin0924 chinlin0924 changed the title Memory leaked during Video streaming Memory leaked during video streaming Jun 2, 2020
@iCollin
Copy link
Collaborator

iCollin commented Jun 6, 2020

Hello @chinlin0924, this memory leak has been fixed by #2270 which is in develop now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants