id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 9128,Vector deallocation with pool_allocator enters a dead loop,Dragan Vidovic ,Chris Newbold,"Here is the complete test code to reproduce the bug: {{{#!c++ #include #include #include #include const size_t LARGE=200000, LEN=30; template < typename VEC > void time_it( const char* tag ) { VEC vec(LARGE); std::clock_t start = std::clock() ; for ( int i = 0 ; i < LARGE ; ++i ) vec[i].resize (LEN) ; std::cout << tag << "": "" << ( std::clock() - start ) / double(CLOCKS_PER_SEC) << "" secs.\n"" ; } #define TIME_IT( a ) time_it( #a ) ; int main() { typedef size_t T; typedef std::vector > std_vec ; typedef boost::pool_allocator boost_allocator; typedef std::vector > boost_vec; TIME_IT( std_vec ) ; TIME_IT( boost_vec ) ; return 0; } }}} It hangs while cleaning up at the end of the time_it function. I've seen with ddd that it hangs in boost/pool/simple_segregated_storage.hpp in the following block: {{{#!c++ while (true) { // if we're about to hit the end, or if we've found where ""ptr"" goes. if (nextof(iter) == 0 || std::greater()(nextof(iter), ptr)) return iter; iter = nextof(iter); } }}} If instead of pool_allocator I use fast_pool_allocator then this does not happen and it's equally slow. In this example pool_allocator takes about 4-5 times longer to allocate than the default one - I don't know why. I compiled it with g++-4.7 -O3 -g testPool5.cc under Ubuntu. I tried Boost versions 1.54.0 and 1.49.0. ",Bugs,new,To Be Determined,pool,Boost 1.54.0,Showstopper,,,