- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm on Windows 7 x64, Visual C++ Express 2012 Update 1, Win7.1 SDK platform, C++ 32 bit, debug build, using TBB for VC10:
When running the debug build, Visual Studio shows a number of memory leaks which after analysis were created by the TBB library. My original scenario has been rather complex, but after meticulous refactoring I was able to produce a minimal sample. I have an additional dependence to wxWidgets, an open source framework, which seems to have something to do with the leak (I suspect it's an indirect influence on the dll loading order). For some reason the combination of statically linking both wxWidgets debug dll and TBB dll causes the leak, without wxWidgets everything is fine.
On my machine I am able to consitently reproduce the behavior. So please let me know if I can help to debug this issue.
The test program is very short, so I present it here in total:
[cpp]#include <tbb/task_scheduler_init.h>
#include <tbb/parallel_for.h>
class __declspec(dllimport) wxStringBase
{
public:
wxStringBase() ;//
};
int gnaz = 0;
int main()
{
if (gnaz != 0)
new wxStringBase;
tbb::task_scheduler_init scheduler;
tbb::parallel_for(tbb::blocked_range<int>(0, 100, 2),
[=](const tbb::blocked_range<int>& r)
{
});
return 0;
}[/cpp]
The sole purpose of the " __declspec" is to trigger static dll linkage to the wxWidgets debug library. Without this dummy class the leak is not reproducible. Also if I remove the "parallel_for" there is no leak.
Additionally I have attached the complete VS 2012 project. To get consistent results I found it is necessary to do a full project rebuild (CTRL+ALT+F7), even after changing a single file only, else, the leak is not always reproducible.
So my question is: Is this a real leak? If not: how can the VS 2012 runtime be "pacified" to not show these messages? I cannot simply ignore the leak detector because it is an essential debugging feature. On the other hand the mere usage of TBB currently renders the leak detector useless by flooding debug messages for "leaks" that are triggered by TBB allocations.
Best, Zenju
Here is the debug log after program exit:
'ScalerTest.exe' (Win32): Loaded 'C:\Users\ZenJu\Desktop\ScalerTest\BUILD\ScalerTest.exe'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'ScalerTest.exe' (Win32): Loaded 'C:\Program Files\C++\wxWidgets\lib\vc10_x86_debug_dll\wxbase28ud_vc_custom.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr100d.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Users\ZenJu\Desktop\ScalerTest\BUILD\tbb_debug.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp100d.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\guard32.dll'. Cannot find or open the PDB file.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Symbols loaded.
'ScalerTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\fltLib.dll'. Symbols loaded.
The thread 0x1a1c has exited with code 0 (0x0).
The thread 0x19d4 has exited with code 0 (0x0).
The thread 0x504 has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
{309} normal block at 0x00A2DE98, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{308} normal block at 0x00A2DCD8, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{307} normal block at 0x00A2DB18, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{306} normal block at 0x00A2D958, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{305} normal block at 0x00A2D798, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{304} normal block at 0x00A2D5D8, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{303} normal block at 0x00A2D418, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{302} normal block at 0x00A2D248, 404 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{301} normal block at 0x00A2D1E8, 36 bytes long.
Data: <T B B W o r k > 54 00 42 00 42 00 20 00 57 00 6F 00 72 00 6B 00
{300} normal block at 0x00A2D028, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{299} normal block at 0x00A2B3E0, 28 bytes long.
Data: < > 00 00 00 00 E8 D1 A2 00 04 05 00 00 00 00 00 00
{298} normal block at 0x00A2CE68, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{297} normal block at 0x00A2CCA8, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{296} normal block at 0x00A2CAE8, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{295} normal block at 0x00A2C928, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{294} normal block at 0x00A2C768, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{293} normal block at 0x00A2B210, 404 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{292} normal block at 0x00A2B1B0, 36 bytes long.
Data: <T B B W o r k > 54 00 42 00 42 00 20 00 57 00 6F 00 72 00 6B 00
{291} normal block at 0x00A2B158, 28 bytes long.
Data: < > 00 00 00 00 B0 B1 A2 00 1C 1A 00 00 00 00 00 00
{277} normal block at 0x00A2ADD8, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{270} normal block at 0x00A2A188, 384 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{269} normal block at 0x00A2A140, 8 bytes long.
Data: < > AC 9F A2 00 00 00 00 00
{268} normal block at 0x00A2A0F8, 8 bytes long.
Data: <, > 2C 9F A2 00 00 00 00 00
{267} normal block at 0x00A2A0B0, 8 bytes long.
Data: < > AC 9E A2 00 00 00 00 00
{266} normal block at 0x00A2A068, 8 bytes long.
Data: <, > 2C 9E A2 00 00 00 00 00
{265} normal block at 0x00A29E28, 516 bytes long.
Data: < h > 04 00 00 00 68 A0 A2 00 00 00 00 00 00 00 00 00
{264} normal block at 0x00A29DE0, 8 bytes long.
Data: <L > 4C 9C A2 00 00 00 00 00
{263} normal block at 0x00A29D98, 8 bytes long.
Data: < > CC 9B A2 00 00 00 00 00
{262} normal block at 0x00A29D50, 8 bytes long.
Data: <L > 4C 9B A2 00 00 00 00 00
{261} normal block at 0x00A29D08, 8 bytes long.
Data: < > CC 9A A2 00 00 00 00 00
{260} normal block at 0x00A29AC8, 516 bytes long.
Data: < > 04 00 00 00 08 9D A2 00 00 00 00 00 00 00 00 00
{259} normal block at 0x00A29A80, 8 bytes long.
Data: < > EC 98 A2 00 00 00 00 00
{258} normal block at 0x00A29A38, 8 bytes long.
Data: <l > 6C 98 A2 00 00 00 00 00
{257} normal block at 0x00A299F0, 8 bytes long.
Data: < > EC 97 A2 00 00 00 00 00
{256} normal block at 0x00A299A8, 8 bytes long.
Data: <l > 6C 97 A2 00 00 00 00 00
{255} normal block at 0x00A29768, 516 bytes long.
Data: < > 04 00 00 00 A8 99 A2 00 00 00 00 00 00 00 00 00
{254} normal block at 0x00A28FA8, 1920 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{253} normal block at 0x00A28D68, 512 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{252} normal block at 0x00A28C80, 168 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{251} normal block at 0x00A28B40, 260 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
The program '[5228] ScalerTest.exe' has exited with code 0 (0x0).
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
did another quick test and I have not detected any memory leaks in TBB after deletingIt doesn't buy anything when after changing the test case the symptoms are gone. With this "approach" any bug could be dismissed as "not reproducible". Example: When removing the TBB "parallel_for" loop, the memory leaks are also gone in CRT ML. According to your logic, this would mean that in fact TBB is causing the leaks. See the contradiction?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When it is done I will try to reproduce ( testing TBB library only )Then you are still missing the main scenario of having both TBB and wxWidgets active at the same time. If the problem cannot be reproduced in isolation it essentially proves nothing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »