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

Multi tool use
Multi tool use


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<boost::algorithm::detail::is_any_ofF<char>
>::predicate_facade (
this=<error reading variable: Cannot access memory at address 0x7fffff3feff8>) at /med/build/boost/boost_1_43_0/boost/algorithm/string/predicate_facade.hpp:36
#1 0x0000000000451454 in boost::algorithm::detail::is_any_ofF<char>::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<boost::algorithm::detail::is_any_ofF<char>
>::operator()<__gnu_cxx::__normal_iterator<char*, std::string> > (
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::algorithm::detail::token_finderF<boost::algorithm::detail::is_any_ofF<char>
>, boost::iterator_range<__gnu_cxx::__normal_iterator<char*, std::string> >, __gnu_cxx::__normal_iterator<char*, std::string>,
__gnu_cxx::__normal_iterator<char*, std::string> >::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<boost::iterator_range<__gnu_cxx::__normal_iterator<char*, std::string> >, __gnu_cxx::__normal_iterator<char*, std::string>,
__gnu_cxx::__normal_iterator<char*, std::string> >::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<char*, 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<char*, 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<boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<char*, std::string> > > (f=...)
at /med/build/boost/boost_1_43_0/boost/iterator/iterator_facade.hpp:522
#8 0x0000000000454e2c in boost::iterator_facade<boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<char*, std::string> >, boost::iterator_range<__gnu_cxx::__normal_iterator<char*, std::string>
> const, boost::forward_traversal_tag, boost::iterator_range<__gnu_cxx::__normal_iterator<char*, std::string>
> 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<boost::transform_iterator<boost::algorithm::detail::copy_iterator_rangeF<std::string,
__gnu_cxx::__normal_iterator<char*, std::string> >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<char*, std::string> >, boost::use_default, boost::use_default>, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<char*, std::string> >, 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<boost::transform_iterator<boost::algorithm::detail::copy_iterator_rangeF<std::string,
__gnu_cxx::__normal_iterator<char*, std::string> >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<char*, std::string> >, 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<boost::transform_iterator<boost::algorithm::detail::copy_iterator_rangeF<std::string,
__gnu_cxx::__normal_iterator<char*, std::string> >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<char*, std::string> >, 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<std::string, std::allocator<std::string>
>::_M_range_initialize<boost::transform_iterator<boost::algorithm::detail::copy_iterator_rangeF<std::string,
__gnu_cxx::__normal_iterator<char*, std::string> >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<char*, std::string> >, 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<std::string, std::allocator<std::string>
>::_M_initialize_dispatch<boost::transform_iterator<boost::algorithm::detail::copy_iterator_rangeF<std::string,
__gnu_cxx::__normal_iterator<char*, std::string> >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<char*, std::string> >, 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<std::string, std::allocator<std::string>
>::vector<boost::transform_iterator<boost::algorithm::detail::copy_iterator_rangeF<std::string,
__gnu_cxx::__normal_iterator<char*, std::string> >, boost::algorithm::split_iterator<__gnu_cxx::__normal_iterator<char*, std::string> >, 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::vector<std::string, std::allocator<std::string> >, std::string, boost::algorithm::detail::token_finderF<boost::algorithm::detail::is_any_ofF<char>
> > (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





Take your broken version and minimize it until it matches with your small code. Make sure you always use same inputs. During this process, you will find the error.
– Jodocus
Jul 2 at 10:21





Can't help you without a minimal reproducible example
– Mikhail
Jul 2 at 19:02









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

7Dd,mL,JMYPOosQbkMKf8UpDlPjJ ztUy65tQfBPgw,FTUQN D3Yce4ZvnWNYeMNmurPfeUZjSQ3dgHwVPfQOAPw PJpTeA8yj9T WFT
kdNEejQJJyW0t1,GxVi6,M0oyQ2Esmar2u3ABdfysl4 uBvW r86BtLp5kE98h4v VU n7G6G6BNtF4PHw2th,KZm,Zqmy1SOL

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications