lundi 2 juillet 2018

crash in boost::split algorithm (can not access memory)

I am getting following crash in boost algorithm

stack trace is :

0 0x0000000000451432 in boost::algorithm::predicate_facade

::predicate_facade ( this=) at /med/build/boost/boost_1_43_0/boost/algorithm/string/predicate_facade.hpp:36

1 0x0000000000451454 in boost::algorithm::detail::is_any_ofF::is_any_ofF

(this=0x7fffff3ff090, Other=...) at /med/build/boost/boost_1_43_0/boost/algorithm/string/detail/classification.hpp:107

2 0x0000000000452517 in boost::algorithm::detail::token_finderF

::operator()<__gnu_cxx::__normal_iterator > ( this=0x7ffe5169a6b0, Begin=..., End=...) at /med/build/boost/boost_1_43_0/boost/algorithm/string/detail/finder.hpp:570

3 0x0000000000453f29 in boost::detail::function::function_obj_invoker2

, boost::iterator_range<__gnu_cxx::__normal_iterator >, __gnu_cxx::__normal_iterator, __gnu_cxx::__normal_iterator >::invoke ( function_obj_ptr=..., a0=..., a1=...) at /med/build/boost/boost_1_43_0/boost/function/function_template.hpp:132

4 0x0000000000453a3a in boost::function2

std::string> >, __gnu_cxx::__normal_iterator, __gnu_cxx::__normal_iterator >::operator() (this=0x7fffff3ff450, a0=..., a1=...) at /med/build/boost/boost_1_43_0/boost/function/function_template.hpp:1013

5 0x0000000000453080 in boost::algorithm::detail::find_iterator_base<__gnu_cxx::__normal_iterator

std::string> >::do_find (this=0x7fffff3ff450, Begin=..., End=...) at /med/build/boost/boost_1_43_0/boost/algorithm/string/detail/find_iterator.hpp:63

6 0x00000000004527fe in boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator

std::string> >::increment (this=0x7fffff3ff450) at /med/build/boost/boost_1_43_0/boost/algorithm/string/find_iterator.hpp:297

7 0x0000000000454f12 in boost::iterator_core_access::increment

std::string> > > (f=...) at /med/build/boost/boost_1_43_0/boost/iterator/iterator_facade.hpp:522

8 0x0000000000454e2c in boost::iterator_facade

std::string> >, boost::iterator_range<__gnu_cxx::__normal_iterator

const, boost::forward_traversal_tag, boost::iterator_range<__gnu_cxx::__normal_iterator const&, long>::operator++ ( this=0x7fffff3ff450) at /med/build/boost/boost_1_43_0/boost/iterator/iterator_facade.hpp:664

9 0x00000000004548a6 in boost::iterator_adaptor

__gnu_cxx::__normal_iterator >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator >, boost::use_default, boost::use_default>, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator >, std::string, boost::use_default, std::string, boost::use_default>::increment (this=0x7fffff3ff450) at /med/build/boost/boost_1_43_0/boost/iterator/iterator_adaptor.hpp:339

10 0x0000000000454318 in boost::iterator_core_access::increment

__gnu_cxx::__normal_iterator >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator >, boost::use_default, boost::use_default> > (f=...) at /med/build/boost/boost_1_43_0/boost/iterator/iterator_facade.hpp:522

11 0x0000000000453bda in boost::iterator_facade

__gnu_cxx::__normal_iterator >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator >, boost::use_default, boost::use_default>, std::string, boost::forward_traversal_tag, std::string, long>::operator++ (this=0x7fffff3ff450) at /med/build/boost/boost_1_43_0/boost/iterator/iterator_facade.hpp:664

12 0x000000000045326d in std::vector

::_M_range_initialize >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator >, boost::use_default, boost::use_default> > (this=0x7fffff3ff6a0, __first=..., __last=...) at /med/build/gcc/gcc-4.7.2/linux64/gcc-4.7.2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/stl_vector.h:1157

13 0x0000000000452aa8 in std::vector

::_M_initialize_dispatch >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator >, boost::use_default, boost::use_default> > (this=0x7fffff3ff6a0, __first=..., __last=...) at /med/build/gcc/gcc-4.7.2/linux64/gcc-4.7.2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/stl_vector.h:1148

14 0x0000000000452206 in std::vector

::vector >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator >, boost::use_default, boost::use_default> > ( this=0x7fffff3ff6a0, __first=..., __last=..., __a=...) at /med/build/gcc/gcc-4.7.2/linux64/gcc-4.7.2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/stl_vector.h:393

15 0x0000000000451a87 in boost::algorithm::iter_split

std::allocator >, std::string, boost::algorithm::detail::token_finderF

(Result=..., Input=..., Finder=...) at /med/build/boost/boost_1_43_0/boost/algorithm/string/iter_find.hpp:178

function used as foloows in the code :

boost::split(signals, name, boost::is_any_of("."), boost::token_compress_on); 
template<typename Derived>
struct predicate_facade {}; 

In above code, i am getting can not access memory error in gdb for this pointer :

(gdb) p this Cannot access memory at address 0x7fffff3feff8

But it worked fine in small code (tried on ideone): https://www.ideone.com/jnB037 Please help me out.

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire