Community
cancel
Showing results for 
Search instead for 
Did you mean: 
romko
Beginner
52 Views

malloc proxy on "windows 2003" compatibility issue

Hi all,

I am trying to substitute original "malloc"-functionality with TBB's one using "#include " in a global include file. The result works fine on "Windows Vista" but crashes on "Windows 2003" while accessing memory allocation tracking structures. Are there any known OS compatibility issues with malloc proxy? I have mixed (managed/unmanaged) sytem with some DLLs delay-loaded. Compiler is VS2008.

Thanks!
0 Kudos
4 Replies
52 Views

hi

What tbb version and OS arch have you used?

BTW you can try Nov,1 development release. It should contain fixes for all known issues with malloc replacement on windows

--Vladimir
romko
Beginner
52 Views

hi

What tbb version and OS arch have you used?

BTW you can try Nov,1 development release. It should contain fixes for all known issues with malloc replacement on windows

--Vladimir

hi Vladimir,

i've used versiontbb22_009oss - 2.2 Update 1, Commercially Aligned Release, ia32vc9, debug and release versions, so no building TBB libraries myself. I try to use the latest development version to see if it helped.

thanks for help!
romko
Beginner
52 Views

Quoting - ro mko

hi Vladimir,

i've used versiontbb22_009oss - 2.2 Update 1, Commercially Aligned Release, ia32vc9, debug and release versions, so no building TBB libraries myself. I try to use the latest development version to see if it helped.

thanks for help!

hi,

i've downloaded and tried newest development version of TBB. While trying to prepare environment for my original problem (some configuration files had to be generated), I had a crash on Windows Vista in debug version compiled with MS Visual Studio 9 compiler in following scenario:

- a std::vector<:STRING> object is created on stack in managed dll
- then it is passed via pointer to unmanaged DLL code, which allocates memory using "scallable_alloc" on "push_back"
- execution returns to managed dll and tries to clear vector object upon going out of scope
- process crashes because wrong delete (not scalable free) funtion is called, but "_free_dbg" from "afxmem.cpp".

This leads me to conclusion that my original problems not necessarily OS-related only but also managed/unmanaged/mfc DLL combination-related and it looks like the allocation hook didn't work for my managed code DLL. I had this crash with both my original (tbb22_009oss - 2.2 Update 1, Commercially Aligned Release) and latest development TBB versions.

Hope this information helps somehow to pin down the problem.
52 Views

Thanks for detailed explanation! it looks you use 2 mixed global new/delete operators, the one from mfc and another one from runtime. It is a luck that they workwith the same heap. But i'm pretty sure that it stops working if you'd like to use static runtime or mix debug and release configuration of different dlls. Unfortunately wedo not cover visual studio specific debug api and we replace new/delete pair in runtime only. This caused the problem. We will think more about what we can do here.

btw you can useone allocator for both cases, for example tbb::scalable_allocator:)

--Vladimir

Reply