Boost logo

Boost Users :

From: Stephen Torri (storri_at_[hidden])
Date: 2007-04-13 17:43:06


On Fri, 2007-04-13 at 00:30 +0300, Peter Dimov wrote:
> I see; so the error in property_map is caused by something else then. Here's
> the complete call stack at the time I get an assertion from the standard
> library... hopefully it can give you some clues as to why it attempts to
> create an invalid vector iterator. I can't help you more since I know
> nothing about the Graph library, maybe someone more familiar with it will
> take a look?

I build the test program with the -D_GLIBCXX_DEBUG defined. This is
suppose to turn on debugging for the standard template library in GCC
4.1.1. Here is the error report when I run the simple program along with
the gdb output:

[storri_at_localhost infrastructure]$ ./test_dag
Added edge: 1 -> 20
Added edge: 1 -> 30
Added edge: 1 -> 40
Added edge: 1 -> 5
Added edge: 20 -> 5
Added edge: 30 -> 5
Added edge: 40 -> 5
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c
++/4.1.1/debug/safe_iterator.h:277:
    error: attempt to advance a dereferenceable (start-of-sequence)
    iterator 20 steps, which falls outside its valid range.

Objects involved in the operation:
iterator @ 0x0xbfe4f8fc {
type =
N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPN5boost18default_color_typeEN10__gnu_norm6vectorIS4_SaIS4_EEEEEN15__gnu_debug_def6vectorIS4_S8_EEEE (mutable iterator);
  state = dereferenceable (start-of-sequence);
  references sequence with type
`N15__gnu_debug_def6vectorIN5boost18default_color_typeESaIS2_EEE' @
0x0xbfe4f8fc
}
Aborted

Program received signal SIGABRT, Aborted.
0x00aa5402 in __kernel_vsyscall ()
(gdb) bt
#0 0x00aa5402 in __kernel_vsyscall ()
#1 0x47bd9d40 in raise () from /lib/libc.so.6
#2 0x47bdb591 in abort () from /lib/libc.so.6
#3 0x47fef8a5 in __gnu_debug::_Error_formatter::_M_error () from /usr/lib/libstdc++.so.6
#4 0x0805e876 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<boost::default_color_type*, __gnu_norm::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >, __gnu_debug_def::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >::operator+= (this=0xbfc9f6dc,
    __n=@0xbfc9f6f0)
    at /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/debug/safe_iterator.h:275
#5 0x0805ec9b in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<boost::default_color_type*, __gnu_norm::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >, __gnu_debug_def::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >::operator+ (this=0xbfc9f890,
    __n=@0xbfc9f6f0)
    at /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/debug/safe_iterator.h:286
#6 0x0805ef4c in boost::iterator_property_map<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<boost::default_color_type*, __gnu_norm::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >, __gnu_debug_def::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >, boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, unsigned int, boost::property<boost::vertex_name_t, boost::shared_ptr<Component>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS>, unsigned int, unsigned int const&, boost::vertex_index_t>, boost::default_color_type, boost::default_color_type&>::operator[] (this=0xbfc9f890,
    v=0x85d52f0) at /usr/include/boost/property_map.hpp:349
#7 0x0805efac in boost::put<boost::iterator_property_map<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<boost::default_color_type*, __gnu_norm::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >, __gnu_debug_def::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >, boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, unsigned int, boost::property<boost::vertex_name_t, boost::shared_ptr<Component>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS>, unsigned int, unsigned int const&, boost::vertex_index_t>, boost::default_color_type, boost::default_color_type&>, boost::default_color_type&, void*, boost::default_color_type> (pa=@0xbfc9f890, k=0x85d52f0, v=@0xbfc9f7a0)
    at /usr/include/boost/property_map.hpp:319
#8 0x0807039d in boost::depth_first_search<boost::adjacency_list<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, unsigned int, boost::property<boost::vertex_name_t, boost::shared_ptr<C---Type <return> to continue, or q <return> to quit---
omponent>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS>, boost::topo_sort_visitor<std::back_insert_iterator<__gnu_debug_def::vector<void*, std::allocator<void*> > > >, boost::iterator_property_map<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<boost::default_color_type*, __gnu_norm::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >, __gnu_debug_def::vector<boost::default_color_type, std::allocator<boost::default_color_type> > >, boost::adj_list_vertex_property_map<boost::adjacency_list<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, unsigned int, boost::property<boost::vertex_name_t, boost::shared_ptr<Component>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS>, unsigned int, unsigned int const&, boost::vertex_index_t>, boost::default_color_type, boost::default_color_type&> > (g=@0xbfc9fa10, vis=
        {<boost::dfs_visitor<boost::null_visitor>> = {m_vis = {<> = {<No data fields>}, <No data fields>}}, m_iter = {<std::iterator<std::output_iterator_tag,void,void,void,void>> = {<No data fields>}, container = 0xbfc9fa8c}}, color=@0xbfc9f890, start_vertex=0x85d5270) at /usr/include/boost/graph/depth_first_search.hpp:197
#9 0x08070810 in boost::detail::dfs_dispatch<boost::detail::error_property_not_found>::apply<boost::adjacency_list<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, unsigned int, boost::property<boost::vertex_name_t, boost::shared_ptr<Component>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS>, void*, boost::topo_sort_visitor<std::back_insert_iterator<__gnu_debug_def::vector<void*, std::allocator<void*> > > >, boost::topo_sort_visitor<std::back_insert_iterator<__gnu_debug_def::vector<void*, std::allocator<void*> > > >, boost::graph_visitor_t, boost::bgl_named_params<int, boost::buffer_param_t, boost::no_property> > (g=@0xbfc9fa10, vis=
        {<boost::dfs_visitor<boost::null_visitor>> = {m_vis = {<> = {<No data fields>}, <No data fields>}}, m_iter = {<std::iterator<std::output_iterator_tag,void,void,void,void>> = {<No data fields>}, container = 0xbfc9fa8c}}, start_vertex=0x85d5270, params=@0xbfc9f984) at /usr/include/boost/graph/depth_first_search.hpp:246
#10 0x0807098e in boost::depth_first_search<boost::adjacency_list<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, unsigned int, boost::property<boost::vertex_name_t, boost::shared_ptr<Component>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS>, boost::topo_sort_visitor<std::back_insert_iterator<__gnu_debug_def::vector<void*, std::allocator<void*> > > >, boost::graph_visitor_t, boost::bgl_named_params<int, boost::buffer_param_t, boost::no_property> > (g=@0xbfc9fa10,
    params=@0xbfc9f984) at /usr/include/boost/graph/depth_first_search.hpp:324
#11 0x08070a06 in boost::topological_sort<boost::adjacency_list<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, unsigned int, boost::property<boost::vertex_name_t, boost::shared_ptr<Component>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS> const, std::back_insert_iterator<__gnu_debug_def::vector<void*, std::allocator<void*> > >, int, boost::buffer_param_t, boost::no_property> (g=@0xbfc9fa10, result=
      {<std::iterator<std::output_iterator_tag,void,void,void,void>> = {<No data fields>}, container = 0xbfc9fa8c}, params=@0xbfc9f9c4) at /usr/include/boost/graph/topological_sort.hpp:64
#12 0x08070a3a in boost::topological_sort<boost::adjacency_list<boost::setS, boost::setS, boost::directedS, boost::property<boost::vertex_index_t, unsigned int, boost::property<boost::vertex_name_t, boost::shared_ptr<Component>, boost::no_property> >, boost::no_property, boost::no_property, boost::listS> const, std::back_insert_iterator<__gnu_debug_def::vector<void*, std::allocator<void*> > > > (g=@0xbfc9fa10, result=
      {<std::iterator<std::output_iterator_tag,void,void,void,void>> = {<No data fields>}, container = 0xbfc9fa8c}) at /usr/include/boost/graph/topological_sort.hpp:70
#13 0x0804c436 in main () at test_dag.cpp:256

Stephen


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net