This is the backtrace and the first two stack frame does not give me any meaning. stack frame number 2 is the problem
the segFault occur in a line where there is no execution. it is a bit confusing for me.
Breakpoint 1, ComputeStatistics () at ../scratch/den.cc:95
95 std::vector<uint64_t>::iterator vi;
(gdb) next
99 uint64_t sum_RxTime = 0;
(gdb)
103 std::cout<<" CALLED33 Trace "<<std::endl;
(gdb)
CALLED33 Trace
105 if (globalIrtMap == NULL) {
(gdb)
111 for (std::map<uint64_t, std::map<uint64_t, std::vector<uint64_t>*>*>::iterator i=globalIrtMap->begin(); i!=globalIrtMap->end(); ++i)
(gdb)
113 std::cout<<" CALLED55 Trace "<<std::endl;
(gdb)
CALLED55 Trace
115 std::map<uint64_t, std::vector<uint64_t>*>* irtMap = (*i).second;
(gdb)
117 std::cout <<" rxId "<< (*i).first << " IrtMap " << (*i).second <<endl;
(gdb)
rxId 15642270892032 IrtMap 0x11d700000000
118 //std::cout << "irtMap.size() is " << irtMap->size() <<endl;
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0x000000000042a698 in std::_Rb_tree<unsigned long, std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long> >*>, std::_Select1st<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long> >*> >, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long> >*> > >::size (this=0x11d700000000)
at /usr/include/c++/4.8/bits/stl_tree.h:728
728 { return _M_impl._M_node_count; }
(gdb) backtrace
#0 0x000000000042a698 in std::_Rb_tree<unsigned long, std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long> >*>, std::_Select1st<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long> >*> >, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long> >*> > >::size (
this=0x11d700000000) at /usr/include/c++/4.8/bits/stl_tree.h:728
#1 0x0000000000428c24 in std::map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long> >*, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long> >*> > >::size (this=0x11d700000000)
at /usr/include/c++/4.8/bits/stl_map.h:435
#2 0x000000000040db46 in ComputeStatistics () at ../scratch/den.cc:118
#3 0x0000000000423b3b in main (argc=1, argv=0x7fffffffe2c8) at ../scratch/den.cc:2180
(gdb) up
#1 0x0000000000428c24 in std::map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long> >*, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long> >*> > >::size (this=0x11d700000000)
at /usr/include/c++/4.8/bits/stl_map.h:435
435 { return _M_t.size(); }
(gdb) up
#2 0x000000000040db46 in ComputeStatistics () at ../scratch/den.cc:118
118 //std::cout << "irtMap.size() is " << irtMap->size() <<endl;
(gdb)
One thing i want to reply concerning how to print the size of the map and identify how many entries it has.