Search

memory leak for std::thread by Guo Xiaodong

Closed
as Fixed Help for as Fixed

2
0
Sign in
to vote
Type: Bug
ID: 773429
Opened: 12/4/2012 8:18:32 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
The thread class implemented in Visual Studio 2012 has a bug:
if use it several times, there are 44 bytes memory leak always.
The follow code can witness the BUG:

int main(int, char**)
{
    _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
    std::thread thr([](void){});
    thr.join();
    return 0;
}
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

Steps to reproduce

#include <stdlib.h>
#include <crtdbg.h>
#include <thread>

int main(int, char**)
{
    _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
    std::thread thr([](void){});
    thr.join();
    return 0;
}

Product Language

Chinese - Simplified

Operating System

Windows 8

Operating System Language

Chinese (PRC)

Actual results

Detected memory leaks!
Dumping objects ->
{224} normal block at 0x014E4858, 44 bytes long.
Data: <                > 01 00 00 00 00 00 00 00 00 00 00 00 12 00 00 00
Object dump complete.

Expected results

No memory leaks detected.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 12/17/2012 at 4:37 PM
Hi,

Thanks for reporting this bug. We've fixed it, and the fix will be available in the next release of our C++ Standard Library implementation.

Note: Connect doesn't notify me about comments. If you have any further questions, please E-mail me.

Stephan T. Lavavej
Senior Developer - Visual C++ Libraries
stl@microsoft.com
Posted by Microsoft on 12/4/2012 at 7:12 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 12/4/2012 at 8:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.