473,734 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Purifier Memory leak in the following code(Using vector)

2 New Member
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 2824
TamusJRoyce
110 New Member
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 Recognized Expert Top Contributor
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
vrsathyan
2 New Member
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
12684
by: Eduardo Hercos Rodrigues | last post by:
Hi, How to print directly from PHP code using CUPS? Thanks, "Eduardo Hercos Rodrigues"
2
565
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 = new Object(); var retVal = new Object(); myObject.calltype = "Edit" retVal = showModalDialog("Test.aspx",myObject,"dialogWidth:700px;dialogHeight:550px;s tatus:0");
10
2400
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 using realloc, and when I try to free the memory at the end of the function, the program breaks down. While debugging, I find that the address to which the pointer is pointing is changed during one of the realloc calls. But as per the documentation on realloc, the change of address is perfectly...
4
2363
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 C++) that maps the memory from the card to user mode - I need very fast access to this memory, that's why I need to map it directly to my program.
8
7714
by: jmbn2k | last post by:
Hi Can anyone pls teme how to allocate memory using malloc in a 3 D diemensional array.............
0
1311
by: jmbn2k | last post by:
Hii Can anyone pls teme...how to allocate memory using malloc in a 3 D dimensional array........
13
9723
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 return me the required memory but the object is not initialized properly as constructor same is not get called ( as per the behavior). How to call a constructor explicitly if we want to allocate memory using malloc ?
0
1428
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 full rights to the application. A number of other users need to use the application just for the purpose of viewing the data. Because of security issues (ie concerns of the BE being deleted, I want to simply copy the existing BE to another Folder that is open to these users. If the copied BE...
0
1543
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 refactoring of Source Code. Visual Studio gives us a lots of features for doing Refactoring the .NET Source Code, but sometime these are not sufficient for true .net developers. http://msdotnetsupport.blogspot.com/2008/02/refactor-net-code-visual-studio-and.html
4
7890
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 cannot use WMI. Please let me know the possibilities.
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.