vendredi 21 juillet 2017

SIGABRT Issue in valgrind with multithreading in c++11

class MyClass{
    public : 
        void runBscGwThread(int);
    private :
        std::unique_ptr<std::thread> MyClass_;
} 


MyClass::Myclass(int bcfId, A::AParam sctpParams):
             bcfId_(bcfId),
{
    Myclass_.reset(new std::thread([this](){ this->runBscGwThread(bcfId_);}));
}

This issue is seen occasionally . In destructor I am doing

Myclass:: ~Myclass(){
if (Myclass_->joinable)
  Myclass_->join();  
}

The Valgrind Logs are below :

fatal_signal>
  <tid>2</tid>
  <signo>6</signo>
  <signame>SIGABRT</signame>
  <sicode>-6</sicode>
  <stack>
    <frame>
      <ip>0x670DB80</ip

/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libc-2.24.so

<fn>raise</fn>
        </frame>
    <frame>
  <ip>0x670F046</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libc-2.24.so</obj>
  <fn>abort</fn>
</frame>
<frame>
  <ip>0x656831E</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libstdc++.so.6.0.22</obj>
  <fn>__gnu_cxx::__verbose_terminate_handler()</fn>
</frame>
<frame>
  <ip>0x6565EC3</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libstdc++.so.6.0.22</obj>
</frame>
<frame>
  <ip>0x6564C28</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libstdc++.so.6.0.22</obj>
</frame>
<frame>
  <ip>0x6565426</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libstdc++.so.6.0.22</obj>
  <fn>__gxx_personality_v0</fn>
</frame>
<frame>
  <ip>0x66D941E</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libgcc_s.so.1</obj>
</frame>
<frame>
  <ip>0x66D974C</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libgcc_s.so.1</obj>
  <fn>_Unwind_RaiseException</fn>
</frame>
<frame>
  <ip>0x65661E3</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libstdc++.so.6.0.22</obj>
  <fn>__cxa_throw</fn>
</frame>
<frame>
  <ip>0x65913F2</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libstdc++.so.6.0.22</obj>
  <fn>std::__throw_system_error(int)</fn>
</frame>
<frame>
  <ip>0x6593917</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libstdc++.so.6.0.22</obj>
  <fn>std::thread::join()</fn>
</frame>
<frame>
  <ip>0x8083F41</ip>
  <obj>/dev/shm/workspace/GTS+http://ift.tt/2uOWCzZ;
  <fn>GTS::BSCGW::Myclass::stop()</fn>
</frame>
<frame>
  <ip>0x8083F69</ip>
  <obj>/dev/shm/workspace/GTS+http://ift.tt/2uOWCzZ;
  <fn>GTS::BSCGW::Myclass::~Myclass()</fn>
</frame>
<frame>
  <ip>0x807DD62</ip>
  <obj>/dev/shm/workspace/GTS+http://ift.tt/2uOWCzZ;
  <fn>std::__shared_count&lt;(__gnu_cxx::_Lock_policy)2&gt;::~__shared_count()</fn>
</frame>
<frame>
  <ip>0x807E15E</ip>
  <obj>/dev/shm/workspace/GTS+http://ift.tt/2uOWCzZ;
  <fn>std::_Rb_tree&lt;int, std::pair&lt;int const, std::pair&lt;std::shared_ptr&lt;, std::shared_ptr&lt;GTS::BSCGW::Myclass&gt; &gt; &gt;, std::_Select1st&lt;std::pair&lt;int const, std::pair&lt;, std::shared_ptr&lt;GTS::BSCGW::Myclass&gt; &gt; &gt; &gt;, std::less&lt;int&gt;, std::allocator&lt;std::pair&lt;int const, std::pair&lt;std::shared_ptr&lt;, std::shared_ptr&lt;GTS::BSCGW::Myclass&gt; &gt; &gt; &gt; &gt;::_M_erase(std::_Rb_tree_node&lt;std::pair&lt;int const, std::pair&lt;std::shared_ptr&lt; std::shared_ptr&lt;GTS::BSCGW::Myclass&gt; &gt; &gt; &gt;*)</fn>
</frame>
<frame>
  <ip>0x807E150</ip>
  <obj>/dev/shm/workspace/GTS+http://ift.tt/2uOWCzZ;
  <fn>std::_Rb_tree&lt;int, std::pair&lt;int const, std::pair&lt;std::shared_ptr&lt;, std::shared_ptr&lt;GTS::BSCGW::Myclass&gt; &gt; &gt;, std::_Select1st&lt;std::pair&lt;int const, std::pair&lt;std::shared_ptr&lt;, std::shared_ptr&lt;GTS::BSCGW::Myclass&gt; &gt; &gt; &gt;, std::less&lt;int&gt;, std::allocator&lt;std::pair&lt;int const, std::pair&lt;std::shared_ptr&lt;, std::shared_ptr&lt;GTS::BSCGW::Myclass&gt; &gt; &gt; &gt; &gt;::_M_erase(std::_Rb_tree_node&lt;std::pair&lt;int const,  std::shared_ptr&lt;GTS::BSCGW::Myclass&gt; &gt; &gt; &gt;*)</fn>
</frame>
<frame>
  <ip>0x8084928</ip>
  <obj>/dev/shm/workspace/GTS+http://ift.tt/2uOWCzZ;
  <fn>GTS::BSCGW::Myclass::readFromSocket(std::vector&lt;unsigned char, std::allocator&lt;unsigned char&gt; &gt;&amp;, int)</fn>
</frame>
<frame>
  <ip>0x8085142</ip>
  <obj>/dev/shm/workspace/GTS+http://ift.tt/2uOWCzZ;
  <fn>GTS::BSCGW::Myclass::runBscGwThread(int)</fn>
</frame>
<frame>
  <ip>0x80852A6</ip>
  <obj>/dev/shm/workspace/GTS+http://ift.tt/2uOWCzZ;
  <fn>std::thread::_Impl&lt;std::_Bind_simple&lt;GTS::BSCGW::Myclass::Myclass(int, GTS::AbisSctpParam)::{lambda()#1} ()&gt; &gt;::_M_run()</fn>
</frame>
<frame>
  <ip>0x6593A8D</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libstdc++.so.6.0.22</obj>
</frame>
<frame>
  <ip>0x64DD2E9</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libpthread-2.24.so</obj>
  <fn>start_thread</fn>
</frame>
<frame>
  <ip>0x67C90ED</ip>
  <obj>/build/ltesdkroot/data/Platforms/IB_PS_LFS_REL/IB013_PS_LFS_REL_2017_06_0017-LTE/IB013_PS_LFS_REL_2017_06_0017-LTE/os/sys-root/i686-pc-linux-gnu/usr/lib/libc-2.24.so</obj>
  <fn>clone</fn>
</frame>

Aucun commentaire:

Enregistrer un commentaire