在MFC应用程序内部使用时TBB内存泄漏 [英] TBB memory leaks when using inside of MFC application

查看:176
本文介绍了在MFC应用程序内部使用时TBB内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello stackoverflower,

Hello stackoverflower,

操作系统:Windows 7 x64 SP1; TBB版本:4.2.0;编译程序:Visual Studio 2012。

Operation system: Windows 7 x64 SP1; TBB version: 4.2.0; Compiler: Visual Studio 2012.

问题描述:

TBB转储MFC应用程序出口的内存泄漏。相同的代码不会转储任何泄漏,当使用从简单的命令行程序。它看起来像一个DLL卸载顺序问题。由于晚期tbb.dll卸载调试程序会将一些静态变量转储为泄漏。

TBB dumps memory leaks on the exit of MFC application. The same code doesn't dump any leaks, when used from simple command line program. It looks like a DLL unload order problem. Due to late tbb.dll unloading the debuger dumps some static variables as leaks.

有人可以确认此问题吗?是否有任何工作?

Can someone confirm this issue? Is there any work around?

我也将此问题发布到英特尔论坛。在这里你可以找到两个测试应用程序:命令行和MFC。

I also posted this question to Intel forum. There you can find the both test applications: command line and MFC.

这里是内存转储:

Detected memory leaks!
Dumping objects ->
{608} normal block at 0x00457970, 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
{607} normal block at 0x00457918, 28 bytes long.
 Data: <    pyE         > 00 00 00 00 70 79 45 00 98 0F 00 00 00 00 00 00
{605} normal block at 0x0044ED98, 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
{590} normal block at 0x00450AD8, 28 bytes long.
 Data: <      D         > 00 00 00 00 98 ED 44 00 04 20 00 00 00 00 00 00
{583} normal block at 0x00455AD8, 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
{582} normal block at 0x00455A80, 28 bytes long.
 Data: <     ZE  .      > 00 00 00 00 D8 5A 45 00 98 2E 00 00 00 00 00 00
{580} normal block at 0x00455860, 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
{579} normal block at 0x00455808, 28 bytes long.
 Data: <    `XE         > 00 00 00 00 60 58 45 00 EC 18 00 00 00 00 00 00
{569} normal block at 0x00453EC8, 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
{568} normal block at 0x00453E70, 28 bytes long.
 Data: <     >E  0      > 00 00 00 00 C8 3E 45 00 FC 30 00 00 00 00 00 00
{566} normal block at 0x00453C50, 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
{565} normal block at 0x0044D338, 28 bytes long.
 Data: <    P<E         > 00 00 00 00 50 3C 45 00 D8 08 00 00 00 00 00 00
{546} normal block at 0x0044F248, 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
{536} normal block at 0x00451128, 28 bytes long.
 Data: <    H D  !      > 00 00 00 00 48 F2 44 00 14 21 00 00 00 00 00 00
{531} normal block at 0x00450518, 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
{530} normal block at 0x004504C0, 28 bytes long.
 Data: <      E T!      > 00 00 00 00 18 05 45 00 54 21 00 00 00 00 00 00
{528} normal block at 0x00450290, 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
{527} normal block at 0x00450238, 28 bytes long.
 Data: <      E 8       > 00 00 00 00 90 02 45 00 38 18 00 00 00 00 00 00
{518} normal block at 0x0044EE68, 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
{517} normal block at 0x0044EE10, 28 bytes long.
 Data: <    h D  2      > 00 00 00 00 68 EE 44 00 B0 32 00 00 00 00 00 00
{507} normal block at 0x0044B190, 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
{505} normal block at 0x0044D3B0, 28 bytes long.
 Data: <      D  '      > 00 00 00 00 90 B1 44 00 18 27 00 00 00 00 00 00
Object dump complete.
The program '[12168] TbbMfcTest.exe: Native' has exited with code 0 (0x0).


推荐答案

如果你侦察TBB来源,分配内存块而不适当释放它(即market :: create_one_job()为_-> wskdup(name)分配h-> nameW的名称。

If you spy the TBB sources, it seems that TBB allocates a memory block without proper releasing it (i.e. market::create_one_job() allocates a name for h->nameW with _wcsdup(name)).

如果情况确实如此,最好是向英特尔报告这一点,但警告说,如果这确实是一个真正的内存泄漏,可能会讨论。我们喜欢在输出窗口中保留零内存转储报告,因为很快就不能区分真正的那些与无害的。

If this is indeed the case, it would be best if one reports this to Intel but be warned that one might get into a discussion if this is indeed a true memory leak. We like to keep zero memory dump reports in the output window, because soon one can't distinguish the real ones with the harmless ones.

这篇关于在MFC应用程序内部使用时TBB内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆