Community
cancel
Showing results for 
Search instead for 
Did you mean: 
zixiang__gao
Beginner
155 Views

Segmentation fault when ~ExecutableNetwork

Hi,

I have one segmentation fault about ~ExecutableNetwork. I have no idea about this,  some suggestions?

This segmentation fault was happend when main() function destroied.

The strange thing is that I cannot reproduce this problem in unit tests, but it's an inevitable problem in upper-layer unit test.

Add, there isn't this fault when I used 2019R1.

libbase_vino.so is a package of InferenceEngine. I have tried remove my base_vino, use Core, etc.. directly, but the segmentation fault happen also.

Infos:

OS: Ubuntu 1604, Intel® Core™ i7-7700 CPU @ 3.60GHz × 8 .

OpenVINO: 2019R3, build by myself

Compiler: clang 6.0

Device: CPU/GPU

----------------------

Because of ~ExecutableNetworkBase() = default, so, I tried print logs in ~TaskExecutor:

TaskExecutor::~TaskExecutor() {
    {
        std::unique_lock<std::mutex> lock(_queueMutex);
        if (!_taskQueue.empty()) {
            _queueCondVar.wait(lock, [this]() { return _taskQueue.empty(); });
        }
        _isStopped = true;
        _queueCondVar.notify_all();
    }
    std::cout << "line 56, _thread use count = " << _thread.use_count() << std::endl;
    if (_thread && _thread->joinable()) {
        std::cout << "line 58, _thread use count = " << _thread.use_count() << std::endl;
        _thread->join();
        std::cout << "_thread join?" << std::endl;
        _thread.reset();
    }
}

It's all ok before, use_count() = 1.

        _thread->join();

gdb backtrace:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by unit_test
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f61be6ee8d9 in pthread_join (threadid=33, thread_return=0x0) at pthread_join.c:45
45    pthread_join.c: No such file or directory.
[Current thread is 1 (Thread 0x7f61beaa1840 (LWP 23636))]
(gdb) bt
#0  0x00007f61be6ee8d9 in pthread_join (threadid=33, thread_return=0x0) at pthread_join.c:45
#1  0x00007f61abd63b97 in std::thread::join() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007f61a7d22660 in InferenceEngine::TaskExecutor::~TaskExecutor() () from /home/ubuntu/project/devel_linux/lib/libinference_engine.so
#3  0x00007f61989bb6f8 in std::_Sp_counted_ptr_inplace<InferenceEngine::TaskExecutor, std::allocator<InferenceEngine::TaskExecutor>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
   from /home/ubuntu/project/devel_linux/lib/libMKLDNNPlugin.so
#4  0x00007f61989b923c in InferenceEngine::ExecutableNetworkThreadSafeDefault::~ExecutableNetworkThreadSafeDefault() () from /home/ubuntu/project/devel_linux/lib/libMKLDNNPlugin.so
#5  0x00007f61989b8655 in MKLDNNPlugin::MKLDNNExecNetwork::~MKLDNNExecNetwork() () from /home/ubuntu/project/devel_linux/lib/libMKLDNNPlugin.so
#6  0x00007f6198a67528 in std::_Sp_counted_ptr_inplace<MKLDNNPlugin::MKLDNNExecNetwork, std::allocator<MKLDNNPlugin::MKLDNNExecNetwork>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
   from /home/ubuntu/project/devel_linux/lib/libMKLDNNPlugin.so
#7  0x00007f6198a619b9 in InferenceEngine::ExecutableNetworkBase<InferenceEngine::ExecutableNetworkInternal>::~ExecutableNetworkBase() () from /home/ubuntu/project/devel_linux/lib/libMKLDNNPlugin.so
#8  0x00007f6198a61a29 in InferenceEngine::ExecutableNetworkBase<InferenceEngine::ExecutableNetworkInternal>::Release() () from /home/ubuntu/project/devel_linux/lib/libMKLDNNPlugin.so
#9  0x00007f6198a617e8 in std::_Sp_counted_deleter<InferenceEngine::ExecutableNetworkBase<InferenceEngine::ExecutableNetworkInternal>*, InferenceEngine::InferencePluginInternal::LoadNetwork(std::shared_ptr<InferenceEngine::IExecutableNetwork>&, InferenceEngine::ICNNNetwork&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)::{lambda(InferenceEngine::details::IRelease*)#1}, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() () from /home/ubuntu/project/devel_linux/lib/libMKLDNNPlugin.so
#10 0x00007f61b2275469 in InferenceEngine::ExecutableNetwork::~ExecutableNetwork() () from /home/ubuntu/project/devel_linux/lib/libbase_openvino.so

 

Thanks~

0 Kudos
2 Replies
Sahira_Intel
Moderator
155 Views

Hi Zixiang,

Please try again using the latest OpenVINO Release 2020.2. Let me know if you still encounter issues. 

Best Regards,

Sahira 

zixiang__gao
Beginner
155 Views

Sahira R. (Intel) wrote:

Hi Zixiang,

Please try again using the latest OpenVINO Release 2020.2. Let me know if you still encounter issues. 

Best Regards,

Sahira 

Hi, Sahira,

I tried the latest OpenVINO 2020R2. I am not encounter the segmentation fault issues use CPU.

I want to know why 2019R3.1 have this issues. I tired to find, but find noting.

By the way, because of all my project third party must build by source code. It's not easy to solve OpenVINO's thirdpart like pugixm, especially with repeated dependencies on my project, need to modify CMaklists.txt.

Why not process all thirdparty like ngraph? Developer could replace function(build_ngraph) with find_package.

Best Regards,

Zixiang

Reply