472,330 Members | 1,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,330 software developers and data experts.

Purifier Memory leak in the following code(Using vector)

Hi..,

While executing the following code in purifier..,

Expand|Select|Wrap|Line Numbers
  1.     std::vector<int> vecX;
  2.     vecX.clear();
  3.     int iCount = 0;
  4.     {
  5.         int iVal;
  6.         for (iVal=0; iVal<10;iVal++)
  7.         {
  8.             vecX.push_back(iVal);
  9.         }
  10.     }
  11.     iCount = vecX.size();
  12.     for (int iIndx = 0; iIndx < iCount; iIndx++)
  13.     {
  14.         std::cout << "Indx = " << iIndx << " Val = " << vecX.at(iIndx) << "\n";
  15.     }
  16.  
I got the following errors..,
Expand|Select|Wrap|Line Numbers
  1.   Error location
  2.         std::PAH::_Debug_range(int *,int *,wchar_t const *,unsigned int) [c:\program files\microsoft visual studio 8\vc\include\xutility.:1368]
  3.         ?_Uninit_copy@PAHPAHV?$allocator@H@std@@@std@@YAPAHPAH00AAV?$allocator@H@0@U_Scalar_ptr_iterator_tag@0@U_Range_checked_iterator_tag@0@@Z [c:\program files\microsoft visual studio 8\vc\include\memory.:124]
  4.         ?unchecked_uninitialized_copy@PAHPAHV?$allocator@H@std@@@stdext@@YAPAHPAH00AAV?$allocator@H@std@@@Z [c:\program files\microsoft visual studio 8\vc\include\memory.:674]
  5.         ?_Uninit_move@PAHPAHV?$allocator@H@std@@U_Undefined_move_tag@2@@std@@YAPAHPAH00AAV?$allocator@H@0@U_Undefined_move_tag@0@U_Range_checked_iterator_tag@0@@Z [c:\program files\microsoft visual studio 8\vc\include\memory.:160]
  6.         ?_Unchecked_uninitialized_move@PAHPAHV?$allocator@H@std@@@stdext@@YAPAHPAH00AAV?$allocator@H@std@@@Z [c:\program files\microsoft visual studio 8\vc\include\memory.:694]
  7.         std::vector<int,class std::allocator<int> >::PAH::_Umove(int *,int *,int *) [c:\program files\microsoft visual studio 8\vc\include\vector.:1112]
  8.         std::vector<int,allocator<int>::std>::_Insert_n(_Vector_iterator<int,allocator<int>::std>::std,UINT,int const&) [c:\program files\microsoft visual studio 8\vc\include\vector.:1143]
  9.         std::vector<int,allocator<int>::std>::insert(_Vector_iterator<int,allocator<int>::std>::std,int const&) [c:\program files\microsoft visual studio 8\vc\include\vector.:854]
  10.         std::vector<int,allocator<int>::std>::push_back(int const&) [c:\program files\microsoft visual studio 8\vc\include\vector.:800]
  11.         main           [c:\documents and settings\administrator\desktop\test\tst\test.cpp:22]
  12.  
  13. NOTE :- 
  14. Platform :- Windows XP..,
  15. IDE        :- Microsoft visual studion-2005
  16.  
  17. The following were the important settings I made in the project
  18. C/C++-> General-> Debug-information-format->  Program database
  19. C/C++-> Code generation-> Basic-runtime checks->  Default
  20. Linker-> General -> Enable-incremental linking -> NO
  21. Linker->  Command-Line->    /fixed:no

Any help/suggestions to solve this problems were most welcomed..,
with regards, Sathyanarayanan, Elvista
Jul 8 '08 #1
3 2595
TamusJRoyce
110 100+
I tried your code on mingw and it came up with no problem. Too lazy to try it using MSVC 2005. Sounds like you installed MSVC incorrectly.

Try importing your project into codeblocks (you may have to install it first : ). Then first try compiling it using MinGW compiler. Then, using codeblocks, set the compiler to Visual C++.NET 2005 and see what your results are.

ps. If it's a basic console program you should be ok, but if using MFC or something which mingw doesn't support, it will produce errors about missing .h files and such.
Jul 8 '08 #2
gpraghuram
1,275 Expert 1GB
Hi,
When using purify it may show some errors with the system libraries and i have hve seen it many a times.
I think you cna ignore those as you cant do anything about it unless you use a different compiler .

Raghuram
Jul 9 '08 #3
Thank you Mr.Raghu..,
I faced the problem in my component..,
I simulated the same error in the above mentioned test code..,
I proceed further & will get back if any more problem occurs in the SOA..,
with regards, Sathyan
Hi,
When using purify it may show some errors with the system libraries and i have hve seen it many a times.
I think you cna ignore those as you cant do anything about it unless you use a different compiler .

Raghuram
Jul 9 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Eduardo Hercos Rodrigues | last post by:
Hi, How to print directly from PHP code using CUPS? Thanks, "Eduardo Hercos Rodrigues"
2
by: Jim M | last post by:
I hate to pass data on the query string. Is there a way to pass data to the serverside vb code using the object in showmodaldialog. var myObject...
10
by: cijo | last post by:
Hi, My program has a pointer to a structure declared locally inside a function to which memory is allocated using malloc and reallocated later...
4
by: Martin | last post by:
Hello, I haven't found any answer on this - if it is possible or not. I have a PCI card with a memory on it. I have also a driver (written in ...
8
by: jmbn2k | last post by:
Hi Can anyone pls teme how to allocate memory using malloc in a 3 D diemensional array.............
0
by: jmbn2k | last post by:
Hii Can anyone pls teme...how to allocate memory using malloc in a 3 D dimensional array........
13
by: shsingh | last post by:
I have a class A containing some map as data variables. I creat an object of class A on heap by allocatiing memory by using "malloc". This will...
0
by: ApexData | last post by:
I have a Split Database. FE / BE. It has been working fine, on a server for months. The BE exists in a secure folder used by 5 users who have...
0
by: =?Utf-8?B?S2luZXRpYyBKdW1wIEFwcGxpZmUgZm9yIC5ORVQg | last post by:
Refactor .NET code using Visual Studio and Refactor! Pro Modifying the existing source code without changing its functionality is called...
4
by: pghantasala | last post by:
How to get available physical memory using javascript NOT USING WMI ?? any other way? I need to achieve this by using javascript/vbscript and I...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.