Jan 17, 2009 at 6:38am UTC
my process coredumped, the following is the result of bt in gdb:
#0 0x08197a4d in std::_List_iterator_base::_M_incr (this=0xbf95db30) at stl_list.h:116
#1 0x081a60db in std::_List_iterator<CSubEvent*, CSubEvent* const&, CSubEvent* const*>::operator++ (this=0xbf95db30)
at stl_list.h:177
#2 0x081a60ba in __distance<std::_List_iterator<CSubEvent*, CSubEvent* const&, CSubEvent* const*> > (__first=
{<std::_List_iterator_base> = {_M_node = 0x0}, <No data fields>}, __last=
{<std::_List_iterator_base> = {_M_node = 0x84f6010}, <No data fields>}) at stl_iterator_base_funcs.h:82
#3 0x081a6079 in distance<std::_List_iterator<CSubEvent*, CSubEvent* const&, CSubEvent* const*> > (__first=
{<std::_List_iterator_base> = {_M_node = 0x830aeac}, <No data fields>}, __last=
{<std::_List_iterator_base> = {_M_node = 0x84f6010}, <No data fields>}) at stl_iterator_base_funcs.h:114
#4 0x081a5fe1 in std::list<CSubEvent*, std::allocator<CSubEvent*> >::size (this=0x94f0590) at stl_list.h:632
...
in #3, __first= {<std::_List_iterator_base> = {_M_node = 0x0}, <No data fields>},
in #2, __first= {<std::_List_iterator_base> = {_M_node = 0x0}, <No data fields>},
I looked into stl_iterator_base_funcs.h, it just passed __first and I don't know why __first changed?
the following is the codes that #3 called the function in #2
__distance(__first, __last, __iterator_category(__first));
Jan 17, 2009 at 3:30pm UTC
Unless you compiled with -ggdb3 (and maybe even then) I wouldn't trust gdb to interpret the stack frames correctly. I has difficult with heavily templated code such as the STL.
I'd look at the last few stack frames that are inside your own code.