VideoCore-Inactive icon indicating copy to clipboard operation
VideoCore-Inactive copied to clipboard

possible memory leak and memory management issue

Open zhifeng-huang opened this issue 10 years ago • 4 comments

I think there are some memory leaks in the code. When I repeat creating and then ending a session, each session is getting slower and slower. After 5 to 7 times, the app crashes with EXC_BAD_ACCESS at H264Encode.mm:136: #1 0x00000001007ed87c in videocore::Apple::H264Encode::pushBuffer(unsigned char const*, unsigned long, videocore::IMetadata&) at /Users/zfh/Desktop/edcast-ios/Pods/VideoCore/transforms/Apple/H264Encode.mm:136 #2 0x0000000100813660 in videocore::Split::pushBuffer(unsigned char const*, unsigned long, videocore::IMetadata&) at /Users/zfh/Desktop/edcast-ios/Pods/VideoCore/transforms/Split.cpp:73 #3 0x00000001007bfe44 in videocore::iOS::GLESVideoMixer::mixThread()::$_6::operator()() const at /Users/zfh/Desktop/edcast-ios/Pods/VideoCore/mixers/iOS/GLESVideoMixer.mm:502 #4 0x00000001007bf2dc in decltype(std::__1::forwardvideocore::iOS::GLESVideoMixer::mixThread()::$_6&(fp)(std::__1::forward<>(fp0))) std::__1::__invokevideocore::iOS::GLESVideoMixer::mixThread()::$_6&(videocore::iOS::GLESVideoMixer::mixThread()::$_6&&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:413 #5 0x00000001007bf2cc in std::__1::__function::__func<videocore::iOS::GLESVideoMixer::mixThread()::$_6, std::__1::allocatorvideocore::iOS::GLESVideoMixer::mixThread()::$_6, void ()>::operator()() at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1370 #6 0x00000001007d5f5c in std::__1::function<void ()>::operator()() const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1755 #7 0x00000001007d5ea8 in videocore::Job::operator()() at /Users/zfh/Desktop/edcast-ios/Pods/Headers/Private/VideoCore/videocore/system/JobQueue.hpp:59 #8 0x00000001007c71fc in ___ZN9videocore8JobQueue7enqueueENSt3__110shared_ptrINS_3JobEEE_block_invoke at /Users/zfh/Desktop/edcast-ios/Pods/Headers/Private/VideoCore/videocore/system/JobQueue.hpp:126

zhifeng-huang avatar Apr 01 '15 19:04 zhifeng-huang

I can reproduce this reliably.

zhifeng-huang avatar Apr 01 '15 19:04 zhifeng-huang

This only happens when the VCSimpleSession is dealloc'ed.

zhifeng-huang avatar Apr 07 '15 19:04 zhifeng-huang

Sounds similar to #104 and #91.

JALsnipe avatar Apr 07 '15 19:04 JALsnipe

I have similar problem that makes my app crash. 0x100674694 std::__1::__function::__func<videocore::iOS::GLESVideoMixer::mixThread()::$_6, std::__1::allocator<videocore::iOS::GLESVideoMixer::mixThread()::$_6>, void ()>::operator()() + 656 0x100673718 ___ZN9videocore8JobQueue7enqueueENSt3__110shared_ptrINS_3JobEEE_block_invoke + 44

WennyLiang avatar Mar 15 '17 10:03 WennyLiang