umd-memsys / DRAMSim2

DRAMSim2: A cycle accurate DRAM simulator
http://www.ece.umd.edu/~blj/papers/cal10-1.pdf
258 stars 150 forks source link

Bad Alloc #41

Open ahmed-shafik opened 10 years ago

ahmed-shafik commented 10 years ago

Dears,

I get the below error while creating a new rank object because of adding new bankstates (nextWrite_H & nextRead_H) in BankState.h and BankState.cpp. Do you know why?

class BankState { ostream &dramsim_log; public: //Fields CurrentBankState currentBankState; unsigned openRowAddress; uint64_t nextRead; uint64_t nextWrite; uint64_t nextRead_H; uint64_t nextWrite_H; uint64_t nextActivate; uint64_t nextPrecharge; uint64_t nextPowerUp;

BusPacketType lastCommand;
unsigned stateChangeCountdown;

//Functions
BankState(ostream &dramsim_log_);
void print();

}; }

//All banks start precharged BankState::BankState(ostream &dramsimlog): dramsim_log(dramsimlog), currentBankState(Idle), openRowAddress(0), nextRead(0), nextRead_H(0), nextWrite(0), nextWrite_H(0), nextActivate(0), nextPrecharge(0), nextPowerUp(0), lastCommand(READ), stateChangeCountdown(0) {}

Rank *r = new Rank(dramsim_log); terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)

ahmed-shafik commented 10 years ago

I used gdb and get below (_n=18446744073709547290) after statement return size_type(this->_M_impl._M_finish - this->_M_impl._M_start) although in normal state the (n=2048). Do you know why ? DRAMSim::Rank::Rank (this=0x6534e0, dramsimlog=...) at Rank.cpp:48 48 bankStates(NUM_BANKS, BankState(dramsimlog)) (gdb) DRAMSim::SimulatorObject::SimulatorObject (this=0x6534e0) at SimulatorObject.h:50 50 class SimulatorObject (gdb) std::vector<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::vector (this=0x653538) at /usr/include/c++/4.7/bits/stl_vector.h:247 247 : _Base() { } (gdb) std::_Vector_base<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::_Vector_base (this=0x653538) at /usr/include/c++/4.7/bits/stl_vector.h:126 126 : _M_impl() { } (gdb) std::_Vector_base<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::_Vector_impl::_Vector_impl (this=0x653538) at /usr/include/c++/4.7/bits/stl_vector.h:88 88 : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0) (gdb) std::allocatorDRAMSim::BusPacket*::allocator (this=0x653538) at /usr/include/c++/4.7/bits/allocator.h:104 104 allocator() throw() { } (gdb) gnu_cxx::new_allocatorDRAMSim::BusPacket::new_allocator (this=0x653538) at /usr/include/c++/4.7/ext/new_allocator.h:69 69 new_allocator() _GLIBCXX_USE_NOEXCEPT { } (gdb) std::_Vector_base<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::_Vector_impl::_Vector_impl (this=0x653538) at /usr/include/c++/4.7/bits/stl_vector.h:89 89 { } (gdb) std::allocator::allocator (this=0x7fffffffdf00) at /usr/include/c++/4.7/bits/allocator.h:104 104 allocator() throw() { } (gdb) gnu_cxx::new_allocator::new_allocator (this=0x7fffffffdf00) at /usr/include/c++/4.7/ext/new_allocator.h:69 69 new_allocator() _GLIBCXX_USE_NOEXCEPT { } (gdb) std::vector<unsigned int, std::allocator >::vector (this=0x653550, n=0, value=@0x7fffffffdefc: 0, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:294 294 : _Base(n, a) (gdb) std::_Vector_base<unsigned int, std::allocator >::_Vector_base (this=0x653550, n=0, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:136 136 : _M_impl(a) (gdb) std::_Vector_base<unsigned int, std::allocator >::_Vector_impl::_Vector_impl (this=0x653550, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:92 92 : _Tp_alloc_type(a), _M_start(0), _M_finish(0), _M_end_of_storage(0) (gdb) std::allocator::allocator (this=0x653550, a=...) at /usr/include/c++/4.7/bits/allocator.h:107 107 : glibcxx_base_allocator<_Tp>(a) { } (gdb) gnu_cxx::new_allocator::new_allocator (this=0x653550) at /usr/include/c++/4.7/ext/new_allocator.h:71 71 new_allocator(const new_allocator&) _GLIBCXX_USE_NOEXCEPT { } (gdb) std::_Vector_base<unsigned int, std::allocator >::_Vector_impl::_Vector_impl (this=0x653550, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:93 93 { } (gdb) std::_Vector_base<unsigned int, std::allocator >::_Vector_base (this=0x653550, n=0, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:137 137 { _M_create_storage(n); } //create storage for n=0 banks (gdb) std::_Vector_base<unsigned int, std::allocator >::_M_create_storage (this=0x653550, n=0) at /usr/include/c++/4.7/bits/stl_vector.h:182 182 this->_M_impl._M_start = this->_M_allocate(n); (gdb) std::_Vector_base<unsigned int, std::allocator >::_M_allocate (this=0x653550, n=0) at /usr/include/c++/4.7/bits/stl_vector.h:169 169 { return n != 0 ? _M_impl.allocate(n) : 0; } (gdb) std::_Vector_base<unsigned int, std::allocator >::_M_create_storage (this=0x653550, __n=0) at /usr/include/c++/4.7/bits/stl_vector.h:183 183 this->_M_impl._M_finish = this->_M_impl._M_start; (gdb) 184 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + n; (gdb) 185 } //till now nothing sholud be created as _M_finish=_M_start = zero (gdb) std::vector<unsigned int, std::allocator >::vector (this=0x653550, n=0, value=@0x7fffffffdefc: 0, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:295 295 { _M_fill_initialize(n, value); } (gdb) std::vector<unsigned int, std::allocator >::_M_fill_initialize (this=0x653550, n=0, value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_vector.h:1181 1181 std::uninitialized_fill_n_a(this->_M_impl._M_start, n, value, _M_get_Tp_allocator()); (gdb) std::_Vector_base<unsigned int, std::allocator >::_M_get_Tp_allocator (this=0x653550) at /usr/include/c++/4.7/bits/stl_vector.h:115 115 { return _static_cast<_Tp_alloc_type_>(&this->_M_impl); } (gdb) std::__uninitialized_fill_n_a<unsigned int, unsigned long, unsigned int, unsigned int> (first=0x0, n=0, x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:336 336 { std::uninitialized_fill_n(first, n, x); } // x = value=@0x7fffffffdefc (gdb) std::uninitialized_fill_n<unsigned int*, unsigned long, unsigned int> (first=0x0, n=0, x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:225 225 std::uninitialized_fill_n<is_trivial(_ValueType)>:: (gdb) std::uninitialized_fill_n::uninit_fill_n<unsigned int*, unsigned long, unsigned int> (first=0x0, n=0, x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:206 206 { std::fill_n(first, n, x); } (gdb) std::fill_n<unsigned int*, unsigned long, unsigned int> (first=0x0, n=0, value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_algobase.h:780 780 return _OI(std::fill_n_a(std::__niter_base(first), n, value)); (gdb) std::niter_base<unsigned int> (it=0x0) at /usr/include/c++/4.7/bits/stl_algobase.h:272 272 { return std::_Niter_base<_Iterator>::_S_base(it); } // it is iterator and it points on first (gdb) std::_Iter_base<unsigned int, false>::_S_base (__it=0x0) at /usr/include/c++/4.7/bits/stl_iterator_base_types.h:214 214 { return it; } (gdb) std::fill_n_a<unsigned int*, unsigned long, unsigned int> (first=0x0, n=0, value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_algobase.h:742 742 const _Tp tmp = value; (gdb) 743 for (decltype(n + 0) niter = n; //for loop for n (gdb) 746 return first; (gdb) 747 } (gdb) std::fill_n<unsigned int, unsigned long, unsigned int> (first=0x0, n=0, __value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_algobase.h:781 781 } (gdb) std::uninitialized_fill_n<unsigned int, unsigned long, unsigned int> (first=0x0, n=0, x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:227 227 } (gdb) std::vector<unsigned int, std::allocator >::_M_fill_initialize (this=0x653550, n=0, value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_vector.h:1183 1183 this->_M_impl._M_finish = this->_M_impl._M_end_of_storage; (gdb) 1184 } (gdb) std::allocator::~allocator (this=0x7fffffffdf00, __in_chrg=) at /usr/include/c++/4.7/bits/allocator.h:112 112 ~allocator() throw() { } // I think throw is called and finished the 1st allocation // jump by 4 --> 0x7fffffffdf00 - 0x7fffffffdefc = 4 (gdb) gnu_cxx::new_allocator::~new_allocator (this=0x7fffffffdf00, in_chrg=) at /usr/include/c++/4.7/ext/new_allocator.h:76 76 ~new_allocator() _GLIBCXX_USE_NOEXCEPT { } // new allocator is called (gdb) std::vector<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::vector (this=0x653568) at /usr/include/c++/4.7/bits/stl_vector.h:247 247 : _Base() { } (gdb) std::_Vector_base<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::_Vector_base (this=0x653568) at /usr/include/c++/4.7/bits/stl_vector.h:126 126 : _M_impl() { } (gdb) std::_Vector_base<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::_Vector_impl::_Vector_impl (this=0x653568) at /usr/include/c++/4.7/bits/stl_vector.h:88 88 : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0) (gdb) std::allocatorDRAMSim::BusPacket::allocator (this=0x653568) at /usr/include/c++/4.7/bits/allocator.h:104 104 allocator() throw() { } (gdb) __gnu_cxx::new_allocatorDRAMSim::BusPacket::new_allocator (this=0x653568) at /usr/include/c++/4.7/ext/new_allocator.h:69 69 new_allocator() _GLIBCXX_USE_NOEXCEPT { } (gdb) std::_Vector_base<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::_Vector_impl::_Vector_impl (this=0x653568) at /usr/include/c++/4.7/bits/stl_vector.h:89 89 { } (gdb) std::allocator::allocator (this=0x7fffffffdf00) at /usr/include/c++/4.7/bits/allocator.h:104 104 allocator() throw() { } (gdb) gnu_cxx::new_allocator::new_allocator (this=0x7fffffffdf00) at /usr/include/c++/4.7/ext/new_allocator.h:69 69 new_allocator() _GLIBCXX_USE_NOEXCEPT { } (gdb) std::vector<unsigned int, std::allocator >::vector (this=0x653580, n=0, value=@0x7fffffffdefc: 0, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:294 294 : _Base(n, a) (gdb) std::_Vector_base<unsigned int, std::allocator >::_Vector_base (this=0x653580, n=0, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:136 136 : _M_impl(a) // 0x653580 - 0x653568 = 12 ????? (gdb) std::_Vector_base<unsigned int, std::allocator >::_Vector_impl::_Vector_impl (this=0x653580, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:92 92 : _Tp_alloc_type(a), _M_start(0), _M_finish(0), _M_end_of_storage(0) (gdb) std::allocator::allocator (this=0x653580, a=...) at /usr/include/c++/4.7/bits/allocator.h:107 107 : __glibcxx_base_allocator<_Tp>(a) { } (gdb) gnu_cxx::new_allocator::new_allocator (this=0x653580) at /usr/include/c++/4.7/ext/new_allocator.h:71 71 new_allocator(const new_allocator&) _GLIBCXX_USE_NOEXCEPT { } (gdb) std::_Vector_base<unsigned int, std::allocator >::_Vector_impl::_Vector_impl (this=0x653580, __a=...) at /usr/include/c++/4.7/bits/stl_vector.h:93 93 { } (gdb) std::_Vector_base<unsigned int, std::allocator >::_Vector_base (this=0x653580, n=0, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:137 137 { _M_create_storage(n); } (gdb) std::_Vector_base<unsigned int, std::allocator >::_M_create_storage (this=0x653580, n=0) at /usr/include/c++/4.7/bits/stl_vector.h:182 182 this->_M_impl._M_start = this->_M_allocate(n); (gdb) std::_Vector_base<unsigned int, std::allocator >::_M_allocate (this=0x653580, n=0) at /usr/include/c++/4.7/bits/stl_vector.h:169 169 { return n != 0 ? _M_impl.allocate(n) : 0; } (gdb) std::_Vector_base<unsigned int, std::allocator >::_M_create_storage (this=0x653580, __n=0) at /usr/include/c++/4.7/bits/stl_vector.h:183 183 this->_M_impl._M_finish = this->_M_impl._M_start; (gdb) 184 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + n; (gdb) 185 } //till now nothing new just like before (gdb) std::vector<unsigned int, std::allocator >::vector (this=0x653580, n=0, value=@0x7fffffffdefc: 0, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:295 295 { _M_fill_initialize(n, value); } (gdb) std::vector<unsigned int, std::allocator >::_M_fill_initialize (this=0x653580, n=0, value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_vector.h:1181 1181 std::uninitialized_fill_n_a(this->_M_impl._M_start, n, value, (gdb) std::_Vector_base<unsigned int, std::allocator >::_M_get_Tp_allocator (this=0x653580) at /usr/include/c++/4.7/bits/stl_vector.h:115 115 { return _static_cast<_Tp_alloc_type_>(&this->_M_impl); } (gdb)

std::uninitialized_fill_n_a<unsigned int*, unsigned long, unsigned int, unsigned int> (first=0x0, n=0, __x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:336 336 { std::uninitialized_fill_n(first, n, x); } (gdb) std::uninitialized_fill_n<unsigned int*, unsigned long, unsigned int> (first=0x0, n=0, __x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:225 225 std::uninitialized_fill_n<is_trivial(_ValueType)>::

(gdb) std::uninitialized_fill_n::uninit_fill_n<unsigned int, unsigned long, unsigned int> (first=0x0, n=0, x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:206 206 { std::fill_n(first, n, x); } (gdb) std::fill_n<unsigned int, unsigned long, unsigned int> (first=0x0, n=0, value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_algobase.h:780 780 return _OI(std::fill_n_a(std::niter_base(first), n, value)); (gdb) std::niter_base<unsigned int*> (it=0x0) at /usr/include/c++/4.7/bits/stl_algobase.h:272 272 { return std::_Niter_base<_Iterator>::_S_base(it); } (gdb) std::_Iter_base<unsigned int*, false>::_S_base (it=0x0) at /usr/include/c++/4.7/bits/stl_iterator_base_types.h:214 214 { return __it; } (gdb)

std::fill_n_a<unsigned int*, unsigned long, unsigned int> (first=0x0, n=0, value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_algobase.h:742 742 const _Tp tmp = value; (gdb) 743 for (decltype(n + 0) niter = n; (gdb) 746 return first; (gdb) 747 } (gdb) std::fill_n<unsigned int, unsigned long, unsigned int> (first=0x0, n=0, __value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_algobase.h:781 781 } (gdb) std::uninitialized_fill_n<unsigned int, unsigned long, unsigned int> (first=0x0, n=0, x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:227 227 } (gdb) std::vector<unsigned int, std::allocator >::_M_fill_initialize (this=0x653580, n=0, value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_vector.h:1183 1183 this->_M_impl._M_finish = this->_M_impl._M_end_of_storage; (gdb) 1184 } (gdb) std::allocator::~allocator (this=0x7fffffffdf00, in_chrg=) at /usr/include/c++/4.7/bits/allocator.h:112 112 ~allocator() throw() { } (gdb) __gnu_cxx::new_allocator::~new_allocator (this=0x7fffffffdf00, in_chrg=) at /usr/include/c++/4.7/ext/new_allocator.h:76 76 ~new_allocator() _GLIBCXX_USE_NOEXCEPT { } (gdb) std::allocatorDRAMSim::Bank::allocator (this=0x7fffffffdefb) at /usr/include/c++/4.7/bits/allocator.h:104 104 allocator() throw() { } (gdb) gnu_cxx::new_allocatorDRAMSim::Bank::new_allocator (this=0x7fffffffdefb) at /usr/include/c++/4.7/ext/new_allocator.h:69 69 new_allocator() _GLIBCXX_USE_NOEXCEPT { } (gdb) std::vector<DRAMSim::Bank, std::allocator >::vector (this=0x653598, n=8, value=..., a=...) at /usr/include/c++/4.7/bits/stl_vector.h:294 294 : _Base(n, a) //here is n =8 which returns the NUM_BANKS (gdb) std::_Vector_base<DRAMSim::Bank, std::allocator >::_Vector_base (this=0x653598, n=8, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:136 136 : _M_impl(a) (gdb) std::_Vector_base<DRAMSim::Bank, std::allocator >::_Vector_impl::_Vector_impl (this=0x653598, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:92 92 : _Tp_alloc_type(a), _M_start(0), _M_finish(0), _M_end_of_storage(0) (gdb) std::allocatorDRAMSim::Bank::allocator (this=0x653598, a=...) at /usr/include/c++/4.7/bits/allocator.h:107 107 : glibcxx_base_allocator<_Tp>(a) { } (gdb) gnu_cxx::new_allocatorDRAMSim::Bank::new_allocator (this=0x653598) at /usr/include/c++/4.7/ext/new_allocator.h:71 71 new_allocator(const new_allocator&) _GLIBCXX_USE_NOEXCEPT { } (gdb) std::_Vector_base<DRAMSim::Bank, std::allocator >::_Vector_impl::_Vector_impl (this=0x653598, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:93 93 { } (gdb) std::_Vector_base<DRAMSim::Bank, std::allocator >::_Vector_base (this=0x653598, n=8, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:137 137 { _M_create_storage(__n); } (gdb) std::_Vector_base<DRAMSim::Bank, std::allocator >::_M_create_storage (this=0x653598, n=8) at /usr/include/c++/4.7/bits/stl_vector.h:182 182 this->_M_impl._M_start = this->_M_allocate(n); (gdb) std::_Vector_base<DRAMSim::Bank, std::allocator >::_M_allocate (this=0x653598, n=8) at /usr/include/c++/4.7/bits/stl_vector.h:169 169 { return n != 0 ? _M_impl.allocate(n) : 0; } //here _n !=0 so go to allocate (gdb) gnu_cxx::new_allocatorDRAMSim::Bank::allocate (this=0x653598, n=8) at /usr/include/c++/4.7/ext/new_allocator.h:91 91 if (n > this->max_size()) //How to get the max_size () ?? (gdb) gnu_cxx::new_allocatorDRAMSim::Bank::max_size (this=0x653598) at /usr/include/c++/4.7/ext/new_allocator.h:104 104 { return size_t(-1) / sizeof(_Tp); } (gdb) gnu_cxx::new_allocatorDRAMSim::Bank::allocate (this=0x653598, n=8) at /usr/include/c++/4.7/ext/new_allocator.h:94 94 return static_cast<_Tp_>(::operator new(n * sizeof(Tp))); //from here it detrmines that the if statement return no and create new object n size of (_Tp) (gdb) 95 } (gdb) std::_Vector_base<DRAMSim::Bank, std::allocator >::_M_create_storage (this=0x653598, n=8) at /usr/include/c++/4.7/bits/stl_vector.h:183 183 this->_M_impl._M_finish = this->_M_impl._M_start; (gdb) 184 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + n; (gdb) 185 } (gdb) std::vector<DRAMSim::Bank, std::allocator >::vector (this=0x653598, n=8, value=..., a=...) at /usr/include/c++/4.7/bits/stl_vector.h:295 295 { _M_fill_initialize(n, value); } (gdb) std::vector<DRAMSim::Bank, std::allocator >::_M_fill_initialize (this=0x653598, n=8, value=...) at /usr/include/c++/4.7/bits/stl_vector.h:1181 1181 std::uninitialized_fill_n_a(this->_M_impl._M_start, n, value,_M_get_Tp_allocator()); (gdb) std::_Vector_base<DRAMSim::Bank, std::allocator >::_M_get_Tp_allocator (this=0x653598) at /usr/include/c++/4.7/bits/stl_vector.h:115 115 { return _static_cast<_Tp_alloc_type_>(&this->_M_impl); } (gdb) std::uninitialized_fill_n_a<DRAMSim::Bank, unsigned long, DRAMSim::Bank, DRAMSim::Bank> (first=0x6535d0, n=8, __x=...) at /usr/include/c++/4.7/bits/stl_uninitialized.h:336 336 { std::uninitialized_fill_n(first, n, __x); } (gdb) std::uninitialized_fill_n<DRAMSim::Bank, unsigned long, DRAMSim::Bank> (first=0x6535d0, n=8, __x=...) at /usr/include/c++/4.7/bits/stl_uninitialized.h:225 225 std::uninitialized_fill_n<is_trivial(_ValueType)>:: (gdb)

std::uninitialized_fill_n::uninit_fill_n<DRAMSim::Bank, unsigned long, DRAMSim::Bank> (first=0x6535d0, n=8, x=...) at /usr/include/c++/4.7/bits/stl_uninitialized.h:185 185 _ForwardIterator cur = first; (gdb) 188 for (; n > 0; --n, ++cur) (gdb) 189 std::_Construct(std::__addressof(cur), x);

(gdb) std::addressofDRAMSim::Bank (r=...) at /usr/include/c++/4.7/bits/move.h:50

50 (&const_cast<char&>(reinterpret_cast<const volatile char&>(r))); (gdb) 51 } (gdb) std::_Construct<DRAMSim::Bank, DRAMSim::Bank> (p=0x6535d0, value=...) at /usr/include/c++/4.7/bits/stl_construct.h:85 85 ::new(static_cast<void*>(__p)) _T1(value); (gdb) operator new (p=0x6535d0) at /usr/include/c++/4.7/new:112 112 { return p; } (gdb) DRAMSim::Bank::Bank (this=0x6535d0) at Bank.h:54 54 class Bank (gdb) std::vector<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::vector (this=0x653620, x=...) at /usr/include/c++/4.7/bits/stl_vector.h:309 309 _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator())) (gdb) std::_Vector_base<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::_M_get_Tp_allocator (this=0x7fffffffdf50) at /usr/include/c++/4.7/bits/stl_vector.h:119 119 { return _static_cast(&this->_M_impl); } (gdb) gnu_cxx::alloc_traitsstd::allocator<DRAMSim::Bank::_DataStruct* >::_S_select_on_copy (a=...) at /usr/include/c++/4.7/ext/alloc_traits.h:211 211 static const _Alloc& _S_select_on_copy(const _Alloc& a) { return a; } (gdb) std::vector<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::size (this=0x7fffffffdf50) at /usr/include/c++/4.7/bits/stl_vector.h:626 626 { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); } (gdb) std::_Vector_base<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::_Vector_base (this=0x653620, n=18446744073709547290, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:136 136 : _M_impl(a) (gdb) std::_Vector_base<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::_Vector_impl::_Vector_impl (this=0x653620, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:92 92 : _Tp_alloc_type(a), _M_start(0), _M_finish(0), _M_end_of_storage(0) (gdb) std::allocatorDRAMSim::Bank::_DataStruct*::allocator (this=0x653620, a=...) at /usr/include/c++/4.7/bits/allocator.h:107 107 : glibcxx_base_allocator<_Tp>(a) { } (gdb) gnu_cxx::new_allocatorDRAMSim::Bank::_DataStruct::new_allocator (this=0x653620) at /usr/include/c++/4.7/ext/new_allocator.h:71 71 new_allocator(const new_allocator&) _GLIBCXX_USE_NOEXCEPT { } (gdb) std::_Vector_base<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct*> >::_Vector_impl::_Vector_impl (this=0x653620, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:93 93 { } (gdb) std::_Vector_base<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::_Vector_base (this=0x653620, n=18446744073709547290, a=...) at /usr/include/c++/4.7/bits/stl_vector.h:137 137 { _M_create_storage(n); } (gdb) std::_Vector_base<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::_M_create_storage (this=0x653620, __n=18446744073709547290) at /usr/include/c++/4.7/bits/stl_vector.h:182 182 this->_M_impl._M_start = this->_M_allocate(n); (gdb) std::_Vector_base<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::_M_allocate (this=0x653620, n=18446744073709547290) at /usr/include/c++/4.7/bits/stl_vector.h:169 169 { return n != 0 ? _M_impl.allocate(n) : 0; } wont return zero ofcourse (gdb) __gnu_cxx::new_allocatorDRAMSim::Bank::_DataStruct*::allocate (this=0x653620, n=18446744073709547290) at /usr/include/c++/4.7/ext/new_allocator.h:91 91 if (n > this->max_size()) // greater ya ???? n=18446744073709547290 (gdb) gnu_cxx::new_allocatorDRAMSim::Bank::_DataStruct*::max_size (this=0x653620) at /usr/include/c++/4.7/ext/new_allocator.h:104 104 { return size_t(-1) / sizeof(_Tp); } (gdb) gnu_cxx::new_allocatorDRAMSim::Bank::_DataStruct*::allocate (this=0x653620, __n=18446744073709547290) at /usr/include/c++/4.7/ext/new_allocator.h:92 92 std::__throw_bad_alloc(); (gdb) terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc