
I found a memory leak in boost's thread class. Here is the sample program: void func() { } int _tmain(int argc, _TCHAR* argv[]) { _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG); { thread t(func); t.join(); } _CrtDumpMemoryLeaks(); return 0; } The output is: The thread 'Win32 Thread' (0xb24) has exited with code 0 (0x0). Detected memory leaks! Dumping objects -> {188} normal block at 0x003A9DA8, 24 bytes long. Data: < - > D0 2D 15 00 FF FF FF FF 00 00 00 00 00 00 00 00 {187} normal block at 0x003A9C78, 8 bytes long. Data: < : > A8 9D 3A 00 01 CD CD CD Object dump complete. So I think boost should resolve this problem in the next version.

This issue has been reported multiple times as shown in the following link: http://lists.boost.org/boost-users/2006/08/21398.php http://lists.boost.org/boost-users/2006/08/21398.php It seems that the Threads library is not being actively maintained. Regards, Jason ________________________________ From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of ???? Sent: Saturday, September 16, 2006 3:31 AM To: boost-users@lists.boost.org Subject: [Boost-users] Memory leask in class thread. I found a memory leak in boost's thread class. Here is the sample program: void func() { } int _tmain(int argc, _TCHAR* argv[]) { _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG); { thread t(func); t.join(); } _CrtDumpMemoryLeaks(); return 0; } The output is: The thread 'Win32 Thread' (0xb24) has exited with code 0 (0x0). Detected memory leaks! Dumping objects -> {188} normal block at 0x003A9DA8, 24 bytes long. Data: < - > D0 2D 15 00 FF FF FF FF 00 00 00 00 00 00 00 00 {187} normal block at 0x003A9C78, 8 bytes long. Data: < : > A8 9D 3A 00 01 CD CD CD Object dump complete. So I think boost should resolve this problem in the next version.

"Aubrey, Jason"
This issue has been reported multiple times as shown in the following link: http://lists.boost.org/boost-users/2006/08/21398.php http://lists.boost.org/boost-users/2006/08/21398.php It seems that the Threads library is not being actively maintained.
There is at least one problem with a microsoft tool complaining about a leak in boost threads, which is in fact just a singleton that has no requirement to release its constant resources. I don't know if this here is the same issue but if it is, it's probably something worth pointing out in the documentation. Best regards, Jens

Aubrey, Jason wrote:
This issue has been reported multiple times as shown in the following link: http://lists.boost.org/boost-users/2006/08/21398.php It seems that the Threads library is not being actively maintained.
This is fixed in http://boost.cvs.sourceforge.net/*checkout*/boost/boost/libs/thread/src/tss_... but the fix is currently scheduled to appear in 1.35. I'll ask on the developer list whether to merge it into 1.34 as well.

Aubrey, Jason wrote:
This issue has been reported multiple times as shown in the following link: http://lists.boost.org/boost-users/2006/08/21398.php It seems that the Threads library is not being actively maintained.
Sorry, I overlooked this mail. The thread lib currently is maintained by me, but I have been busy with other things in the last time. Can you tell me please for which version of boost you are seeing this error? I remember vaguely that something similar has been already resolved and I suspect the fix to be in upcoming 1.34. The reported bug seems to have nothing to do with tss. It is known, that tss with VC memory debuging has a problem, but is known to be harmless, but annoying. I did not yet have found a way to get rid of it. Roland

This issue has been reported multiple times as shown in the following
Environment: * MSVC 7.1 and 8.0 * Boost v1.33.1 Regards, Jason -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Roland Schwarz Sent: Sunday, September 17, 2006 10:29 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Memory leask in class thread. Aubrey, Jason wrote: link:
http://lists.boost.org/boost-users/2006/08/21398.php It seems that the Threads library is not being actively maintained.
Sorry, I overlooked this mail. The thread lib currently is maintained by me, but I have been busy with other things in the last time. Can you tell me please for which version of boost you are seeing this error? I remember vaguely that something similar has been already resolved and I suspect the fix to be in upcoming 1.34. The reported bug seems to have nothing to do with tss. It is known, that tss with VC memory debuging has a problem, but is known to be harmless, but annoying. I did not yet have found a way to get rid of it. Roland _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (5)
-
Aubrey, Jason
-
Jens Theisen
-
Peter Dimov
-
Roland Schwarz
-
蹬三轮的