-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Hi dear developers,
Some time ago, I noticed an important memory leak of v4l2-relayd service on my Ubuntu 22.04.4 LTS laptop : a couple of GB after some video calls.
I decided to investigate using valgrind and found it comes from this lib.
I noticed memory is leaked each time camera is restarted.
==65931== 1,080 bytes in 2 blocks are definitely lost in loss record 5,731 of 6,137
==65931== at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==65931== by 0xA305045: icamera::CIPR::Command::Command(icamera::CIPR::PSysCommandConfig const&) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA28BB49: icamera::PGCommon::createCommand(icamera::CIPR::Buffer*, icamera::CIPR::Command**, icamera::CIPR::Buffer**, int) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA28BDAD: icamera::PGCommon::createCommands() (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA28C7A7: icamera::PGCommon::iterate(std::map<unsigned int, std::shared_ptr<icamera::CameraBuffer>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::shared_ptr<icamera::CameraBuffer> > > >&, std::map<unsigned int, std::shared_ptr<icamera::CameraBuffer>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::shared_ptr<icamera::CameraBuffer> > > >&, ia_binary_data*, ia_binary_data const*) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA27FD91: icamera::PipeLiteExecutor::runPipe(std::map<icamera::Port, std::shared_ptr<icamera::CameraBuffer>, std::less<icamera::Port>, std::allocator<std::pair<icamera::Port const, std::shared_ptr<icamera::CameraBuffer> > > >&, std::map<icamera::Port, std::shared_ptr<icamera::CameraBuffer>, std::less<icamera::Port>, std::allocator<std::pair<icamera::Port const, std::shared_ptr<icamera::CameraBuffer> > > >&, std::vector<std::shared_ptr<icamera::CameraBuffer>, std::allocator<std::shared_ptr<icamera::CameraBuffer> > >&, std::vector<icamera::EventType, std::allocator<icamera::EventType> >&) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA281851: icamera::PipeLiteExecutor::processNewFrame() (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA249A37: ??? (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA29032E: icamera::Thread::_threadLoop(icamera::Thread*) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA015252: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==65931== by 0x4C16AC2: start_thread (pthread_create.c:442)
==65931== by 0x4CA7A03: clone (clone.S:100)
==65931== 36 bytes in 1 blocks are definitely lost in loss record 2,892 of 6,137
==65931== at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==65931== by 0xA30470C: icamera::CIPR::Context::registerBuffer(icamera::CIPR::MemoryDesc*) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA289916: icamera::PGCommon::createUserPtrCiprBuffer(int, void*, bool) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA28A304: icamera::PGCommon::registerUserBuffer(int, void*, bool) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA28B678: icamera::PGCommon::prepareTerminalBuffers(ia_binary_data const*, std::map<unsigned int, std::shared_ptr<icamera::CameraBuffer>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::shared_ptr<icamera::CameraBuffer> > > > const&, std::map<unsigned int, std::shared_ptr<icamera::CameraBuffer>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::shared_ptr<icamera::CameraBuffer> > > > const&, long) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA28C5A2: icamera::PGCommon::iterate(std::map<unsigned int, std::shared_ptr<icamera::CameraBuffer>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::shared_ptr<icamera::CameraBuffer> > > >&, std::map<unsigned int, std::shared_ptr<icamera::CameraBuffer>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::shared_ptr<icamera::CameraBuffer> > > >&, ia_binary_data*, ia_binary_data const*) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA27FD91: icamera::PipeLiteExecutor::runPipe(std::map<icamera::Port, std::shared_ptr<icamera::CameraBuffer>, std::less<icamera::Port>, std::allocator<std::pair<icamera::Port const, std::shared_ptr<icamera::CameraBuffer> > > >&, std::map<icamera::Port, std::shared_ptr<icamera::CameraBuffer>, std::less<icamera::Port>, std::allocator<std::pair<icamera::Port const, std::shared_ptr<icamera::CameraBuffer> > > >&, std::vector<std::shared_ptr<icamera::CameraBuffer>, std::allocator<std::shared_ptr<icamera::CameraBuffer> > >&, std::vector<icamera::EventType, std::allocator<icamera::EventType> >&) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA281851: icamera::PipeLiteExecutor::processNewFrame() (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA249A37: ??? (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA29032E: icamera::Thread::_threadLoop(icamera::Thread*) (in /usr/lib/x86_64-linux-gnu/libcamhal/plugins/ipu6ep.so)
==65931== by 0xA015252: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==65931== by 0x4C16AC2: start_thread (pthread_create.c:442)
I plan to investigate a little bit further myself, please do not hesitate if you need more precisions :)
Best regards
obaqueiro and 500error
Metadata
Metadata
Assignees
Labels
No labels