Pete, I yesterday faced the bug as well. Funny thing is, that even Boost Unit Testing Framework reports the memory leak. It is really simple to reproduce: struct some_thread_function { void operator()()const { //really simple code here, to make some calculations in a thread ;) } } void test_threading_lib() { { boost::thread_group grp; for(int i=0; i<100; ++i) //create 100 threads grp.create_thread(some_thread_function()); grp.join_all(); } BOOST_MESSAGE( "Memory leak should be identified..." ); } This already produces a mem leak in unit testing framework: test_suite* init_unit_test_suite( int argc, char* argv[] ) { test_suite* test = BOOST_TEST_SUITE( "Test for memory leak" ); test->add( BOOST_TEST_CASE( &test_threading_lib ) ); return test; } Thanks, Ovanes -----Original Message----- From: pete@mu.org [mailto:pete@mu.org] Sent: Friday, January 19, 2007 11:15 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Does boost::thread_group::create_thread havememory leak? On Fri, Jan 19, 2007 at 11:26:50AM +0100, Roland Schwarz wrote:
pete@mu.org wrote:
I've been trying to track down memory leak being reported by valgrind. <snipped> /usr/lib/libboost_thread-mt.so.1.33.1)
Version 1.33 is know to have a memory leak, but I am surprised that it shows up on linux. Can you repeat this with the 1.34 CVS version?
I complied against the latest cvs version and still got the leak.
boost::thread_group::create_thread(boost::function0